1 Commits

Author SHA1 Message Date
4e9714417e added fakefullscreenclient 2025-04-10 02:58:19 +02:00
4 changed files with 112 additions and 98 deletions

View File

@@ -12,7 +12,7 @@ static const float bordercolor[] = COLOR(0x444444ff);
static const float focuscolor[] = COLOR(0x005577ff); static const float focuscolor[] = COLOR(0x005577ff);
static const float urgentcolor[] = COLOR(0xff0000ff); static const float urgentcolor[] = COLOR(0xff0000ff);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */ /* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 0.0f}; /* You can also use glsl colors */ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
/* tagging - TAGCOUNT must be no greater than 31 */ /* tagging - TAGCOUNT must be no greater than 31 */
#define TAGCOUNT (9) #define TAGCOUNT (9)
@@ -142,6 +142,7 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_space, setlayout, {0} }, { MODKEY, XKB_KEY_space, setlayout, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} }, { MODKEY, XKB_KEY_e, togglefullscreen, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_E, togglefakefullscreen, {0} },
{ MODKEY, XKB_KEY_0, view, {.ui = ~0} }, { MODKEY, XKB_KEY_0, view, {.ui = ~0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} }, { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },

47
dwl.c
View File

@@ -137,7 +137,7 @@ typedef struct {
#endif #endif
unsigned int bw; unsigned int bw;
uint32_t tags; uint32_t tags;
int isfloating, isurgent, isfullscreen; int isfloating, isurgent, isfullscreen, isfakefullscreen;
uint32_t resize; /* configure serial of a pending resize */ uint32_t resize; /* configure serial of a pending resize */
} Client; } Client;
@@ -322,6 +322,7 @@ static void run(char *startup_cmd);
static void setcursor(struct wl_listener *listener, void *data); static void setcursor(struct wl_listener *listener, void *data);
static void setcursorshape(struct wl_listener *listener, void *data); static void setcursorshape(struct wl_listener *listener, void *data);
static void setfloating(Client *c, int floating); static void setfloating(Client *c, int floating);
static void setfakefullscreen(Client *c, int fullscreen);
static void setfullscreen(Client *c, int fullscreen); static void setfullscreen(Client *c, int fullscreen);
static void setlayout(const Arg *arg); static void setlayout(const Arg *arg);
static void setmfact(const Arg *arg); static void setmfact(const Arg *arg);
@@ -336,6 +337,7 @@ static void tagmon(const Arg *arg);
static void tile(Monitor *m); static void tile(Monitor *m);
static void togglefloating(const Arg *arg); static void togglefloating(const Arg *arg);
static void togglefullscreen(const Arg *arg); static void togglefullscreen(const Arg *arg);
static void togglefakefullscreen(const Arg *arg);
static void toggletag(const Arg *arg); static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg); static void toggleview(const Arg *arg);
static void unlocksession(struct wl_listener *listener, void *data); static void unlocksession(struct wl_listener *listener, void *data);
@@ -505,9 +507,7 @@ applyrules(Client *c)
void void
arrange(Monitor *m) arrange(Monitor *m)
{ {
LayerSurface *l; Client *c;
Client *c, *sel = focustop(m);
int i;
if (!m->wlr_output->enabled) if (!m->wlr_output->enabled)
return; return;
@@ -538,26 +538,6 @@ arrange(Monitor *m)
: c->scene->node.parent); : c->scene->node.parent);
} }
if (sel && sel->isfullscreen && VISIBLEON(sel, m)) {
for (i = 2; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--) {
wl_list_for_each(l, &sel->mon->layers[i], link)
wlr_scene_node_set_enabled(&l->scene->node, 0);
}
wl_list_for_each(c, &clients, link) {
if (c->mon != m)
continue;
wlr_scene_node_set_enabled(&c->scene->node, (sel->isfullscreen && c == sel)
|| !sel->isfullscreen);
}
}
if (!sel || (!sel->isfullscreen && VISIBLEON(sel, m))) {
for (i = 2; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--) {
wl_list_for_each(l, &m->layers[i], link)
wlr_scene_node_set_enabled(&l->scene->node, 1);
}
}
if (m->lt[m->sellt]->arrange) if (m->lt[m->sellt]->arrange)
m->lt[m->sellt]->arrange(m); m->lt[m->sellt]->arrange(m);
motionnotify(0, NULL, 0, 0, 0, 0); motionnotify(0, NULL, 0, 0, 0, 0);
@@ -2213,6 +2193,17 @@ requeststartdrag(struct wl_listener *listener, void *data)
wlr_data_source_destroy(event->drag->source); wlr_data_source_destroy(event->drag->source);
} }
void
setfakefullscreen(Client *c, int fullscreen)
{
c->isfakefullscreen = fullscreen;
if (!c->mon)
return;
if (c->isfullscreen)
setfullscreen(c, 0);
client_set_fullscreen(c, fullscreen);
}
void void
requestmonstate(struct wl_listener *listener, void *data) requestmonstate(struct wl_listener *listener, void *data)
{ {
@@ -2777,6 +2768,14 @@ togglefullscreen(const Arg *arg)
setfullscreen(sel, !sel->isfullscreen); setfullscreen(sel, !sel->isfullscreen);
} }
void
togglefakefullscreen(const Arg *arg)
{
Client *sel = focustop(selmon);
if (sel)
setfakefullscreen(sel, !sel->isfakefullscreen);
}
void void
toggletag(const Arg *arg) toggletag(const Arg *arg)
{ {

View File

@@ -0,0 +1,87 @@
From 2ec6d0c668b4daee601337f8da45ccfa3a7d5fc6 Mon Sep 17 00:00:00 2001
From: choc <notchoc@proton.me>
Date: Fri, 29 Mar 2024 22:50:00 +0800
Subject: [PATCH] implement fakefullscreenclient
---
config.def.h | 1 +
dwl.c | 23 ++++++++++++++++++++++-
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/config.def.h b/config.def.h
index 9009517..8c220eb 100644
--- a/config.def.h
+++ b/config.def.h
@@ -137,6 +137,7 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_space, setlayout, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_E, togglefakefullscreen, {0} },
{ MODKEY, XKB_KEY_0, view, {.ui = ~0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
diff --git a/dwl.c b/dwl.c
index 5867b0c..1e78491 100644
--- a/dwl.c
+++ b/dwl.c
@@ -137,7 +137,7 @@ typedef struct {
#endif
unsigned int bw;
uint32_t tags;
- int isfloating, isurgent, isfullscreen;
+ int isfloating, isurgent, isfullscreen, isfakefullscreen;
uint32_t resize; /* configure serial of a pending resize */
} Client;
@@ -318,6 +318,7 @@ static void setcursor(struct wl_listener *listener, void *data);
static void setcursorshape(struct wl_listener *listener, void *data);
static void setfloating(Client *c, int floating);
static void setfullscreen(Client *c, int fullscreen);
+static void setfakefullscreen(Client *c, int fullscreen);
static void setgamma(struct wl_listener *listener, void *data);
static void setlayout(const Arg *arg);
static void setmfact(const Arg *arg);
@@ -332,6 +333,7 @@ static void tagmon(const Arg *arg);
static void tile(Monitor *m);
static void togglefloating(const Arg *arg);
static void togglefullscreen(const Arg *arg);
+static void togglefakefullscreen(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
static void unlocksession(struct wl_listener *listener, void *data);
@@ -2181,6 +2183,17 @@ setfullscreen(Client *c, int fullscreen)
printstatus();
}
+void
+setfakefullscreen(Client *c, int fullscreen)
+{
+ c->isfakefullscreen = fullscreen;
+ if (!c->mon)
+ return;
+ if (c->isfullscreen)
+ setfullscreen(c, 0);
+ client_set_fullscreen(c, fullscreen);
+}
+
void
setgamma(struct wl_listener *listener, void *data)
{
@@ -2620,6 +2633,14 @@ togglefullscreen(const Arg *arg)
setfullscreen(sel, !sel->isfullscreen);
}
+void
+togglefakefullscreen(const Arg *arg)
+{
+ Client *sel = focustop(selmon);
+ if (sel)
+ setfakefullscreen(sel, !sel->isfakefullscreen);
+}
+
void
toggletag(const Arg *arg)
{
--
2.44.0

View File

@@ -1,73 +0,0 @@
From ac1537f068ea626f1984803ed8db08faf7943b18 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
<leohdz172@proton.me>
Date: Sun, 10 Apr 2022 22:38:53 -0500
Subject: [PATCH] hide-behind-fullscreen
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
---
config.def.h | 2 +-
dwl.c | 24 +++++++++++++++++++++++-
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/config.def.h b/config.def.h
index 22d2171d..1d5a4c84 100644
--- a/config.def.h
+++ b/config.def.h
@@ -12,7 +12,7 @@ static const float bordercolor[] = COLOR(0x444444ff);
static const float focuscolor[] = COLOR(0x005577ff);
static const float urgentcolor[] = COLOR(0xff0000ff);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
-static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
+static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 0.0f}; /* You can also use glsl colors */
/* tagging - TAGCOUNT must be no greater than 31 */
#define TAGCOUNT (9)
diff --git a/dwl.c b/dwl.c
index ad21e1ba..f5395fe6 100644
--- a/dwl.c
+++ b/dwl.c
@@ -505,7 +505,9 @@ applyrules(Client *c)
void
arrange(Monitor *m)
{
- Client *c;
+ LayerSurface *l;
+ Client *c, *sel = focustop(m);
+ int i;
if (!m->wlr_output->enabled)
return;
@@ -536,6 +538,26 @@ arrange(Monitor *m)
: c->scene->node.parent);
}
+ if (sel && sel->isfullscreen && VISIBLEON(sel, m)) {
+ for (i = 2; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--) {
+ wl_list_for_each(l, &sel->mon->layers[i], link)
+ wlr_scene_node_set_enabled(&l->scene->node, 0);
+ }
+
+ wl_list_for_each(c, &clients, link) {
+ if (c->mon != m)
+ continue;
+ wlr_scene_node_set_enabled(&c->scene->node, (sel->isfullscreen && c == sel)
+ || !sel->isfullscreen);
+ }
+ }
+ if (!sel || (!sel->isfullscreen && VISIBLEON(sel, m))) {
+ for (i = 2; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--) {
+ wl_list_for_each(l, &m->layers[i], link)
+ wlr_scene_node_set_enabled(&l->scene->node, 1);
+ }
+ }
+
if (m->lt[m->sellt]->arrange)
m->lt[m->sellt]->arrange(m);
motionnotify(0, NULL, 0, 0, 0, 0);
--
2.48.0