summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-09-16 11:00:31 +0200
committerbakkeby <[email protected]>2020-09-16 11:00:31 +0200
commitb8dc848918d7a07412d5fb1be74a9ac44862a028 (patch)
treebe912c1b67e78d75d7177c4173b33246bd62e4a5
parentb3cb874ff558246deff2979f94805192ef3992e9 (diff)
downloaddwm-flexipatch-b8dc848918d7a07412d5fb1be74a9ac44862a028.tar.gz
dwm-flexipatch-b8dc848918d7a07412d5fb1be74a9ac44862a028.zip
Adding fakefullscreen client rule
-rw-r--r--dwm.c34
-rw-r--r--patches.def.h12
2 files changed, 36 insertions, 10 deletions
diff --git a/dwm.c b/dwm.c
index b1cc955..d9776f6 100644
--- a/dwm.c
+++ b/dwm.c
@@ -459,6 +459,9 @@ typedef struct {
int iscentered;
#endif // CENTER_PATCH
int isfloating;
+ #if SELECTIVEFAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH
+ int isfakefullscreen;
+ #endif // SELECTIVEFAKEFULLSCREEN_PATCH
#if ISPERMANENT_PATCH
int ispermanent;
#endif // ISPERMANENT_PATCH
@@ -486,6 +489,11 @@ typedef struct {
#else
#define PERMANENT
#endif // ISPERMANENT_PATCH
+#if SELECTIVEFAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH
+#define FAKEFULLSCREEN , .isfakefullscreen = 1
+#else
+#define FAKEFULLSCREEN
+#endif // SELECTIVEFAKEFULLSCREEN_PATCH
#if SWALLOW_PATCH
#define NOSWALLOW , .noswallow = 1
#define TERMINAL , .isterminal = 1
@@ -771,6 +779,9 @@ applyrules(Client *c)
#if ISPERMANENT_PATCH
c->ispermanent = r->ispermanent;
#endif // ISPERMANENT_PATCH
+ #if SELECTIVEFAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH
+ c->fakefullscreen = r->isfakefullscreen;
+ #endif // SELECTIVEFAKEFULLSCREEN_PATCH
#if SWALLOW_PATCH
c->isterminal = r->isterminal;
c->noswallow = r->noswallow;
@@ -825,6 +836,9 @@ applyrules(Client *c)
}
}
#endif // SWITCHTAG_PATCH
+ #if ONLY_ONE_RULE_MATCH_PATCH
+ break;
+ #endif // ONLY_ONE_RULE_MATCH_PATCH
}
}
if (ch.res_class)
@@ -2552,16 +2566,16 @@ resizeclient(Client *c, int x, int y, int w, int h)
#if NOBORDER_PATCH
if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next))
#if MONOCLE_LAYOUT
- || &monocle == c->mon->lt[c->mon->sellt]->arrange
- #endif // MONOCLE_LAYOUT
- )
- #if FAKEFULLSCREEN_CLIENT_PATCH
- && (c->fakefullscreen == 1 || !c->isfullscreen)
- #else
- && !c->isfullscreen
- #endif // FAKEFULLSCREEN_CLIENT_PATCH
- && !c->isfloating
- && c->mon->lt[c->mon->sellt]->arrange) {
+ || &monocle == c->mon->lt[c->mon->sellt]->arrange
+ #endif // MONOCLE_LAYOUT
+ )
+ #if FAKEFULLSCREEN_CLIENT_PATCH
+ && (c->fakefullscreen == 1 || !c->isfullscreen)
+ #else
+ && !c->isfullscreen
+ #endif // FAKEFULLSCREEN_CLIENT_PATCH
+ && !c->isfloating
+ && c->mon->lt[c->mon->sellt]->arrange) {
c->w = wc.width += c->bw * 2;
c->h = wc.height += c->bw * 2;
wc.border_width = 0;
diff --git a/patches.def.h b/patches.def.h
index dac0450..e387dc0 100644
--- a/patches.def.h
+++ b/patches.def.h
@@ -479,6 +479,8 @@
* the space currently given to them.
* The "twist" with this patch is that fake fullscreen can be toggled on a per client basis
* rather than applying to all clients globally.
+ * Also see the selectivefakefullscreen option that adds a rule option to enabled this on client
+ * startup.
*/
#define FAKEFULLSCREEN_CLIENT_PATCH 0
@@ -652,6 +654,9 @@
*/
#define NO_TRANSPARENT_BORDERS_PATCH 0
+/* Minor patch that prevents more than one rule being matched for a given client. */
+#define ONLY_ONE_RULE_MATCH_PATCH 0
+
/* This patch makes it so dwm will only exit via quit() if no windows are open.
* This is to prevent you accidentally losing all your work.
* https://dwm.suckless.org/patches/onlyquitonempty/
@@ -753,6 +758,13 @@
*/
#define SCRATCHPAD_ALT_1_PATCH 0
+/* As opposed to the original patch this only adds a rule option allowing fake fullscreen
+ * to be enabled for applications when they start. This is intended to be used in combination
+ * with the fakefullscreenclient patch and offers no practical functionality without it.
+ * https://dwm.suckless.org/patches/selectivefakefullscreen/
+ */
+#define SELECTIVEFAKEFULLSCREEN_PATCH 0
+
/* Allows restarting dwm without the dependency of an external script.
* https://dwm.suckless.org/patches/selfrestart/
*/