mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-09-08 12:14:50 +00:00
rebase skipfocus to main
This commit is contained in:
parent
8d9d0bdb94
commit
ee1c40584a
@ -1,37 +1,27 @@
|
||||
From 2825a2e8b0dae5d7146ba9bb66e2a3b7265617d5 Mon Sep 17 00:00:00 2001
|
||||
From: Dhruva Sambrani <44899822+DhruvaSambrani@users.noreply.github.com>
|
||||
Date: Mon, 8 Jan 2024 14:54:39 +0100
|
||||
Subject: [PATCH 1/2] first skipfocus commit
|
||||
|
||||
---
|
||||
config.def.h | 6 +++---
|
||||
dwl.c | 9 ++++++++-
|
||||
2 files changed, 11 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index a8ed61d..fc105de 100644
|
||||
index a784eb4..5d3a4f9 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -21,11 +21,11 @@ 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 const Rule rules[] = {
|
||||
- /* app_id title tags mask isfloating monitor */
|
||||
+ /* app_id title tags mask isfloating skipfocus monitor */
|
||||
/* examples:
|
||||
- { "Gimp", NULL, 0, 1, -1 },
|
||||
+ { "Gimp", NULL, 0, 1, 0, -1 },
|
||||
*/
|
||||
- { "firefox", NULL, 1 << 8, 0, -1 },
|
||||
+ { "firefox", NULL, 1 << 8, 0, 0, -1 },
|
||||
- /* app_id title tags mask isfloating monitor */
|
||||
+ /* app_id title tags mask isfloating skipfocus monitor */
|
||||
/* examples: */
|
||||
- { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
|
||||
- { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */
|
||||
+ { "Gimp_EXAMPLE", NULL, 0, 1, 0, -1 }, /* Start on currently visible tags floating, not tiled */
|
||||
+ { "firefox_EXAMPLE", NULL, 1 << 8, 0, 0, -1 }, /* Start on ONLY tag "9" */
|
||||
+ { "mako_EXAMPLE", NULL, 0, 1, 1, -1 }, /* Start floating and skip focus
|
||||
};
|
||||
|
||||
/* layout(s) */
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index 632dabf..a8c87e5 100644
|
||||
index 6f041a0..90ac57b 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -132,7 +132,7 @@ typedef struct {
|
||||
@@ -137,7 +137,7 @@ typedef struct {
|
||||
#endif
|
||||
unsigned int bw;
|
||||
uint32_t tags;
|
||||
@ -40,7 +30,7 @@ index 632dabf..a8c87e5 100644
|
||||
uint32_t resize; /* configure serial of a pending resize */
|
||||
} Client;
|
||||
|
||||
@@ -217,6 +217,7 @@ typedef struct {
|
||||
@@ -228,6 +228,7 @@ typedef struct {
|
||||
const char *title;
|
||||
uint32_t tags;
|
||||
int isfloating;
|
||||
@ -48,7 +38,7 @@ index 632dabf..a8c87e5 100644
|
||||
int monitor;
|
||||
} Rule;
|
||||
|
||||
@@ -440,6 +441,7 @@ applyrules(Client *c)
|
||||
@@ -464,6 +465,7 @@ applyrules(Client *c)
|
||||
if ((!r->title || strstr(title, r->title))
|
||||
&& (!r->id || strstr(appid, r->id))) {
|
||||
c->isfloating = r->isfloating;
|
||||
@ -56,48 +46,17 @@ index 632dabf..a8c87e5 100644
|
||||
newtags |= r->tags;
|
||||
i = 0;
|
||||
wl_list_for_each(m, &mons, link) {
|
||||
@@ -1167,6 +1169,11 @@ focusclient(Client *c, int lift)
|
||||
@@ -1307,6 +1309,13 @@ focusclient(Client *c, int lift)
|
||||
if (locked)
|
||||
return;
|
||||
|
||||
+ if (c && c->skipfocus){
|
||||
+ c -> skipfocus = 0;
|
||||
+ if (c && c->skipfocus != 0){
|
||||
+ if (c -> skipfocus == 1) {
|
||||
+ c->skipfocus = 0;
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
/* Raise client in stacking order if requested */
|
||||
if (c && lift)
|
||||
wlr_scene_node_raise_to_top(&c->scene->node);
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
||||
From d8b2e6141cdf41e854c9017fca66b32e691b7c5b Mon Sep 17 00:00:00 2001
|
||||
From: Dhruva Sambrani <44899822+DhruvaSambrani@users.noreply.github.com>
|
||||
Date: Mon, 8 Jan 2024 15:38:08 +0100
|
||||
Subject: [PATCH 2/2] add permanent skipfocus
|
||||
|
||||
---
|
||||
dwl.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index a8c87e5..54a7ed3 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -1169,8 +1169,10 @@ focusclient(Client *c, int lift)
|
||||
if (locked)
|
||||
return;
|
||||
|
||||
- if (c && c->skipfocus){
|
||||
- c -> skipfocus = 0;
|
||||
+ if (c && c->skipfocus != 0){
|
||||
+ if (c -> skipfocus == 1) {
|
||||
+ c->skipfocus = 0;
|
||||
+ }
|
||||
return;
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user