1 Commits

Author SHA1 Message Date
7faae9dfcf added attachtop 2025-04-10 03:05:36 +02:00
4 changed files with 50 additions and 98 deletions

36
attachtop.patch Normal file
View File

@@ -0,0 +1,36 @@
From 42a66d6e06c38e913766ce625f049fdbc3dd0d12 Mon Sep 17 00:00:00 2001
From: Nikita Ivanov <nikita.vyach.ivanov@gmail.com>
Date: Sun, 7 Apr 2024 21:10:17 +0200
Subject: [PATCH] New client are attached on top of the stack
---
dwl.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/dwl.c b/dwl.c
index bf763df..c0a3d74 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1605,7 +1605,18 @@ mapnotify(struct wl_listener *listener, void *data)
c->geom.height += 2 * c->bw;
/* Insert this client into client lists. */
- wl_list_insert(&clients, &c->link);
+ i = 0;
+ wl_list_for_each(w, &clients, link) {
+ if (!VISIBLEON(w, selmon) || c->isfloating)
+ continue;
+ p = w;
+ if (++i >= selmon->nmaster)
+ break;
+ }
+ if (i > 0)
+ wl_list_insert(&p->link, &c->link);
+ else
+ wl_list_insert(&clients, &c->link);
wl_list_insert(&fstack, &c->flink);
/* Set initial monitor, tags, floating status, and focus:
--
2.44.0

View File

@@ -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, 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 */
#define TAGCOUNT (9)

37
dwl.c
View File

@@ -505,9 +505,7 @@ applyrules(Client *c)
void
arrange(Monitor *m)
{
LayerSurface *l;
Client *c, *sel = focustop(m);
int i;
Client *c;
if (!m->wlr_output->enabled)
return;
@@ -538,26 +536,6 @@ 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);
@@ -1797,7 +1775,18 @@ mapnotify(struct wl_listener *listener, void *data)
c->geom.height += 2 * c->bw;
/* Insert this client into client lists. */
wl_list_insert(&clients, &c->link);
i = 0;
wl_list_for_each(w, &clients, link) {
if (!VISIBLEON(w, selmon) || c->isfloating)
continue;
p = w;
if (++i >= selmon->nmaster)
break;
}
if (i > 0)
wl_list_insert(&p->link, &c->link);
else
wl_list_insert(&clients, &c->link);
wl_list_insert(&fstack, &c->flink);
/* Set initial monitor, tags, floating status, and focus:

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