sway/sway
Ryan Dwyer b14bd1b0b1 Fix crash when closing last child of a tabbed container
The crash only occurs if the mouse cursor is above the tabbed container
when the last child is closed.

Introduced in 03d49490cc, over a week ago
and unnoticed until now :O

The above commit changes the behaviour of a focus change. When you
change focus, it sends pointer motion which makes the client set a new
cursor image. We already had this behaviour for workspace switching, but
this commit adds it for view switching too, such as in a tabbed
container or when closing a view.

The sequence of events that leads to the crash is:

* The last child of a tabbed container unmaps, which triggers a
`destroy` event before we've cleaned up the child or reaped the tabbed
container.
* The seat code listens to the `destroy` event and removes the seat
container from the focus stack. As part of this, it decides to set focus
to the parent (my fix alters this decision).
* When setting focus to the new parent, the container motion is sent as
per the previously mentioned commit.
* The motion code uses `container_at`, which encounters the tabbed
container and its child in a half destroyed state, and everything blows
up from there.

`con->parent` is needed because scratchpad containers don't have parents
if they're hidden, so this probably fixes a crash when a hidden
scratchpad container closes too.

The `con->parent->children->length > 1` check should catch any cases
where the parent is about to be reaped.
2018-07-25 19:26:12 +10:00
..
commands Implement floating_modifier <mod> [inverse|normal] 2018-07-24 18:41:08 -04:00
config Reset outputs on reload 2018-07-20 22:17:20 -04:00
desktop Merge branch 'master' into pid-workspaces 2018-07-23 20:31:11 -04:00
input Fix crash when closing last child of a tabbed container 2018-07-25 19:26:12 +10:00
tree Merge pull request #2165 from swaywm/pid-workspaces 2018-07-24 14:44:01 -04:00
base64.c Rework get_clipboard implementation 2017-07-07 21:51:34 +02:00
commands.c Implement scratchpad 2018-07-23 08:24:32 +10:00
config.c Implement floating_modifier <mod> [inverse|normal] 2018-07-24 18:41:08 -04:00
criteria.c Store scratchpad list in sway_root instead of server 2018-07-23 08:24:32 +10:00
debug-tree.c Add L_FLOATING back to debug tree 2018-06-01 23:14:58 +10:00
ipc-json.c Mark containers as urgent in IPC if they have urgent views 2018-07-16 14:30:31 +10:00
ipc-server.c Make focus part of transactions 2018-07-15 22:08:26 +10:00
main.c Fix deferred command handling 2018-07-19 01:39:58 -04:00
meson.build Implement scratchpad 2018-07-23 08:24:32 +10:00
scratchpad.c Store scratchpad list in sway_root instead of server 2018-07-23 08:24:32 +10:00
security.c Add minimal config subsystem 2017-12-05 10:40:55 +01:00
server.c Store scratchpad list in sway_root instead of server 2018-07-23 08:24:32 +10:00
sway-bar.5.scd Add sway-bar(5) 2018-05-11 21:13:43 -04:00
sway-input.5.scd Implement tap_button_map for input devices 2018-07-14 01:01:47 -04:00
sway.1.scd Add sway(5) 2018-05-11 21:03:43 -04:00
sway.5.scd Add documentation for urgent command 2018-07-16 10:15:18 +10:00