]> Dogcows Code - chaz/openbox/commitdiff
adds option to have the popup centered above the window instead of centered, and...
authorMikael Magnusson <mikachu@comhem.se>
Sun, 21 Mar 2004 00:48:48 +0000 (00:48 +0000)
committerMikael Magnusson <mikachu@comhem.se>
Sun, 21 Mar 2004 00:48:48 +0000 (00:48 +0000)
openbox/config.c
openbox/config.h
openbox/moveresize.c

index 6a8dfaca1fa9fe6d5dfb002262e0ebc21e4facd2..63ad67944061d60ff882922057a5de22fec935ef 100644 (file)
@@ -42,6 +42,7 @@ gint    config_screen_firstdesk;
 
 gboolean config_resize_redraw;
 gint     config_resize_popup_show;
+gint     config_resize_popup_pos;
 
 ObStackingLayer config_dock_layer;
 gboolean        config_dock_floating;
@@ -301,6 +302,12 @@ static void parse_resize(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
         else if (parse_contains("Nonpixel", doc, n))
             config_resize_popup_show = 1;
     }
+    if ((n = parse_find_node("popupPosition", node))) {
+        if (parse_contains("Top", doc, n))
+            config_resize_popup_pos = 1;
+        else if (parse_contains("Center", doc, n))
+            config_resize_popup_pos = 0;
+    }
 }
 
 static void parse_dock(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
@@ -540,7 +547,8 @@ void config_startup(ObParseInst *i)
     parse_register(i, "desktops", parse_desktops, NULL);
 
     config_resize_redraw = TRUE;
-    config_resize_popup_show = 1;
+    config_resize_popup_show = 1; /* nonpixel increments */
+    config_resize_popup_pos = 0;  /* center of client */
 
     parse_register(i, "resize", parse_resize, NULL);
 
index 59ac554297a81d93b80ffcf43c20a75f3c64347f..ebe13a136b2ea4e92fd9e8963370472d8e2163c6 100644 (file)
@@ -43,7 +43,12 @@ extern ObPlacePolicy config_place_policy;
 
 /*! When true windows' contents are refreshed while they are resized; otherwise
   they are not updated until the resize is complete */
-extern gboolean config_redraw_resize;
+extern gboolean config_resize_redraw;
+/*! show move/resize popups? 0 = no, 1 = always, 2 = only
+  resizing !1 increments */
+extern gint config_resize_popup_show;
+/*! where to show the popup, currently above the window or centered */
+extern gint config_resize_popup_pos;
 
 /*! The stacking layer the dock will reside in */
 extern ObStackingLayer config_dock_layer;
index 68c7512907186e3b1a29dd6d8ec8c5cb94232709..71241117ce824627da006a557473c3cbcdce271a 100644 (file)
@@ -77,11 +77,17 @@ static void popup_coords(ObClient *c, gchar *format, gint a, gint b)
     gchar *text;
 
     text = g_strdup_printf(format, a, b);
-    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);
+    if (config_resize_popup_pos == 1) /* == "Top" */
+        popup_position(popup, SouthGravity,
+                       c->frame->area.x
+                     + c->frame->area.width/2,
+                       c->frame->area.y);
+    else /* == "Center" */
+        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);
     popup_show(popup, text);
     g_free(text);
 }
This page took 0.033022 seconds and 4 git commands to generate.