diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-05-11 23:31:43 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-05-11 23:31:43 +0000 |
| commit | 7c7868f47d42796a236c9a1813bed5fe9f0d4f41 (patch) | |
| tree | 0b9d71986738ed2a4a13071fabe538f2f813c7df /openbox/popup.c | |
| parent | fed4a9e70b516a404ebf93024a32d849f81a8e7d (diff) | |
add internal popups n shit to the stacking list.
some cleanups for the stacking order hint.
add non-opaque move/resize. cant toggle it yet.
Diffstat (limited to 'openbox/popup.c')
| -rw-r--r-- | openbox/popup.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/openbox/popup.c b/openbox/popup.c index f20aa006..17462d39 100644 --- a/openbox/popup.c +++ b/openbox/popup.c @@ -1,13 +1,18 @@ #include "openbox.h" #include "frame.h" +#include "window.h" +#include "stacking.h" #include "render/render.h" #include "render/theme.h" typedef struct Popup { - gboolean hasicon; + ObWindow obwin; Window bg; + Window icon; Window text; + + gboolean hasicon; Appearance *a_bg; Appearance *a_icon; Appearance *a_text; @@ -16,16 +21,21 @@ typedef struct Popup { int y; int w; int h; + gboolean mapped; } Popup; Popup *popup_new(gboolean hasicon) { Popup *self = g_new(Popup, 1); + self->obwin.type = Window_Internal; self->hasicon = hasicon; self->bg = None; self->a_text = NULL; self->gravity = NorthWestGravity; self->x = self->y = self->w = self->h = 0; + self->mapped = FALSE; + stacking_add(self); + stacking_raise(INTERNAL_AS_WINDOW(self)); return self; } @@ -41,6 +51,7 @@ void popup_free(Popup *self) } if (self->a_text) appearance_free(self->a_text); + stacking_remove(self); g_free(self); } @@ -206,10 +217,17 @@ void popup_show(Popup *self, char *text, Icon *icon) if (self->hasicon) paint(self->icon, self->a_icon); - XMapWindow(ob_display, self->bg); + if (!self->mapped) { + XMapWindow(ob_display, self->bg); + stacking_raise(INTERNAL_AS_WINDOW(self)); + self->mapped = TRUE; + } } void popup_hide(Popup *self) { - XUnmapWindow(ob_display, self->bg); + if (self->mapped) { + XUnmapWindow(ob_display, self->bg); + self->mapped = FALSE; + } } |
