Fix for dwm crashing following unmapping of systray window that had been moved to another monitor ref. #423

This commit is contained in:
bakkeby 2024-05-02 22:08:16 +02:00
parent a18f3ef370
commit 79404e419f
2 changed files with 9 additions and 7 deletions

4
dwm.c
View File

@ -2516,8 +2516,10 @@ manage(Window w, XWindowAttributes *wa)
#endif // CENTER_TRANSIENT_WINDOWS_PATCH | CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH | CENTER_PATCH #endif // CENTER_TRANSIENT_WINDOWS_PATCH | CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH | CENTER_PATCH
} else { } else {
#if SEAMLESS_RESTART_PATCH #if SEAMLESS_RESTART_PATCH
if (!settings_restored) if (!settings_restored || c->mon == NULL) {
c->mon = selmon; c->mon = selmon;
settings_restored = 0;
}
#else #else
c->mon = selmon; c->mon = selmon;
#endif // SEAMLESS_RESTART_PATCH #endif // SEAMLESS_RESTART_PATCH

View File

@ -39,12 +39,12 @@ persistclientstate(Client *c)
int int
restoreclientstate(Client *c) restoreclientstate(Client *c)
{ {
return getclienttags(c) int restored = getclientfields(c);
| getclientfields(c) getclienttags(c);
#if SAVEFLOATS_PATCH #if SAVEFLOATS_PATCH
| restorewindowfloatposition(c, c->mon ? c->mon : selmon) restorewindowfloatposition(c, c->mon ? c->mon : selmon);
#endif // SAVEFLOATS_PATCH #endif // SAVEFLOATS_PATCH
; return restored;
} }
void setmonitorfields(Monitor *m) void setmonitorfields(Monitor *m)