X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fmoveresize.c;h=4b46e175bf1850537934d2d6ea0db7f241fdf096;hb=7d1382a984a29c03a1c2c48fb77244c9d3a839f0;hp=9f0f41ba7e51c546aea225c22b97f93fab07761b;hpb=638fc4b70b550fa1e39667cb5f3d0263c3e8b34e;p=chaz%2Fopenbox diff --git a/openbox/moveresize.c b/openbox/moveresize.c index 9f0f41ba..4b46e175 100644 --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@ -38,8 +38,8 @@ ObClient *moveresize_client = NULL; static gboolean moving = FALSE; /* TRUE - moving, FALSE - resizing */ -static int start_x, start_y, start_cx, start_cy, start_cw, start_ch; -static int cur_x, cur_y; +static gint start_x, start_y, start_cx, start_cy, start_cw, start_ch; +static gint cur_x, cur_y; static guint button; static guint32 corner; static ObCorner lockcorner; @@ -72,9 +72,9 @@ void moveresize_shutdown(gboolean reconfig) popup = NULL; } -static void popup_coords(ObClient *c, char *format, int a, int b) +static void popup_coords(ObClient *c, gchar *format, gint a, gint b) { - char *text; + gchar *text; text = g_strdup_printf(format, a, b); popup_position(popup, CenterGravity, @@ -86,7 +86,7 @@ static void popup_coords(ObClient *c, char *format, int a, int b) g_free(text); } -void moveresize_start(ObClient *c, int x, int y, guint b, guint32 cnr) +void moveresize_start(ObClient *c, gint x, gint y, guint b, guint32 cnr) { ObCursor cur; @@ -195,6 +195,10 @@ static void do_move(gboolean resist) client_configure(moveresize_client, OB_CORNER_TOPLEFT, cur_x, cur_y, moveresize_client->area.width, moveresize_client->area.height, TRUE, FALSE); + if (config_resize_popup_show == 2) + popup_coords(moveresize_client, "%d x %d", + moveresize_client->frame->area.x, + moveresize_client->frame->area.y); } static void do_resize(gboolean resist) @@ -220,8 +224,11 @@ static void do_resize(gboolean resist) /* this would be better with a fixed width font ... XXX can do it better if there are 2 text boxes */ - if (moveresize_client->size_inc.width > 1 || - moveresize_client->size_inc.height > 1) + if (config_resize_popup_show == 2 || + (config_resize_popup_show == 1 && + (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); @@ -297,7 +304,7 @@ void moveresize_event(XEvent *e) moveresize_end(FALSE); else { if (corner == prop_atoms.net_wm_moveresize_size_keyboard) { - int dx = 0, dy = 0, ox = cur_x, oy = cur_y; + gint dx = 0, dy = 0, ox = cur_x, oy = cur_y; if (e->xkey.keycode == ob_keycode(OB_KEY_RIGHT)) dx = MAX(4, moveresize_client->size_inc.width); @@ -329,8 +336,8 @@ void moveresize_event(XEvent *e) start_x += dx - (cur_x - ox); 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; + gint dx = 0, dy = 0, ox = cur_x, oy = cur_y; + gint opx, px, opy, py; if (e->xkey.keycode == ob_keycode(OB_KEY_RIGHT)) dx = 4;