summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--openbox/event.c3
-rw-r--r--openbox/frame.c4
-rw-r--r--openbox/frame.h4
3 files changed, 10 insertions, 1 deletions
diff --git a/openbox/event.c b/openbox/event.c
index ed0e0965..8c640522 100644
--- a/openbox/event.c
+++ b/openbox/event.c
@@ -621,6 +621,9 @@ static void event_handle_client(ObClient *client, XEvent *e)
ObFrameContext con;
switch (e->type) {
+ case VisibilityNotify:
+ client->frame->obscured = e->xvisibility.state != VisibilityUnobscured;
+ break;
case ButtonPress:
case ButtonRelease:
/* Wheel buttons don't draw because they are an instant click, so it
diff --git a/openbox/frame.c b/openbox/frame.c
index 0d5ddb2e..a38bcfbe 100644
--- a/openbox/frame.c
+++ b/openbox/frame.c
@@ -8,7 +8,8 @@
#define PLATE_EVENTMASK (SubstructureRedirectMask | ButtonPressMask)
#define FRAME_EVENTMASK (EnterWindowMask | LeaveWindowMask | \
- ButtonPressMask | ButtonReleaseMask)
+ ButtonPressMask | ButtonReleaseMask | \
+ VisibilityChangeMask)
#define ELEMENT_EVENTMASK (ButtonPressMask | ButtonReleaseMask | \
ButtonMotionMask | ExposureMask | \
EnterWindowMask | LeaveWindowMask)
@@ -36,6 +37,7 @@ ObFrame *frame_new()
self = g_new(ObFrame, 1);
self->visible = FALSE;
+ self->obscured = TRUE;
self->decorations = 0;
/* create all of the decor windows */
diff --git a/openbox/frame.h b/openbox/frame.h
index 6bb69599..5072d091 100644
--- a/openbox/frame.h
+++ b/openbox/frame.h
@@ -54,6 +54,10 @@ struct _ObFrame
Strut size;
Rect area;
gboolean visible;
+
+ /*! Whether the window is obscured at all or fully visible. */
+ gboolean obscured;
+
guint decorations;
Window title;