commit 7c843bb627b10b02d9924ee751a8335fb7764676
Author: bakkeby <[email protected]>
Date:   Fri Oct 2 10:35:21 2020 +0200

    [dwm][patch][steam] Adding patch to force the steam client to behave when 
floating

diff --git a/dwm.suckless.org/patches/steam/dwm-steam-6.2.diff 
b/dwm.suckless.org/patches/steam/dwm-steam-6.2.diff
new file mode 100644
index 00000000..6b92c2aa
--- /dev/null
+++ b/dwm.suckless.org/patches/steam/dwm-steam-6.2.diff
@@ -0,0 +1,63 @@
+From 2550931c66e10e667ce56a6761cbadd12b331c52 Mon Sep 17 00:00:00 2001
+From: bakkeby <[email protected]>
+Date: Mon, 10 Aug 2020 16:45:00 +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 coordinates 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 | 20 +++++++++++++-------
+ 1 file changed, 13 insertions(+), 7 deletions(-)
+
+diff --git a/dwm.c b/dwm.c
+index 4465af1..598d36d 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;
+--
+2.19.1
+
diff --git a/dwm.suckless.org/patches/steam/index.md 
b/dwm.suckless.org/patches/steam/index.md
new file mode 100644
index 00000000..644089a6
--- /dev/null
+++ b/dwm.suckless.org/patches/steam/index.md
@@ -0,0 +1,24 @@
+steam
+=====
+
+Description
+-----------
+The Steam client, and steam windows (games), tends to trigger a 
ConfigureNotify request every time
+the window gets focus. More so, the configure events passed along from Steam 
may have the wrong x
+and y coordinates which can make the window, if floating, jump around the 
screen. Another observed
+symptom is the steam window continuously sliding towards the bottom right 
corner of 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.
+
+It should be noted that this is a simple and crude patch, and while it can be 
made more generic
+I have intentionally left it hardcoded against steam in particular as few 
other windows behaves
+this badly.
+
+Download
+--------
+* [dwm-steam-6.2.diff](dwm-steam-6.2.diff)
+
+Author
+------
+* Stein Bakkeby <[email protected]>


Reply via email to