]> Dogcows Code - chaz/openbox/commitdiff
limit the size popup to the screen, maybe this doesnt work with xinerama though?
authorMikael Magnusson <mikachu@comhem.se>
Sun, 21 Mar 2004 01:15:18 +0000 (01:15 +0000)
committerMikael Magnusson <mikachu@comhem.se>
Sun, 21 Mar 2004 01:15:18 +0000 (01:15 +0000)
openbox/popup.c

index 3df451b56adeae0ba3ab33787443dd38eee40896..9823ff2a07b08ba8801391b2b5179d696204b795 100644 (file)
@@ -105,6 +105,10 @@ void popup_show(ObPopup *self, gchar *text)
     gint x, y, w, h;
     gint textw, texth;
     gint iconw;
+    Rect *area; /* won't go outside this */
+
+    area = screen_physical_area_monitor(0); /* XXX i'm guessing this
+                                               is wrong for xinerama? */
 
     RrMargins(self->a_bg, &l, &t, &r, &b);
 
@@ -170,6 +174,9 @@ void popup_show(ObPopup *self, gchar *text)
         break;
     }
 
+    x=MAX(MIN(x, area->width-w),0);
+    y=MAX(MIN(y, area->height-h),0);
+
     /* set the windows/appearances up */
     XMoveResizeWindow(ob_display, self->bg, x, y, w, h);
 
This page took 0.02269 seconds and 4 git commands to generate.