This repository has been archived by the owner on Jan 26, 2024. It is now read-only.
Clients on external monitor in monocle layout don't all come off monitor on disconnect #326
Labels
A: bug
Something isn't working
Info
dwl's commit: e9826de
wlroots version: 0.15.1
Description
It there are 2 clients in a monocle layout on an external monitor, when the monitor is unplugged, only one of them jumps to the remaining monitor, where the other can't be seen. When the monitor is plugged back in, the left behind client is still there, but often in some kind of weird state that can trigger a segfault somethings.
I've found it's caused by the line added in 06d9230.
cleanupmon()
callsfocusclient()
just beforeclosemon()
to setselmon
to the remaining monitor. In thewl_list_for_each
loop inclosemon()
, the first client on the dying monitor is moved correctly, butsetmon()
changesselmon
back to the dying monitor in the process while callingmonocle()
(fromarrange()
). Then, the next round of the loop,selmon
is back on the dying monitor, so the remaining client issetmon
ed to that, which does nothing, and it doesn't move.For fixes, fixing
monocle()
to not changeselmon
, such as by calling onlywlr_scene_node_raise_to_top
to move the focused client to the top of monocle without all the other things infocusclient
fixes this. I don't know if there are other thingsfocusclient
does that are necessary in some cases though.Things could also be changed in
closemon()
, such thatselmon
is restored to the new monitor at the top of the loop, or maybe not rely onselmon
completely and copy the target monitor to a distinct variable before the loop andsetmon
to that instead.The text was updated successfully, but these errors were encountered: