X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fopenbox;a=blobdiff_plain;f=openbox%2Fclient.c;h=1478d840f832265471d208fac1fead0b3199ec64;hp=b6cc4a879300fa824f0d6c8be694829e023a8bc4;hb=9325c92056ff4268db2263cdf8c07bb529e158aa;hpb=782b2864b1cc5ffab426dfb784a973576a98de18 diff --git a/openbox/client.c b/openbox/client.c index b6cc4a87..1478d840 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -985,6 +985,9 @@ static ObAppSettings *client_get_settings_state(ObClient *self) self->desktop = settings->desktop - 1; } + if (settings->opacity != -1) + self->opacity = settings->opacity; + if (settings->layer == -1) { self->below = TRUE; self->above = FALSE; @@ -1043,6 +1046,8 @@ static void client_restore_session_state(ObClient *self) self->max_horz = self->session->max_horz; self->max_vert = self->session->max_vert; self->undecorated = self->session->undecorated; + + self->opacity = self->session->opacity; } static gboolean client_restore_session_stacking(ObClient *self) @@ -2842,6 +2847,7 @@ static void client_apply_startup_state(ObClient *self, gboolean demands_attention = self->demands_attention; gboolean max_horz = self->max_horz; gboolean max_vert = self->max_vert; + guint8 opacity = self->opacity; Rect oldarea; gint l; @@ -2891,6 +2897,9 @@ static void client_apply_startup_state(ObClient *self, /* make sure client_setup_decor_and_functions() is called at least once */ client_setup_decor_and_functions(self, FALSE); + /* make the client semi-transparent */ + client_set_opacity(self, opacity); + /* if the window hasn't been configured yet, then do so now, in fact the x,y,w,h may _not_ be the same as the area rect, which can end up meaning that the client isn't properly moved/resized by the fullscreen @@ -3779,6 +3788,12 @@ void client_set_desktop(ObClient *self, guint target, focus_cycle_addremove(NULL, TRUE); } +void client_set_opacity(ObClient *self, guint8 opacity) +{ + OBT_PROP_SET32(self->window, NET_WM_WINDOW_OPACITY, CARDINAL, + opacity * 16777216); +} + gboolean client_is_direct_child(ObClient *parent, ObClient *child) { while (child != parent && (child = client_direct_parent(child)));