swayfx/sway
Rouven Czerwinski 30e400c0a3 view: handle case where map_ws is NULL
When a criteria places the view into the scratchpad, map_ws is NULL and
trying to access map_ws->fullscreen will result in SIGSEGFAULT with:

  #0  0x0000000000455327 in should_focus (view=0x15a6a70) at ../sway/tree/view.c:604
          prev_con = 0x0
          len = <optimized out>
          seat = 0x12233c0
          prev_ws = 0x1264c80
          map_ws = 0x0
          criterias = <optimized out>
          seat = <optimized out>
          prev_con = <optimized out>
          prev_ws = <optimized out>
          map_ws = <optimized out>
          criterias = <optimized out>
          len = <optimized out>
          num_children = <optimized out>
  #1  view_map (view=view@entry=0x15a6a70, wlr_surface=0x15a5cb0, fullscreen=<optimized out>, fullscreen_output=<optimized out>, decoration=<optimized out>) at ../sway/tree/view.c:809
          __PRETTY_FUNCTION__ = "view_map"
          ws = <optimized out>
          seat = <optimized out>
          node = <optimized out>
          target_sibling = <optimized out>
          container = 0x1625400
          set_focus = <optimized out>
          app_id = <optimized out>
          class = <optimized out>
  #2  0x0000000000423a7e in handle_map (listener=0x15a6c78, data=<optimized out>) at ../sway/desktop/xdg_shell.c:454
          xdg_shell_view = 0x15a6a70
          view = 0x15a6a70
          xdg_surface = 0x15a6620
          csd = <optimized out>
  #3  0x00007f508bd3674c in wlr_signal_emit_safe (signal=signal@entry=0x15a6718, data=data@entry=0x15a6620) at ../subprojects/wlroots/util/signal.c:29
          pos = 0x15a6c78
          l = 0x15a6c78
          cursor = {link = {prev = 0x15a6c78, next = 0x7fff53d58190}, notify = 0x7f508bd366c0 <handle_noop>}
          end = {link = {prev = 0x7fff53d58170, next = 0x15a6718}, notify = 0x7f508bd366c0 <handle_noop>}
  #4  0x00007f508bd15b29 in handle_xdg_surface_commit (wlr_surface=<optimized out>) at ../subprojects/wlroots/types/xdg_shell/wlr_xdg_surface.c:384
          surface = 0x15a6620
  #5  0x00007f508bd2e981 in surface_commit_state (surface=surface@entry=0x15a5cb0, next=next@entry=0x15a5e18) at ../subprojects/wlroots/types/wlr_surface.c:455
          __PRETTY_FUNCTION__ = "surface_commit_state"
          invalid_buffer = <optimized out>
          subsurface = 0x15a6038
  #6  0x00007f508bd2f53b in surface_commit_pending (surface=0x15a5cb0) at ../subprojects/wlroots/types/wlr_surface.c:474
          next_seq = 3
          next_seq = <optimized out>
  #7  surface_commit (client=<optimized out>, resource=<optimized out>) at ../subprojects/wlroots/types/wlr_surface.c:542
          surface = 0x15a5cb0
          subsurface = <optimized out>

If map_ws is NULL we assume the view is places into the scratchpad and
return false as well.
2021-04-29 09:06:05 +02:00
..
commands commands/exec_always: log error on execlp failure 2021-04-22 23:12:49 +02:00
config output: Reconfigure xcursor when applying output config 2021-02-24 20:54:48 +01:00
desktop xdg-shell: ignore unecessary fullscreen request ouput hints 2021-04-26 13:14:24 -07:00
input Implement input method keyboard grab 2021-03-12 12:18:08 +01:00
tree view: handle case where map_ws is NULL 2021-04-29 09:06:05 +02:00
commands.c Fix for_window criteria and mouse button bindings 2021-02-25 09:48:39 -05:00
config.c config: allow whitespaces in config path 2021-03-25 17:22:26 +01:00
criteria.c container: Move pending state to state struct 2021-02-16 22:05:00 -05:00
decoration.c Fix double free when unmapping any view 2018-11-15 15:22:09 +10:00
ipc-json.c container: Move pending state to state struct 2021-02-16 22:05:00 -05:00
ipc-server.c Fix incorrect format specifiers 2020-07-30 22:02:42 -04:00
main.c Log wlroots version on startup 2021-04-12 16:18:17 +02:00
meson.build Automatically map built-in touchscreens/tablets to built-in panels 2021-02-25 09:38:00 -05:00
server.c Remove WLR_HAS_XDG_FOREIGN checks 2021-04-11 19:14:05 +02:00
sway-bar.5.scd Add support for workspace_min_width bar option. 2020-10-11 19:12:42 +02:00
sway-input.5.scd man: document input XXX map_to_output * 2021-02-25 09:38:00 -05:00
sway-ipc.7.scd document parse_error 2020-11-21 11:42:29 +01:00
sway-output.5.scd Add toggle logic inside DPMS handler 2021-03-25 11:01:04 +01:00
sway.1.scd man: update maintainer 2021-01-08 09:33:51 +01:00
sway.5.scd Change workspace_layout to match i3 behavior 2020-12-20 00:58:42 -05:00
swaynag.c Use execlp("sh") instead of execl("/bin/sh") 2021-04-22 23:12:49 +02:00
xdg_decoration.c Fix xdg-decoration unconfigured if set before first commit 2019-05-03 15:37:32 -06:00