]> Dogcows Code - chaz/openbox/blobdiff - openbox/moveresize.c
if this works, i will be amazed. <resize><popupShow>nbr<//> nbr = 0 never show size...
[chaz/openbox] / openbox / moveresize.c
index 9f0f41ba7e51c546aea225c22b97f93fab07761b..4b46e175bf1850537934d2d6ea0db7f241fdf096 100644 (file)
@@ -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;
This page took 0.024622 seconds and 4 git commands to generate.