summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2011-10-14 17:39:24 -0400
committerDana Jansens <danakj@orodu.net>2011-10-16 18:51:51 -0400
commitaa15563feeee03d7748e7d5279decf60db23fda9 (patch)
tree03b1dc8b64c79546fdac408ede2c40f2918f88e9 /openbox
parentfd9bb43059a4e106bfa07babb0eb2f93146e49b2 (diff)
Propagate _NET_WM_WINDOW_OPACITY to the frame window (bug #5132)
Diffstat (limited to 'openbox')
-rw-r--r--openbox/client.c14
-rw-r--r--openbox/client.h2
-rw-r--r--openbox/event.c3
-rw-r--r--openbox/screen.c1
4 files changed, 20 insertions, 0 deletions
diff --git a/openbox/client.c b/openbox/client.c
index e4d85344..c9cd0763 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -256,6 +256,10 @@ void client_manage(Window window, ObPrompt *prompt)
/* the session should get the last say though */
client_restore_session_state(self);
+ /* this needs to occur once we have a frame, since it sets a property on
+ the frame */
+ client_update_opacity(self);
+
/* don't put helper/modal windows on a different desktop if they are
related to the focused window. */
if (!screen_compare_desktops(self->desktop, screen_desktop) &&
@@ -1665,6 +1669,16 @@ void client_update_colormap(ObClient *self, Colormap colormap)
self->colormap = colormap;
}
+void client_update_opacity(ObClient *self)
+{
+ guint32 o;
+
+ if (OBT_PROP_GET32(self->window, NET_WM_WINDOW_OPACITY, CARDINAL, &o))
+ OBT_PROP_SET32(self->frame->window, NET_WM_WINDOW_OPACITY, CARDINAL, o);
+ else
+ OBT_PROP_ERASE(self->frame->window, NET_WM_WINDOW_OPACITY);
+}
+
void client_update_normal_hints(ObClient *self)
{
XSizeHints size;
diff --git a/openbox/client.h b/openbox/client.h
index b36bef5a..d5b344ff 100644
--- a/openbox/client.h
+++ b/openbox/client.h
@@ -616,6 +616,8 @@ void client_update_sync_request_counter(ObClient *self);
#endif
/*! Updates the window's colormap */
void client_update_colormap(ObClient *self, Colormap colormap);
+/*! Updates the requested opacity for the window from the client. */
+void client_update_opacity(ObClient *self);
/*! Updates the WMNormalHints and adjusts things if they change */
void client_update_normal_hints(ObClient *self);
diff --git a/openbox/event.c b/openbox/event.c
index b9ec1c51..cf089b64 100644
--- a/openbox/event.c
+++ b/openbox/event.c
@@ -1681,6 +1681,9 @@ static void event_handle_client(ObClient *client, XEvent *e)
event_last_user_time = t;
}
}
+ else if (msgtype == OBT_PROP_ATOM(NET_WM_WINDOW_OPACITY)) {
+ client_update_opacity(client);
+ }
#ifdef SYNC
else if (msgtype == OBT_PROP_ATOM(NET_WM_SYNC_REQUEST_COUNTER)) {
/* if they are resizing right now this would cause weird behaviour.
diff --git a/openbox/screen.c b/openbox/screen.c
index d368cab6..f7d39fb5 100644
--- a/openbox/screen.c
+++ b/openbox/screen.c
@@ -249,6 +249,7 @@ gboolean screen_annex(void)
supported[i++] = OBT_PROP_ATOM(NET_WM_WINDOW_TYPE_DIALOG);
supported[i++] = OBT_PROP_ATOM(NET_WM_WINDOW_TYPE_NORMAL);
supported[i++] = OBT_PROP_ATOM(NET_WM_ALLOWED_ACTIONS);
+ supported[i++] = OBT_PROP_ATOM(NET_WM_WINDOW_OPACITY);
supported[i++] = OBT_PROP_ATOM(NET_WM_ACTION_MOVE);
supported[i++] = OBT_PROP_ATOM(NET_WM_ACTION_RESIZE);
supported[i++] = OBT_PROP_ATOM(NET_WM_ACTION_MINIMIZE);