mirror of
https://github.com/tiyn/dwl.git
synced 2026-01-11 17:39:45 +01:00
Compare commits
1 Commits
attachtop
...
fakefullsc
| Author | SHA1 | Date | |
|---|---|---|---|
| 4e9714417e |
@@ -1,36 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
@@ -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} },
|
||||||
|
|||||||
36
dwl.c
36
dwl.c
@@ -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);
|
||||||
@@ -1775,18 +1777,7 @@ mapnotify(struct wl_listener *listener, void *data)
|
|||||||
c->geom.height += 2 * c->bw;
|
c->geom.height += 2 * c->bw;
|
||||||
|
|
||||||
/* Insert this client into client lists. */
|
/* Insert this client into client lists. */
|
||||||
i = 0;
|
wl_list_insert(&clients, &c->link);
|
||||||
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);
|
wl_list_insert(&fstack, &c->flink);
|
||||||
|
|
||||||
/* Set initial monitor, tags, floating status, and focus:
|
/* Set initial monitor, tags, floating status, and focus:
|
||||||
@@ -2202,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)
|
||||||
{
|
{
|
||||||
@@ -2766,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)
|
||||||
{
|
{
|
||||||
|
|||||||
87
fakefullscreenclient.patch
Normal file
87
fakefullscreenclient.patch
Normal 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
|
||||||
|
|
||||||
Reference in New Issue
Block a user