Compare commits

...

6 Commits

Author SHA1 Message Date
Sravan Balaji
d8b91c7e8b Add window rule for heroic games launcher 2024-08-13 18:24:06 -04:00
Sravan Balaji
d0f7c11925 Merge remote-tracking branch 'upstream/master' 2024-08-06 15:29:09 -04:00
bakkeby
36cbcf53a2 IPC: do not bail on events from unknown file descriptors ref. #433
The natural cycle for dwm-msg is that:
   - the client registers
   - the client sends a message
   - a response is sent back
   - the client deregisters

There is a race condition such that a new client may end up with the same
file descriptor as another command that is deregistering, resulting in a
message to come through from a file descriptor that is not registered.

The handling of this situation is that the IPC patch will log:

   Got event from unknown fd 7, ptr 0x7, u32 7, u64 7 with events 17

before gracefully stopping (exiting) dwm.

The consequence of the error itself seems benign and the proposal here is
to allow dwm to keep running despite not being able to process the dwm-msg
command successfully.
2024-08-01 14:56:48 +02:00
Sravan Balaji
bbfe23ff81 Merge remote-tracking branch 'upstream/master' 2024-07-14 09:14:30 -04:00
bakkeby
f4258747be Swallow + noborder compatibility changes ref. #430 2024-07-14 14:27:11 +02:00
bakkeby
3bc91e187c Removing debug print statement 2024-07-14 14:26:45 +02:00
4 changed files with 31 additions and 2 deletions

View File

@@ -4401,6 +4401,7 @@ static const Rule rules[] = {
RULE(.class = "PrismLauncher", .tags = 1 << 7)
RULE(.class = "antimicrox", .tags = 1 << 7)
RULE(.class = "ProtonUp-Qt", .tags = 1 << 7)
RULE(.class = "heroic", .tags = 1 << 7)
RULE(.class = "Thunar", .tags = 1 << 8)
RULE(.class = "Syncthing GTK", .tags = 1 << 8)
RULE(.class = "Nyrna", .tags = 1 << 8)

View File

@@ -521,6 +521,7 @@ static const Rule rules[] = {
RULE(.class = "PrismLauncher", .tags = 1 << 7)
RULE(.class = "antimicrox", .tags = 1 << 7)
RULE(.class = "ProtonUp-Qt", .tags = 1 << 7)
RULE(.class = "heroic", .tags = 1 << 7)
RULE(.class = "Thunar", .tags = 1 << 8)
RULE(.class = "Syncthing GTK", .tags = 1 << 8)
RULE(.class = "Nyrna", .tags = 1 << 8)

2
dwm.c
View File

@@ -3313,7 +3313,6 @@ run(void)
event_fd, events[i].data.ptr, events[i].data.u32,
events[i].data.u64);
fprintf(stderr, " with events %d\n", events[i].events);
return;
}
}
}
@@ -4102,7 +4101,6 @@ spawn(const Arg *arg)
if (arg->v == dmenucmd)
dmenumon[0] = '0' + selmon->num;
#endif // NODMENU_PATCH
fprintf(stderr, "spawn running cmd:\n");
#if RIODRAW_PATCH
if ((pid = fork()) == 0)

View File

@@ -13,6 +13,9 @@ swallow(Client *p, Client *c)
{
Client *s;
XWindowChanges wc;
#if NOBORDER_PATCH
int border_padding = 0;
#endif // NOBORDER_PATCH
if (c->noswallow > 0 || c->isterminal)
return 0;
@@ -46,9 +49,21 @@ swallow(Client *p, Client *c)
setfloatinghint(s);
#endif // BAR_EWMHTAGS_PATCH
#if NOBORDER_PATCH
wc.border_width = p->bw;
if (noborder(p)) {
wc.border_width = 0;
border_padding = p->bw * 2;
}
XConfigureWindow(dpy, p->win, CWBorderWidth, &wc);
XMoveResizeWindow(dpy, p->win, s->x, s->y, s->w + border_padding, s->h + border_padding);
#else
wc.border_width = p->bw;
XConfigureWindow(dpy, p->win, CWBorderWidth, &wc);
XMoveResizeWindow(dpy, p->win, s->x, s->y, s->w, s->h);
#endif // NOBORDER_PATCH
#if !BAR_FLEXWINTITLE_PATCH
XSetWindowBorder(dpy, p->win, scheme[SchemeNorm][ColBorder].pixel);
#endif // BAR_FLEXWINTITLE_PATCH
@@ -65,6 +80,9 @@ unswallow(Client *c)
{
XWindowChanges wc;
c->win = c->swallowing->win;
#if NOBORDER_PATCH
int border_padding = 0;
#endif // NOBORDER_PATCH
free(c->swallowing);
c->swallowing = NULL;
@@ -80,9 +98,20 @@ unswallow(Client *c)
arrange(c->mon);
XMapWindow(dpy, c->win);
#if NOBORDER_PATCH
wc.border_width = c->bw;
if (noborder(c)) {
wc.border_width = 0;
border_padding = c->bw * 2;
}
XConfigureWindow(dpy, c->win, CWBorderWidth, &wc);
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w + border_padding, c->h + border_padding);
#else
wc.border_width = c->bw;
XConfigureWindow(dpy, c->win, CWBorderWidth, &wc);
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
#endif // NOBORDER_PATCH
#if !BAR_FLEXWINTITLE_PATCH
XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel);
#endif // BAR_FLEXWINTITLE_PATCH