aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-07-23 02:08:10 -0500
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-07-23 02:17:00 -0500
commit8cdb9971264adfdc35777b5a9935c2e4c47eea9f (patch)
tree36b2056e4877852f3647fd2e26c3a89a162feff7 /dwl.c
parent90a12c90a0aa0ac16327b0816de4d9dff69b357e (diff)
conform the xdg-protocol with fullscreen translucent clients
see `setfullscreen()` for more info
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/dwl.c b/dwl.c
index 727e6e1..35c72f0 100644
--- a/dwl.c
+++ b/dwl.c
@@ -98,6 +98,7 @@ typedef struct {
struct wlr_scene_node *scene;
struct wlr_scene_rect *border[4]; /* top, bottom, left, right */
struct wlr_scene_node *scene_surface;
+ struct wlr_scene_rect *fullscreen_bg; /* See setfullscreen() for info */
struct wl_list link;
struct wl_list flink;
union {
@@ -1869,10 +1870,23 @@ setfullscreen(Client *c, int fullscreen)
if (fullscreen) {
c->prev = c->geom;
resize(c, c->mon->m, 0);
+ /* The xdg-protocol specifies:
+ *
+ * If the fullscreened surface is not opaque, the compositor must make
+ * sure that other screen content not part of the same surface tree (made
+ * up of subsurfaces, popups or similarly coupled surfaces) are not
+ * visible below the fullscreened surface.
+ *
+ * For brevity we set a black background for all clients
+ */
+ c->fullscreen_bg = wlr_scene_rect_create(c->scene,
+ c->geom.width, c->geom.height, fullscreen_bg);
+ wlr_scene_node_lower_to_bottom(&c->fullscreen_bg->node);
} else {
/* restore previous size instead of arrange for floating windows since
* client positions are set by the user and cannot be recalculated */
resize(c, c->prev, 0);
+ wlr_scene_node_destroy(&c->fullscreen_bg->node);
}
arrange(c->mon);
printstatus();