summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@comhem.se>2004-03-21 01:15:18 +0000
committerMikael Magnusson <mikachu@comhem.se>2004-03-21 01:15:18 +0000
commitacc6124682c674e16b896bfe6b54c94f12f4cb87 (patch)
tree31ec0ef1ec93f7ac6eecb96c18afcbc5feb437f3 /openbox
parent335e8acbfc5d2824f1fd2cb67a5add8e1ed40b06 (diff)
limit the size popup to the screen, maybe this doesnt work with xinerama though?
Diffstat (limited to 'openbox')
-rw-r--r--openbox/popup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/openbox/popup.c b/openbox/popup.c
index 3df451b5..9823ff2a 100644
--- a/openbox/popup.c
+++ b/openbox/popup.c
@@ -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);