X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fpopup.c;h=f132d9df2afcdd9b94a2ee543ea866fd63368737;hb=0417d1226c7a523cd4420195d86dd744f514b2fe;hp=45e75fd70113e73e3bcfbd5a4dd2796b5472e892;hpb=c4e4760c41f10aae6af19a4363cb247c71edee4b;p=chaz%2Fopenbox diff --git a/openbox/popup.c b/openbox/popup.c index 45e75fd7..f132d9df 100644 --- a/openbox/popup.c +++ b/openbox/popup.c @@ -1,6 +1,7 @@ -/* -*- indent-tabs-mode: t; tab-width: 4; c-basic-offset: 4; -*- +/* -*- 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); @@ -194,7 +204,7 @@ void popup_show(ObPopup *self, gchar *text) if (!self->mapped) { XMapWindow(ob_display, self->bg); - stacking_raise(INTERNAL_AS_WINDOW(self)); + stacking_raise(INTERNAL_AS_WINDOW(self), FALSE); self->mapped = TRUE; } } @@ -248,7 +258,7 @@ void icon_popup_free(ObIconPopup *self) } void icon_popup_show(ObIconPopup *self, - gchar *text, struct _ObClientIcon *icon) + gchar *text, const ObClientIcon *icon) { if (icon) { self->a_icon->texture[0].type = RR_TEXTURE_RGBA;