X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fpopup.c;h=fb7c90950bc2177fffcd4611444641ec2fbe2f7e;hb=3afbf3d597ef45a122ae58203a126c57f9796f7b;hp=3df451b56adeae0ba3ab33787443dd38eee40896;hpb=f6ba1f27b9790f56bda1e5831069e2dd7e2c96a2;p=chaz%2Fopenbox diff --git a/openbox/popup.c b/openbox/popup.c index 3df451b5..fb7c9095 100644 --- a/openbox/popup.c +++ b/openbox/popup.c @@ -1,6 +1,7 @@ /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- popup.c for the Openbox window manager + Copyright (c) 2004 Mikael Magnusson Copyright (c) 2003 Ben Jansens This program is free software; you can redistribute it and/or modify @@ -105,6 +106,12 @@ 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(); /* XXX this should work quite + good, someone with xinerama, + and different resolutions on + screens? */ RrMargins(self->a_bg, &l, &t, &r, &b); @@ -170,6 +177,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);