From a09984bbc076bc37b11058237f51fa15114129e2 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 20 Aug 2003 23:01:56 +0000 Subject: [PATCH] add an obscured flag that tracks if the frame is at all obscured --- openbox/event.c | 3 +++ openbox/frame.c | 4 +++- openbox/frame.h | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) 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; -- 2.45.2