sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 7c843bb627b10b02d9924ee751a8335fb7764676
parent 0fa8abc9bd971823807be2725d33fec6ddc57c4f
Author: bakkeby <bakkeby@gmail.com>
Date:   Fri,  2 Oct 2020 10:35:21 +0200

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

Diffstat:
Adwm.suckless.org/patches/steam/dwm-steam-6.2.diff | 63+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/steam/index.md | 24++++++++++++++++++++++++
2 files changed, 87 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/steam/dwm-steam-6.2.diff 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 <bakkeby@gmail.com> +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 @@ -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 <bakkeby@gmail.com>