Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wayland: set current_output on surface leave if applicable
When the mpv surface leaves the output, we no longer mark it as the current output. However, this implicitly depends on there being a preceding surface entrance event to a different output. This is not necessarily the case. Consider moving the window from monitor 1, to monitor 1-2, and then back to 1 again. mpv gets the entrance event to monitor 2 and sets that as the current output to work off of. Then when you move back to only monitor 1, it removes monitor 2 from the current output. However, monitor 1 is not updated again as the current output because there is not a new surface entrance event in this case (the window never left). So the numbers that mpv's core is using are incorrect and for the wrong monitor. Luckily, we already keep track of what outputs the mpv surface is currently on no matter how many there are so it is simply a matter of setting current output again in the leave event if we have a different output that has the mpv surface. Ref: swaywm/sway#7932
- Loading branch information