-static void popup_coords(char *format, int a, int b)
+static void popup_coords(ObClient *c, char *format, int a, int b)
- area = screen_physical_area_monitor(0);
- popup_position(popup, NorthWestGravity,
- POPUP_X + area->x, POPUP_Y + area->y);
+ popup_position(popup, CenterGravity,
+ c->frame->area.x + c->frame->size.left +
+ c->area.width / 2,
+ c->frame->area.y + c->frame->size.top +
+ c->area.height / 2);
increment instead of at 0, so you have to move half an increment
either way instead of a full increment one and 1 px the other. and this
is one large mother fucking comment. */
increment instead of at 0, so you have to move half an increment
either way instead of a full increment one and 1 px the other. and this
is one large mother fucking comment. */
- start_cw = c->area.width + (c->size_inc.width + 1) / 2;
- start_ch = c->area.height + (c->size_inc.height + 1) / 2;
+ start_cw = c->area.width + c->size_inc.width / 2;
+ start_ch = c->area.height + c->size_inc.height / 2;
if (resist)
resist_move_windows(moveresize_client, &cur_x, &cur_y);
resist_move_monitors(moveresize_client, &cur_x, &cur_y);
if (resist)
resist_move_windows(moveresize_client, &cur_x, &cur_y);
resist_move_monitors(moveresize_client, &cur_x, &cur_y);
frame_frame_gravity(moveresize_client->frame, &cur_x, &cur_y);
client_configure(moveresize_client, OB_CORNER_TOPLEFT, cur_x, cur_y,
start_cw, start_ch, TRUE, FALSE);
frame_frame_gravity(moveresize_client->frame, &cur_x, &cur_y);
client_configure(moveresize_client, OB_CORNER_TOPLEFT, cur_x, cur_y,
start_cw, start_ch, TRUE, FALSE);
-
- /* this would be better with a fixed width font ... XXX can do it better
- if there are 2 text boxes */
- a = screen_area(screen_desktop);
- popup_coords("X: %4d Y: %4d",
- moveresize_client->frame->area.x - a->x,
- moveresize_client->frame->area.y - a->y);
moveresize_client->frame->size.right;
cur_y -= moveresize_client->frame->size.top +
moveresize_client->frame->size.bottom;
moveresize_client->frame->size.right;
cur_y -= moveresize_client->frame->size.top +
moveresize_client->frame->size.bottom;
client_configure(moveresize_client, lockcorner,
moveresize_client->area.x, moveresize_client->area.y,
cur_x, cur_y, TRUE, FALSE);
/* this would be better with a fixed width font ... XXX can do it better
if there are 2 text boxes */
client_configure(moveresize_client, lockcorner,
moveresize_client->area.x, moveresize_client->area.y,
cur_x, cur_y, TRUE, FALSE);
/* this would be better with a fixed width font ... XXX can do it better
if there are 2 text boxes */
- popup_coords("W: %4d H: %4d", moveresize_client->logical_size.width,
- moveresize_client->logical_size.height);
+ if (moveresize_client->size_inc.width > 1 ||
+ moveresize_client->size_inc.height > 1)
+ popup_coords(moveresize_client, "%d x %d",
+ moveresize_client->logical_size.width,
+ moveresize_client->logical_size.height);
if (e->xkey.keycode == ob_keycode(OB_KEY_RIGHT))
dx = MAX(4, moveresize_client->size_inc.width);
if (e->xkey.keycode == ob_keycode(OB_KEY_RIGHT))
dx = MAX(4, moveresize_client->size_inc.width);
cur_x += dx;
cur_y += dy;
XWarpPointer(ob_display, None, None, 0, 0, 0, 0, dx, dy);
cur_x += dx;
cur_y += dy;
XWarpPointer(ob_display, None, None, 0, 0, 0, 0, dx, dy);
+ /* steal the motion events this causes */
+ XSync(ob_display, FALSE);
+ {
+ XEvent ce;
+ while (XCheckTypedEvent(ob_display, MotionNotify, &ce));
+ }
+
+ /* because the cursor moves even though the window does
+ 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);
XWarpPointer(ob_display, None, None, 0, 0, 0, 0, dx, dy);
XWarpPointer(ob_display, None, None, 0, 0, 0, 0, dx, dy);
+ /* steal the motion events this causes */
+ XSync(ob_display, FALSE);
+ {
+ XEvent ce;
+ while (XCheckTypedEvent(ob_display, MotionNotify, &ce));
+ }
+ screen_pointer_pos(&px, &py);
+
+ /* because the cursor moves even though the window does
+ not nessesarily (resistance), this adjusts where the curor
+ thinks it started so that it keeps up with where the window
+ actually is */
+ start_x += (px - opx) - (cur_x - ox);
+ start_y += (py - opy) - (cur_y - oy);