swallow: update config.def.h

This commit is contained in:
choc 2024-04-03 11:31:20 +08:00
parent ebba19380c
commit 3c9a8e3232

View File

@ -1,4 +1,4 @@
From 7c4b174821ab994c0f1a97cba5918f905004f72c Mon Sep 17 00:00:00 2001 From edc5d6b72297ced74441bf3c8a267dc2eb6fc01c Mon Sep 17 00:00:00 2001
From: choc <notchoc@proton.me> From: choc <notchoc@proton.me>
Date: Fri, 15 Sep 2023 10:36:21 +0800 Date: Fri, 15 Sep 2023 10:36:21 +0800
Subject: [PATCH] swallow patch with x support Subject: [PATCH] swallow patch with x support
@ -8,11 +8,11 @@ fixed to work after commit 985417b
client.h | 12 ++++++ client.h | 12 ++++++
config.def.h | 7 ++-- config.def.h | 7 ++--
config.mk | 4 +- config.mk | 4 +-
dwl.c | 112 ++++++++++++++++++++++++++++++++++++++++++++++++--- dwl.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++++---
4 files changed, 125 insertions(+), 10 deletions(-) 4 files changed, 126 insertions(+), 10 deletions(-)
diff --git a/client.h b/client.h diff --git a/client.h b/client.h
index 1dae434..51bef68 100644 index 800b867..b4c4596 100644
--- a/client.h --- a/client.h
+++ b/client.h +++ b/client.h
@@ -131,6 +131,18 @@ client_get_appid(Client *c) @@ -131,6 +131,18 @@ client_get_appid(Client *c)
@ -35,22 +35,21 @@ index 1dae434..51bef68 100644
client_get_clip(Client *c, struct wlr_box *clip) client_get_clip(Client *c, struct wlr_box *clip)
{ {
diff --git a/config.def.h b/config.def.h diff --git a/config.def.h b/config.def.h
index a8ed61d..ca2b925 100644 index 8847e58..37dcf14 100644
--- a/config.def.h --- a/config.def.h
+++ b/config.def.h +++ b/config.def.h
@@ -21,11 +21,12 @@ static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; /* You can al @@ -21,10 +21,11 @@ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You ca
static int log_level = WLR_ERROR; static int log_level = WLR_ERROR;
static const Rule rules[] = { static const Rule rules[] = {
- /* app_id title tags mask isfloating monitor */ - /* app_id title tags mask isfloating monitor */
+ /* app_id title tags mask isfloating isterm noswallow monitor */ + /* app_id title tags mask isfloating isterm noswallow monitor */
/* examples: /* examples: */
- { "Gimp", NULL, 0, 1, -1 }, - { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
+ { "Gimp", NULL, 0, 1, 0, 1, -1 }, - { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */
*/ + { "Gimp", NULL, 0, 1, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
- { "firefox", NULL, 1 << 8, 0, -1 }, + { "firefox", NULL, 1 << 8, 0, 0, 1, -1 }, /* Start on ONLY tag "9" */
+ { "firefox", NULL, 1 << 8, 0, 0, 1, -1 }, + { "foot", NULL, 0, 0, 1, 1, -1 }, /* make foot swallow clients that are not foot */
+ { "foot", NULL, 0, 0, 1, 1, -1 },
}; };
/* layout(s) */ /* layout(s) */
@ -67,10 +66,10 @@ index 906f403..f7fa488 100644
+XWAYLAND = -DXWAYLAND +XWAYLAND = -DXWAYLAND
+XLIBS = xcb xcb-icccm +XLIBS = xcb xcb-icccm
diff --git a/dwl.c b/dwl.c diff --git a/dwl.c b/dwl.c
index 10d5a5b..510ccf7 100644 index 39ce68c..dd19db2 100644
--- a/dwl.c --- a/dwl.c
+++ b/dwl.c +++ b/dwl.c
@@ -97,7 +97,8 @@ typedef struct { @@ -102,7 +102,8 @@ typedef struct {
} Button; } Button;
typedef struct Monitor Monitor; typedef struct Monitor Monitor;
@ -80,7 +79,7 @@ index 10d5a5b..510ccf7 100644
/* Must keep these three elements in this order */ /* Must keep these three elements in this order */
unsigned int type; /* XDGShell or X11* */ unsigned int type; /* XDGShell or X11* */
struct wlr_box geom; /* layout-relative, includes border */ struct wlr_box geom; /* layout-relative, includes border */
@@ -132,9 +133,11 @@ typedef struct { @@ -137,9 +138,11 @@ typedef struct {
#endif #endif
unsigned int bw; unsigned int bw;
uint32_t tags; uint32_t tags;
@ -94,7 +93,7 @@ index 10d5a5b..510ccf7 100644
typedef struct { typedef struct {
uint32_t mod; uint32_t mod;
@@ -217,6 +220,8 @@ typedef struct { @@ -227,6 +230,8 @@ typedef struct {
const char *title; const char *title;
uint32_t tags; uint32_t tags;
int isfloating; int isfloating;
@ -103,7 +102,7 @@ index 10d5a5b..510ccf7 100644
int monitor; int monitor;
} Rule; } Rule;
@@ -331,6 +336,10 @@ static Monitor *xytomon(double x, double y); @@ -347,6 +352,10 @@ static Monitor *xytomon(double x, double y);
static void xytonode(double x, double y, struct wlr_surface **psurface, static void xytonode(double x, double y, struct wlr_surface **psurface,
Client **pc, LayerSurface **pl, double *nx, double *ny); Client **pc, LayerSurface **pl, double *nx, double *ny);
static void zoom(const Arg *arg); static void zoom(const Arg *arg);
@ -114,7 +113,7 @@ index 10d5a5b..510ccf7 100644
/* variables */ /* variables */
static const char broken[] = "broken"; static const char broken[] = "broken";
@@ -436,10 +445,14 @@ applyrules(Client *c) @@ -458,10 +467,14 @@ applyrules(Client *c)
if (!(title = client_get_title(c))) if (!(title = client_get_title(c)))
title = broken; title = broken;
@ -129,10 +128,11 @@ index 10d5a5b..510ccf7 100644
newtags |= r->tags; newtags |= r->tags;
i = 0; i = 0;
wl_list_for_each(m, &mons, link) { wl_list_for_each(m, &mons, link) {
@@ -449,6 +462,20 @@ applyrules(Client *c) @@ -470,6 +483,21 @@ applyrules(Client *c)
} }
} }
wlr_scene_node_reparent(&c->scene->node, layers[c->isfloating ? LyrFloat : LyrTile]); }
+ wlr_scene_node_reparent(&c->scene->node, layers[c->isfloating ? LyrFloat : LyrTile]);
+ if (!c->noswallow && !client_is_float_type(c)) { + if (!c->noswallow && !client_is_float_type(c)) {
+ Client *p = termforwin(c); + Client *p = termforwin(c);
+ if (p) { + if (p) {
@ -150,7 +150,7 @@ index 10d5a5b..510ccf7 100644
setmon(c, mon, newtags); setmon(c, mon, newtags);
} }
@@ -1311,6 +1338,63 @@ handlesig(int signo) @@ -1388,6 +1416,63 @@ handlesig(int signo)
} }
} }
@ -214,7 +214,7 @@ index 10d5a5b..510ccf7 100644
void void
incnmaster(const Arg *arg) incnmaster(const Arg *arg)
{ {
@@ -2559,15 +2643,33 @@ unmapnotify(struct wl_listener *listener, void *data) @@ -2680,15 +2765,33 @@ unmapnotify(struct wl_listener *listener, void *data)
grabc = NULL; grabc = NULL;
} }
@ -251,5 +251,5 @@ index 10d5a5b..510ccf7 100644
wlr_scene_node_destroy(&c->scene->node); wlr_scene_node_destroy(&c->scene->node);
-- --
2.43.0 2.44.0