[beryl-commits] r1481 - trunk/beryl-plugins/src
maniac at server.beryl-project.org
maniac at server.beryl-project.org
Sat Dec 2 00:22:44 CET 2006
Author: maniac
Date: 2006-12-02 00:22:43 +0100 (Sat, 02 Dec 2006)
New Revision: 1481
Modified:
trunk/beryl-plugins/src/resize.c
Log:
resize plugin: revert r1470 (broke window shrinking with keyboard), r1481 was a better fix for #69
Modified: trunk/beryl-plugins/src/resize.c
===================================================================
--- trunk/beryl-plugins/src/resize.c 2006-12-01 10:25:18 UTC (rev 1480)
+++ trunk/beryl-plugins/src/resize.c 2006-12-01 23:22:43 UTC (rev 1481)
@@ -133,7 +133,6 @@
int currentX;
int currentY;
int xdelta, ydelta; /* Offset when resize started */
- Bool keyResize;
int dx_to_apply, dy_to_apply, width_to_apply, height_to_apply;
@@ -432,11 +431,9 @@
* will resize up and to the left. Keyboard resize starts out
* with the cursor in the middle of the window and then starts
* resizing the edge corresponding to the next key press. */
- rd->keyResize = FALSE;
if (state & CompActionStateInitKey)
- rd->keyResize = TRUE;
-
- if (!mask) {
+ mask = 0;
+ else if (!mask) {
mask |= ((x - w->attrib.x) < (w->width / 2)) ?
ResizeLeftMask : ResizeRightMask;
@@ -560,6 +557,8 @@
action->state &= ~(CompActionStateTermKey | CompActionStateTermButton);
+ printf("resizeTerminate called, state = %x, rd->w = %p\n", state, rd->w);
+
if (!rd->w)
return FALSE;
@@ -577,7 +576,7 @@
configureXWindow (rd->w, CWX | CWY | CWWidth | CWHeight, &xwc);
resizeWindow (rd->w, rd->savedAttrib.x, rd->savedAttrib.y, rd->savedAttrib.width, rd->savedAttrib.height, rd->w->attrib.border_width);
- } else if (rd->resizeMode != ResizeModeNormal)
+ } else if (rd->resizeMode != ResizeModeNormal)
resizeUpdateWindowRealSize (d, 0);
else
syncWindowPosition (rd->w);
@@ -670,14 +669,6 @@
if (!rs->grabIndex)
return;
- if (rd->keyResize && rd->w)
- {
- rd->mask = ((xRoot - rd->w->attrib.x) < (rd->w->width / 2)) ?
- ResizeLeftMask : ResizeRightMask;
- rd->mask |= ((yRoot - rd->w->attrib.y) < (rd->w->height / 2)) ?
- ResizeUpMask : ResizeDownMask;
- }
-
pointerDx = xRoot - rd->currentX;
pointerDy = yRoot - rd->currentY;
@@ -799,21 +790,6 @@
case KeyRelease:
break;
- case ButtonPress:
- s = findScreenAtDisplay (d, event->xbutton.root);
- if (s)
- {
- RESIZE_SCREEN (s);
-
- if (rs->grabIndex)
- {
- resizeTerminate (d,
- &rd->opt[RESIZE_DISPLAY_OPTION_INITIATE].value.action,
- 0, NULL, 0);
- }
- }
- break;
-
case ButtonRelease: {
CompAction *action =
&rd->opt[RESIZE_DISPLAY_OPTION_INITIATE].value.action;
More information about the commits
mailing list