<maximized>true</maximized>
# 'Horizontal', 'Vertical' or boolean (yes/no)
+
+ <opacity>255</opacity>
+ # make the window semi-transparent
+ # value between 0 and 255, inclusive; 0 invisible, 255 fully opaque
</application>
# end of the example
<xsd:element minOccurs="0" name="skip_taskbar" type="ob:bool"/>
<xsd:element minOccurs="0" name="fullscreen" type="ob:bool"/>
<xsd:element minOccurs="0" name="maximized" type="ob:maximization"/>
+ <xsd:element minOccurs="0" name="opacity" type="xsd:unsignedByte"/>
</xsd:all>
<!-- at least one of these must be present -->
<xsd:attribute name="role" type="xsd:string"/>
self->desktop = settings->desktop - 1;
}
+ if (settings->opacity != -1)
+ self->opacity = settings->opacity;
+
if (settings->layer == -1) {
self->below = TRUE;
self->above = FALSE;
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)
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;
/* 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
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)));
gboolean max_vert;
/*! The window is maximized to fill the screen horizontally */
gboolean max_horz;
+ /*! The window is semi-transparent */
+ guint8 opacity;
/*! The window should not be displayed by pagers */
gboolean skip_pager;
/*! The window should not be displayed by taskbars */
void client_set_desktop(ObClient *self, guint target, gboolean donthide,
gboolean dontraise);
+/*! Adjust the client opacity */
+void client_set_opacity(ObClient *self, guint8 opacity);
+
/*! Show the client if it should be shown. Returns if the window is shown. */
gboolean client_show(ObClient *self);
settings->fullscreen = -1;
settings->max_horz = -1;
settings->max_vert = -1;
+ settings->opacity = -1;
return settings;
}
copy_if(fullscreen, -1);
copy_if(max_horz, -1);
copy_if(max_vert, -1);
+ copy_if(opacity, -1);
if (src->pos_given) {
dst->pos_given = TRUE;
g_free(s);
}
+ if ((n = obt_xml_find_node(app->children, "opacity")))
+ if (!obt_xml_node_contains(n, "default"))
+ settings->opacity = obt_xml_node_int(n);
+
config_per_app_settings = g_slist_append(config_per_app_settings,
(gpointer) settings);
g_free(name);
gint max_horz;
gint max_vert;
gint fullscreen;
-
gint layer;
+
+ guint8 opacity;
};
/*! Should new windows be focused */
fprintf(f, "\t<y>%d</y>\n", prey);
fprintf(f, "\t<width>%d</width>\n", prew);
fprintf(f, "\t<height>%d</height>\n", preh);
+ fprintf(f, "\t<opacity>%d</opacity>\n", c->opacity);
if (c->shaded)
fprintf(f, "\t<shaded />\n");
if (c->iconic)
if (!(n = obt_xml_find_node(node->children, "height")))
goto session_load_bail;
state->h = obt_xml_node_int(n);
+ if (!(n = obt_xml_find_node(node->children, "opacity")))
+ goto session_load_bail;
+ state->opacity = obt_xml_node_int(n);
state->shaded =
obt_xml_find_node(node->children, "shaded") != NULL;
gboolean shaded, iconic, skip_pager, skip_taskbar, fullscreen;
gboolean above, below, max_horz, max_vert, undecorated;
gboolean focused;
+ guint8 opacity;
gboolean matched;
};