all repos — openbox @ aa15563feeee03d7748e7d5279decf60db23fda9

openbox fork - make it a bit more like ryudo

Propagate _NET_WM_WINDOW_OPACITY to the frame window (bug #5132)
Dana Jansens danakj@orodu.net
commit

aa15563feeee03d7748e7d5279decf60db23fda9

parent

fd9bb43059a4e106bfa07babb0eb2f93146e49b2

6 files changed, 22 insertions(+), 0 deletions(-)

jump to
M obt/prop.cobt/prop.c

@@ -107,6 +107,7 @@ CREATE_(NET_WM_ICON);

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);
M obt/prop.hobt/prop.h

@@ -148,6 +148,7 @@ OBT_PROP_NET_WM_ICON,

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,
M openbox/client.copenbox/client.c

@@ -256,6 +256,10 @@

/* 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) &&

@@ -1663,6 +1667,16 @@ self->colormap = colormap;

screen_install_colormap(self, TRUE); /* install new one */ } else 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)
M openbox/client.hopenbox/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);
M openbox/event.copenbox/event.c

@@ -1681,6 +1681,9 @@ {

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.
M openbox/screen.copenbox/screen.c

@@ -249,6 +249,7 @@ supported[i++] = OBT_PROP_ATOM(NET_WM_WINDOW_TYPE_SPLASH);

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);