sway-patched-tray-menu-github/sway
emersion 3b7a7462a2 Fix crash in cursor_rebase with multiple screens
Designing the output configuration sequence without invalid state is tricky.

We have one function, apply_output_config, that takes an output and (besides
other things) performs a modeset and inserts the output in the output layout.
The modeset can fail, in which case we don't want the output to be enabled.
We also have an output_enable function, which calls output_apply_config and
also configures the output's workspace and inserts it in the root container.

Now, we have two choices.

Either we configure the output before it's been inserted in the root container
and then, if the modeset was successful, we insert it and create the workspace.
The main issue with this approach is that configuring the output triggers a
handful of signals, namely wlr_output.mode and wlr_output_layout.change. In
those event handlers, we need to make sure to ignore these outputs in the
process of being configured.

Either we first insert the output, create the workspace and then try to
configure it. It means we need to undo everything if the modeset fails. The
main issue with this solution is that it enables and disables the output very
quickly, creates a workspace and immediately destroys it, and maybe moves
views back and forth (see output_evacuate).

I've tried to make it so an output isn't enabled then immediately disabled. We
already have code for ignoring outputs when the output is being destructed.

Fixes https://github.com/swaywm/sway/issues/3462
2019-01-19 08:29:46 +01:00
..
commands Don't escape swaybg arguments anymore 2019-01-18 09:22:33 +01:00
config Better handle outputs without CRTC 2019-01-18 10:09:10 +01:00
desktop Better handle outputs without CRTC 2019-01-18 10:09:10 +01:00
input Fix crash in cursor_rebase with multiple screens 2019-01-19 08:29:46 +01:00
tree Fix segfault in output_enable 2019-01-18 14:52:40 +01:00
commands.c Remove now-unused "input" argument of cmd_results_new 2019-01-14 08:05:29 -05:00
config.c Remove 'input' field of IPC command return json 2019-01-14 07:58:02 -05:00
criteria.c Replace _XOPEN_SOURCE with _POSIX_C_SOURCE 2018-11-25 17:19:43 +01:00
debug-tree.c Minor refactor of input manager 2018-10-20 13:11:43 +10:00
decoration.c Fix double free when unmapping any view 2018-11-15 15:22:09 +10:00
ipc-json.c bar_cmd_tray_bind: Use mouse button helpers 2019-01-16 11:12:45 +01:00
ipc-server.c Use static arrays where possible. 2019-01-16 13:02:26 +01:00
main.c Do not send ipc_event_shutdown from ipc client 2019-01-15 22:41:54 +01:00
meson.build meson: remove rpath options 2019-01-18 08:26:44 +01:00
security.c Replace _XOPEN_SOURCE with _POSIX_C_SOURCE 2018-11-25 17:19:43 +01:00
server.c Merge pull request #3144 from emersion/cmd-xwayland 2019-01-13 20:42:39 -05:00
sway-bar.5.scd bar_cmd_tray_bind: Use mouse button helpers 2019-01-16 11:12:45 +01:00
sway-input.5.scd Merge pull request #3343 from RedSoxFan/seat-cursor-buttons-improved 2019-01-13 20:40:42 -05:00
sway-output.5.scd Fixed formulations. 2019-01-04 12:44:03 +01:00
sway.1.scd Undocument SWAY_CURSOR_THEME and SWAY_CURSOR_SIZE 2018-12-31 01:42:33 +01:00
sway.5.scd Merge pull request #3144 from emersion/cmd-xwayland 2019-01-13 20:42:39 -05:00
swaynag.c Allow swaynag to be disabled 2018-10-08 09:59:38 -04:00
xdg_decoration.c Improve CSD logic 2018-09-27 22:51:37 +10:00