summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/resize.c
diff options
context:
space:
mode:
authormaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-01 10:26:56 +0000
committermaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-01 10:26:56 +0000
commit2faf923e020ca38623b4eeaae90e4d8184e60e9f (patch)
tree91b63e5384b2f85473d930ed4c59065f8315344e /beryl-plugins/src/resize.c
parentd54444c15ad3fb7ea8183f7e7197d4bd87134efc (diff)
downloadmarex-dev-2faf923e020ca38623b4eeaae90e4d8184e60e9f.tar.gz
marex-dev-2faf923e020ca38623b4eeaae90e4d8184e60e9f.tar.bz2
resize plugin: revert r1470 (broke window shrinking with keyboard), r1481 was a better fix for #69
git-svn-id: file:///beryl/trunk@1482 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/resize.c')
-rw-r--r--beryl-plugins/src/resize.c34
1 files changed, 5 insertions, 29 deletions
diff --git a/beryl-plugins/src/resize.c b/beryl-plugins/src/resize.c
index 432b003..8291a09 100644
--- a/beryl-plugins/src/resize.c
+++ b/beryl-plugins/src/resize.c
@@ -133,7 +133,6 @@ typedef struct _ResizeDisplay {
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 @@ static Bool resizeInitiate (CompDisplay *d,
* 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 @@ static Bool resizeTerminate (CompDisplay *d,
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 @@ static Bool resizeTerminate (CompDisplay *d,
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 @@ static void resizeHandleMotionEvent (CompScreen *s, int xRoot, int yRoot)
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 @@ static void resizeHandleEvent (CompDisplay *d, XEvent *event)
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;