bakkeby / dwm-flexipatch

A dwm build with preprocessor directives to decide which patches to include during build time
MIT License
1.15k stars 235 forks source link

dwm multimonitor crashing #423

Closed Ampnbsp closed 4 months ago

Ampnbsp commented 4 months ago

How to reproduce:

1) Launch program whose windows can be hidden by killclient (discord, telegram etc.); 2) Move window in the other monitor; 3) killclient on that window; 4) Go to the previous monitor; 5) Open that window.

After these steps dwm crashes.

https://github.com/bakkeby/dwm-flexipatch/assets/41110719/bc7983da-4ab3-49da-a329-7ee4f17d7440

The patches:

#define BAR_DWMBLOCKS_PATCH 1
#define BAR_LAYOUTMENU_PATCH 1
#define BAR_LTSYMBOL_PATCH 1
#define BAR_STATUS_PATCH 1
#define BAR_STATUSCMD_PATCH 1
#define BAR_SYSTRAY_PATCH 1
#define BAR_TAGS_PATCH 1
#define BAR_WINTITLE_PATCH 1
#define BAR_EXTRASTATUS_PATCH 1
#define BAR_EWMHTAGS_PATCH 1
#define BAR_HIDEVACANTTAGS_PATCH 1
#define BAR_NO_COLOR_EMOJI_PATCH 1
#define BAR_STATUSALLMONS_PATCH 1
#define ALWAYSCENTER_PATCH 1
#define AUTOSTART_PATCH 1
#define AUTORESIZE_PATCH 1
#define CFACTS_PATCH 1
#define DRAGCFACT_PATCH 1
#define DRAGMFACT_PATCH 1
#define DWMC_PATCH 1
#define FAKEFULLSCREEN_CLIENT_PATCH 1
#define FOCUSMASTER_RETURN_PATCH 1
#define FOCUSONCLICK_PATCH 1
#define LOSEFULLSCREEN_PATCH 1
#define MONITOR_RULES_PATCH 1
#define MOVESTACK_PATCH 1
#define NET_CLIENT_LIST_STACKING_PATCH 1
#define NODMENU_PATCH 1
#define NO_MOD_BUTTONS_PATCH 1
#define NO_TRANSPARENT_BORDERS_PATCH 1
#define PERTAG_PATCH 1
#define PLACEMOUSE_PATCH 1
#define RENAMED_SCRATCHPADS_PATCH 1
#define RESIZEPOINT_PATCH 1
#define RESTARTSIG_PATCH 1
#define SAVEFLOATS_PATCH 1
#define SEAMLESS_RESTART_PATCH 1
#define SELFRESTART_PATCH 1
#define SENDMON_CENTER_PATCH 1
#define SENDMON_KEEPFOCUS_PATCH 1
#define SHIFTTAG_PATCH 1
#define SHIFTVIEW_CLIENTS_PATCH 1
#define STEAM_PATCH 1
#define STICKY_PATCH 1
#define SWALLOW_PATCH 1
#define TAGMONFIXFS_PATCH 1
#define TOGGLEFULLSCREEN_PATCH 1
#define VIEW_HISTORY_PATCH 1
#define WINVIEW_PATCH 1
#define XRDB_PATCH 1
#define ZOOMSWAP_PATCH 1
#define BSTACKHORIZ_LAYOUT 1
#define DECK_LAYOUT 1
#define GAPPLESSGRID_LAYOUT 1
#define TILE_LAYOUT 1
#define MONOCLE_LAYOUT 1
bakkeby commented 4 months ago

Thanks for the replication steps, I am able to reproduce this issue.

bakkeby commented 4 months ago

Quite obscure issue.

The underlying issue was the seamless restart functionality, but triggered by:

When the application was started again:

In this specific scenario the issue was more apparent because the alwayscenter patch had also been enabled, which sets the save floats coordinates when the window is first mapped (again leading to the coordinates to be persisted when the window is moved to another monitor). This would have been reproducible without it, but then it would require the window to be made floating and moved or resized before it is sent to the other monitor.

Ampnbsp commented 4 months ago

Yes, the issue seems to be gone, thank you.

When I tested it with SWITCHTAG_PATCH I found a kind of offtopic bug. E.g. dwm has this rule RULE(.class = "ArmCord", .monitor = 1, .switchtag = 3, .tags = 1 << 7).

When I launch this from the other monitor, the focus duplicates on the client where I was focused and the launched program.

pictureissue

I put to unfocus(selmon->sel, 1, NULL); before the selmon = c->mon; and it seems work fine, but I don't know is this the right solution.

bakkeby commented 4 months ago

I don't see anything immediately wrong with that solution.

Could you raise this as a new issue just so that I have another reference for it?