-
Notifications
You must be signed in to change notification settings - Fork 30
/
dwm-steam-6.2.diff
72 lines (66 loc) · 2.06 KB
/
dwm-steam-6.2.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From 2487d4bca375401df3713dd5c627a2be7a08e316 Mon Sep 17 00:00:00 2001
From: Bakkeby <[email protected]>
Date: Wed, 26 Jun 2024 23:06:16 +0200
Subject: [PATCH] Steam patch
Steam, and steam windows (games), trigger a ConfigureNotify request every time the window
gets focus. More so, the configure event passed along from Steam tends to have the wrong
x and y co-ordinates which can make the window, if floating, jump around the screen.
This patch works around this age-old issue by ignoring the x and y co-ordinates for
ConfigureNotify requests relating to Steam windows.
---
dwm.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/dwm.c b/dwm.c
index 4465af1..e758060 100644
--- a/dwm.c
+++ b/dwm.c
@@ -93,6 +93,7 @@ struct Client {
int bw, oldbw;
unsigned int tags;
int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
+ int issteam;
Client *next;
Client *snext;
Monitor *mon;
@@ -291,6 +292,9 @@ applyrules(Client *c)
class = ch.res_class ? ch.res_class : broken;
instance = ch.res_name ? ch.res_name : broken;
+ if (strstr(class, "Steam") || strstr(class, "steam_app_"))
+ c->issteam = 1;
+
for (i = 0; i < LENGTH(rules); i++) {
r = &rules[i];
if ((!r->title || strstr(c->name, r->title))
@@ -588,13 +592,15 @@ configurerequest(XEvent *e)
c->bw = ev->border_width;
else if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) {
m = c->mon;
- if (ev->value_mask & CWX) {
- c->oldx = c->x;
- c->x = m->mx + ev->x;
- }
- if (ev->value_mask & CWY) {
- c->oldy = c->y;
- c->y = m->my + ev->y;
+ if (!c->issteam) {
+ if (ev->value_mask & CWX) {
+ c->oldx = c->x;
+ c->x = m->mx + ev->x;
+ }
+ if (ev->value_mask & CWY) {
+ c->oldy = c->y;
+ c->y = m->my + ev->y;
+ }
}
if (ev->value_mask & CWWidth) {
c->oldw = c->w;
@@ -1466,6 +1472,8 @@ setfocus(Client *c)
XA_WINDOW, 32, PropModeReplace,
(unsigned char *) &(c->win), 1);
}
+ if (c->issteam)
+ setclientstate(c, NormalState);
sendevent(c, wmatom[WMTakeFocus]);
}
--
2.45.2