summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorProsperousPotato <ProsperousPotato@users.noreply.github.com>2025-03-30 20:02:05 +0100
committerProsperousPotato <ProsperousPotato@users.noreply.github.com>2025-03-31 18:31:28 +0100
commitc72f4fcd509428f3115921ff111cfedadf301df2 (patch)
treefff708790f87b49cc8f3b8ab5b538bbb0d924c02
parent276e6c9cb23e82825da678d60e80ab178ce71657 (diff)
Fix black screen on steam games when switching tags
-rw-r--r--dwm.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/dwm.c b/dwm.c
index f58d146..266104c 100644
--- a/dwm.c
+++ b/dwm.c
@@ -99,6 +99,7 @@ struct Client {
int bw, oldbw;
unsigned int tags;
int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen, isterminal, noswallow;
+ int issteam;
pid_t pid;
Client *next;
Client *snext;
@@ -323,6 +324,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))
@@ -672,13 +676,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;
@@ -1718,6 +1724,8 @@ setfocus(Client *c)
XA_WINDOW, 32, PropModeReplace,
(unsigned char *) &(c->win), 1);
}
+ if (c->issteam)
+ setclientstate(c, NormalState);
sendevent(c, wmatom[WMTakeFocus]);
}