diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-09-02 19:59:33 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-09-02 19:59:33 +0000 |
| commit | d5f823db680a2782b2c672ac460f740379cb015a (patch) | |
| tree | 31805039ea13bdf0ad490b4f2f6a7ee2389c5bf8 | |
| parent | a9c02d62e812f1fd71b00ed4323fec3012fe6ce2 (diff) | |
more fixes to keep the pointer stuff aligned when doing keyboard move/resize
| -rw-r--r-- | openbox/moveresize.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/openbox/moveresize.c b/openbox/moveresize.c index ee6e000f..b43aa576 100644 --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@ -317,6 +317,7 @@ void moveresize_event(XEvent *e) start_y += dy - (cur_y - oy); } else if (corner == prop_atoms.net_wm_moveresize_move_keyboard) { int dx = 0, dy = 0, ox = cur_x, oy = cur_y; + int opx, px, opy, py; if (e->xkey.keycode == ob_keycode(OB_KEY_RIGHT)) dx = 4; @@ -331,6 +332,7 @@ void moveresize_event(XEvent *e) cur_x += dx; cur_y += dy; + screen_pointer_pos(&opx, &opy); XWarpPointer(ob_display, None, None, 0, 0, 0, 0, dx, dy); /* steal the motion events this causes */ XSync(ob_display, FALSE); @@ -338,6 +340,7 @@ void moveresize_event(XEvent *e) XEvent ce; while (XCheckTypedEvent(ob_display, MotionNotify, &ce)); } + screen_pointer_pos(&px, &py); do_move(FALSE); @@ -345,8 +348,8 @@ void moveresize_event(XEvent *e) not nessesarily (resistance), this adjusts where the curor thinks it started so that it keeps up with where the window actually is */ - start_x += dx - (cur_x - ox); - start_y += dy - (cur_y - oy); + start_x += (px - opx) - (cur_x - ox); + start_y += (py - opy) - (cur_y - oy); } } } |
