]> Dogcows Code - chaz/openbox/commitdiff
Propagate _NET_WM_WINDOW_OPACITY to the frame window (bug #5132)
authorDana Jansens <danakj@orodu.net>
Fri, 14 Oct 2011 21:39:24 +0000 (17:39 -0400)
committerDana Jansens <danakj@orodu.net>
Sun, 16 Oct 2011 22:51:51 +0000 (18:51 -0400)
obt/prop.c
obt/prop.h
openbox/client.c
openbox/client.h
openbox/event.c
openbox/screen.c

index d5af6a0bfafe17eee6c9d7fde355bce1bd5f3688..638373fdfd531173a7868e49348ce8ef1d0bdce9 100644 (file)
@@ -107,6 +107,7 @@ void obt_prop_startup(void)
     CREATE_(NET_WM_ICON_GEOMETRY);
     CREATE_(NET_WM_PID);
     CREATE_(NET_WM_ALLOWED_ACTIONS);
+    CREATE_(NET_WM_WINDOW_OPACITY);
     CREATE_(NET_WM_USER_TIME);
 /*  CREATE_(NET_WM_USER_TIME_WINDOW); */
     CREATE_(KDE_NET_WM_FRAME_STRUT);
index 9c4ace3361ce53f91f9fbe940a6cff505c118b10..b30232e9d8282d455e1ae78ae3d18d6614eebd18 100644 (file)
@@ -148,6 +148,7 @@ typedef enum {
     OBT_PROP_NET_WM_ICON_GEOMETRY,
     OBT_PROP_NET_WM_PID,
     OBT_PROP_NET_WM_ALLOWED_ACTIONS,
+    OBT_PROP_NET_WM_WINDOW_OPACITY,
     OBT_PROP_NET_WM_USER_TIME,
 /*  OBT_PROP_NET_WM_USER_TIME_WINDOW, */
     OBT_PROP_NET_FRAME_EXTENTS,
index e4d853441bfbb54f4fb76b9c77be8b3b9bc9a88b..c9cd076334c3076d25149d2cb5ea70c1362b2acd 100644 (file)
@@ -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;
index b36bef5aa306497674ed91f89bd95ec6f58497db..d5b344ff5dfce01f5311553220b920d604013dbb 100644 (file)
@@ -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);
 
index b9ec1c51bc04eb68447db04546d3d4859832b184..cf089b64e3c5212ee3ff70baac9e904f3b82e3f9 100644 (file)
@@ -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.
index d368cab68ca8a5d76adeca13ce874486076d6b51..f7d39fb59990b2d768899131271a6bc03e9d12de 100644 (file)
@@ -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);
This page took 0.030015 seconds and 4 git commands to generate.