swayfx/sway
Ryan Dwyer 63d076dc2a Fix focus after a non-visible workspace's last container is destroyed
The code being changed is responsible for updating the focus stack when
a container is destroyed in a different part of the tree to where the
real focus is. It's attempting to set focus_inactive to a sibling (or
parent if no siblings) of the container that is being destroyed, then
put our real focus back on the end of the focus stack.

The problem occurs when the container being destroyed is in a different
workspace. For example:

* Have a focused view on workspace 1
* Have workspace 2 not visible with a single view that is unmapping
* The first call to seat_set_raw_focus sets focus to workspace 2 because
it's the parent
* Prior to this patch, the second call to seat_set_raw_focus would set
focus to the view on workspace 1
* Later, when using output_get_active_workspace, this function would
return workspace 2 because it's the first workspace it finds in the
focus stack.

To fix this, workspace 1 must be placed on the focus stack between
workspace 2 and the focused view. That's what this patch does.

Lastly, it also uses seat_get_focus_inactive to choose the focus. This
fixes a crash when a view unmaps while a non-container is focused (eg.
swaylock), because focus is NULL.
2018-10-26 19:15:12 +10:00
..
commands Update workspace.c 2018-10-25 19:48:45 +02:00
config swaybar: show hidden bar on key event 2018-10-14 13:33:12 +01:00
desktop Rebase the cursor after applying transactions 2018-10-25 23:37:40 +10:00
input Fix focus after a non-visible workspace's last container is destroyed 2018-10-26 19:15:12 +10:00
tree Fix re-tiling for floating containers 2018-10-25 23:20:38 +03:00
commands.c commands: replace EXPECTED_LESS_THAN with EXPECTED_AT_MOST 2018-10-23 10:51:54 +01:00
config.c config: remove peeked + expanded line log entries 2018-10-22 17:52:41 -04:00
criteria.c Parse missing i3 window types 2018-10-21 15:59:04 +02:00
debug-tree.c Minor refactor of input manager 2018-10-20 13:11:43 +10:00
decoration.c Rename view_set_csd_from_client to view_update_csd_from_client 2018-09-27 22:51:37 +10:00
ipc-json.c xwayland: populate window_properties in json for views 2018-10-23 19:10:50 +01:00
ipc-server.c sway-ipc: don't log errno if unneeded and add more descriptive errors 2018-10-25 22:17:03 +02:00
main.c Abort if proprietary drivers are in use 2018-10-21 00:01:09 +10:00
meson.build Remove raise_floating directive 2018-10-20 17:51:32 +10:00
security.c Add minimal config subsystem 2017-12-05 10:40:55 +01:00
server.c Implement the presentation-time protocol 2018-10-23 23:38:57 +02:00
sway-bar.5.scd swaybar: add documentation for hide/hidden_state subcommands 2018-10-14 13:33:12 +01:00
sway-input.5.scd Establish sway-output(5) 2018-10-14 10:52:57 -04:00
sway-output.5.scd Document how to identify outputs by make, model and serial 2018-10-25 18:08:29 +10:00
sway.1.scd Establish sway-output(5) 2018-10-14 10:52:57 -04:00
sway.5.scd protect newline 2018-10-25 21:48:39 +02: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