aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop
Commit message (Collapse)AuthorAge
* Add support for viewporterLibravatar Simon Ser2020-06-17
| | | | | | Depends on [1]. [1]: https://github.com/swaywm/wlroots/pull/2092
* Save transform during transactionLibravatar Kalyan Sriram2020-06-05
| | | Closes: https://github.com/swaywm/sway/issues/5412
* shells: Resize on commit if geometry x/y changesLibravatar Kenny Levinsen2020-06-03
| | | | | Client-side decorations lead to changes to y position, so make sure we catch that.
* container: Remove useless surface dimensionsLibravatar Kenny Levinsen2020-06-03
| | | | The adjustments to resize logic left them unnecessary.
* transaction: Improve transaction commentaryLibravatar Kenny Levinsen2020-06-03
| | | | Some comments where slightly misleading.
* transaction: Account for full size when centering contentLibravatar Kenny Levinsen2020-06-03
| | | | | | The centering logic needs to take borders, titlebars and CSDs into account. Instead of using the main surface geometry, use the container and view geometry, which account for this.
* view: Save all buffers associated with viewLibravatar Kenny Levinsen2020-06-03
| | | | | | | | | | | | During the execution of a resize transaction, the buffer associated with a view's surface is saved and reused until the client acknowledges the resulting configure event. However, only one the main buffer of the main surface was stored and rendered, meaning that subsurfaces disappear during resize. Iterate over all, store and render buffers from all surfaces in the view to ensure that correct rendering is preserved.
* xwayland: pass focus to previous unmanaged surface on unmapLibravatar Tudor Brindus2020-06-01
| | | | | | | | This is necessary because some applications (e.g. Jetbrains IDEs) represent their multi-level menus as unmanaged surfaces, and when closing a submenu, the main menu should get input focus. Closes #5347.
* Add views idle inhibition status in get_tree outputLibravatar Damien Tardy-Panis2020-05-29
| | | | Fixes #5286
* Fix typos in commentsLibravatar Martin Michlmayr2020-05-21
|
* Render layer shell popups over the top layerLibravatar David962020-04-10
|
* output: remove damage listeners in damage destroyLibravatar Rouven Czerwinski2020-04-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of removing the destroy listeners in the output destroy, remove them in the damage destroy handler. Fixes the following use after free: ==646625==ERROR: AddressSanitizer: heap-use-after-free on address 0x61200017cab8 at pc 0x0000004f8f29 bp 0x7ffdf465ad30 sp 0x7ffdf465ad20 WRITE of size 8 at 0x61200017cab8 thread T0 #0 0x4f8f28 in wl_list_remove ../common/list.c:181 #1 0x43dd24 in handle_destroy ../sway/desktop/output.c:790 (`wl_list_remove(&output->damage_destroy.link);` here, 214e3030e1dce master branch) #2 0x7f0e573a1c93 in wlr_signal_emit_safe ../util/signal.c:29 #3 0x7f0e57390954 in wlr_output_destroy ../types/wlr_output.c:365 #4 0x7f0e5735e37f in backend_destroy ../backend/x11/backend.c:128 #5 0x7f0e57348147 in wlr_backend_destroy ../backend/backend.c:47 #6 0x7f0e57356f75 in multi_backend_destroy ../backend/multi/backend.c:54 #7 0x7f0e5735710e in handle_display_destroy ../backend/multi/backend.c:107 #8 0x7f0e573f23e4 in wl_display_destroy (/lib64/libwayland-server.so.0+0x93e4) #9 0x42f0b2 in server_fini ../sway/server.c:177 #10 0x42dd01 in main ../sway/main.c:414 #11 0x7f0e570f7041 in __libc_start_main (/lib64/libc.so.6+0x27041) #12 0x40e3bd in _start (/opt/wayland/bin/sway+0x40e3bd) 0x61200017cab8 is located 120 bytes inside of 320-byte region [0x61200017ca40,0x61200017cb80) freed by thread T0 here: #0 0x7f0e57aa9357 in __interceptor_free (/lib64/libasan.so.6+0xb0357) #1 0x7f0e5738b877 in wlr_output_damage_destroy ../types/wlr_output_damage.c:143 #2 0x7f0e5738b2b9 in output_handle_destroy ../types/wlr_output_damage.c:13 #3 0x7f0e573a1c93 in wlr_signal_emit_safe ../util/signal.c:29 #4 0x7f0e57390954 in wlr_output_destroy ../types/wlr_output.c:365 #5 0x7f0e5735e37f in backend_destroy ../backend/x11/backend.c:128 #6 0x7f0e57348147 in wlr_backend_destroy ../backend/backend.c:47 #7 0x7f0e57356f75 in multi_backend_destroy ../backend/multi/backend.c:54 #8 0x7f0e5735710e in handle_display_destroy ../backend/multi/backend.c:107 #9 0x7f0e573f23e4 in wl_display_destroy (/lib64/libwayland-server.so.0+0x93e4) previously allocated by thread T0 here: #0 0x7f0e57aa9887 in __interceptor_calloc (/lib64/libasan.so.6+0xb0887) #1 0x7f0e5738b532 in wlr_output_damage_create ../types/wlr_output_damage.c:91 #2 0x43e4a7 in handle_new_output ../sway/desktop/output.c:875 #3 0x7f0e573a1c93 in wlr_signal_emit_safe ../util/signal.c:29 #4 0x7f0e57357261 in new_output_reemit ../backend/multi/backend.c:143 #5 0x7f0e573a1c93 in wlr_signal_emit_safe ../util/signal.c:29 #6 0x7f0e5736030a in wlr_x11_output_create ../backend/x11/output.c:253 #7 0x7f0e5735e309 in backend_start ../backend/x11/backend.c:113 #8 0x7f0e573480fb in wlr_backend_start ../backend/backend.c:36 #9 0x7f0e57356e61 in multi_backend_start ../backend/multi/backend.c:31 #10 0x7f0e573480fb in wlr_backend_start ../backend/backend.c:36 #11 0x42f4ba in server_start ../sway/server.c:205 #12 0x42dbd7 in main ../sway/main.c:394 #13 0x7f0e570f7041 in __libc_start_main (/lib64/libc.so.6+0x27041) Fixes #5158
* Add test-only support to wlr-output-management-unstable-v1Libravatar Simon Ser2020-04-08
| | | | | Use the new test_output_config function to implement wlr-output-management-unstable-v1's test request.
* Stop checking wlr_output_attach_buffer return valueLibravatar Simon Ser2020-04-08
| | | | | | Update for [1]. Everything is now checked at commit-time. [1]: https://github.com/swaywm/wlroots/pull/2097
* change apply_exclusive() to closer match layer shell protocolLibravatar Leon Plickat2020-03-30
| | | | | | | | | | | | With these changes, sway will respect positive exclusive zones of layer surfaces anchored to one or three sides. This matches the protocol, which states that a positive exclusive zone should be respected, "if the surface is anchored to one edge or an edge and both perpendicular edges". If the surfaces is "anchored to only two perpendicular edges (a corner), anchored to only two parallel edges or anchored to all edges a positive value will be treated the same as zero".
* Null check sway_layer_surface when checking damageLibravatar Tadeo Kondrak2020-03-10
| | | | | Before this change, an overlay layer-shell surface without a buffer attached would segfault the compositor on screen damage.
* Use wlr_client_bufferLibravatar Simon Ser2020-03-06
| | | | | | Update for breaking changes in [1]. [1]: https://github.com/swaywm/wlroots/pull/2043
* Drop sway_output.surface_needs_frameLibravatar Simon Ser2020-03-06
| | | | | | | wlr_output_schedule_frame now sets output->needs_frame [1], so this isn't needed anymore. [1]: https://github.com/swaywm/wlroots/pull/2053
* Only schedule a frame if client has requested a frame callbackLibravatar Simon Ser2020-03-06
| | | | | When a client hasn't damaged its surface, we only need to schedule an output frame if the client has requested a frame callback.
* Make handle_destroy and output_repaint_timer_handler staticLibravatar Simon Ser2020-03-04
|
* Add support for wlr-output-power-management-unstable-v1Libravatar Simon Ser2020-02-26
|
* Revert "Don't apply exclusive zones of unmapped layer-shell surfaces"Libravatar Brian Ashworth2020-02-25
| | | | This reverts commit e1eda8a09c15780e7f6ab0b6a1ab7e811a3d8764.
* Don't apply exclusive zones of unmapped layer-shell surfacesLibravatar Simon Ser2020-02-24
| | | | | | Backport of [1]. [1]: https://github.com/emersion/rootston/pull/15/files
* Fix get_int_prop(WINDOW_TYPE) crashLibravatar Simon Ser2020-02-19
|
* Call apply_output_config instead of output_enableLibravatar Simon Ser2020-02-11
| | | | | | | apply_output_config will call output_enable if necessary. This fixes a lone wlr_output_enable call (without a matching wlr_output_commit call) which was a no-op.
* Fix seat_set_focus_layer crash when disabling outputLibravatar Simon Ser2020-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following crash: #0 0x00007f7daac3af25 in raise () at /usr/lib/libc.so.6 #1 0x00007f7daac24897 in abort () at /usr/lib/libc.so.6 #2 0x00007f7daac24767 in _nl_load_domain.cold () at /usr/lib/libc.so.6 #3 0x00007f7daac33526 in () at /usr/lib/libc.so.6 #4 0x0000555bfbc35029 in seat_set_focus_layer (seat=0x555bfd76d860, layer=0x555bfdda2ff0) at ../sway/input/seat.c:1164 __PRETTY_FUNCTION__ = "seat_set_focus_layer" __PRETTY_FUNCTION__ = "seat_set_focus_layer" #5 0x0000555bfbc35029 in seat_set_focus_layer (seat=seat@entry=0x555bfd76d860, layer=0x555bfdda2ff0) at ../sway/input/seat.c:1164 __PRETTY_FUNCTION__ = "seat_set_focus_layer" #6 0x0000555bfbc25899 in handle_output_destroy (listener=0x555bfdb90688, data=<optimized out>) at ../sway/desktop/layer_shell.c:263 layer = 0x555bfdd6b040 sway_layer = 0x555bfdb90610 seat = 0x555bfd76d860 client = 0x555bfdb76d70 set_focus = <optimized out> #7 0x0000555bfbc5b669 in wl_signal_emit (data=0x555bfd795930, signal=0x555bfd795ae0) at /usr/include/wayland-server-core.h:472 l = <optimized out> next = 0x555bfdb6a3e8 __PRETTY_FUNCTION__ = "output_disable" index = <optimized out> #8 0x0000555bfbc5b669 in output_disable (output=output@entry=0x555bfd795930) at ../sway/tree/output.c:263 __PRETTY_FUNCTION__ = "output_disable" index = <optimized out> #9 0x0000555bfbc3b890 in apply_output_config (oc=0x555bfd7d73d0, output=output@entry=0x555bfd795930) at ../sway/config/output.c:321 wlr_output = 0x555bfd7afaf0 scale = <optimized out> output_box = <optimized out> #10 0x0000555bfbc28309 in handle_output_manager_apply (listener=0x555bfbc7f148 <server+488>, data=0x555bfdca6eb0) at ../sway/desktop/output.c:936 wlr_output = <optimized out> output = 0x555bfd795930 oc = <optimized out> server = 0x555bfbc7ef60 <server> config = 0x555bfdca6eb0 config_head = 0x555bfdb79350 ok = true #11 0x00007f7dab4fbf7c in wlr_signal_emit_safe (signal=<optimized out>, data=0x555bfdca6eb0) at ../subprojects/wlroots/util/signal.c:29 pos = 0x555bfbc7f148 <server+488> l = 0x555bfbc7f148 <server+488> cursor = {link = {prev = 0x555bfbc7f148 <server+488>, next = 0x7fff238a8390}, notify = 0x7f7dab4fbef0 <handle_noop>} end = {link = {prev = 0x7fff238a8370, next = 0x555bfd7419f8}, notify = 0x7f7dab4fbef0 <handle_noop>} #12 0x00007f7daa45469a in ffi_call_unix64 () at /usr/lib/libffi.so.6 #13 0x00007f7daa453fb6 in ffi_call () at /usr/lib/libffi.so.6 #14 0x00007f7daae6f82f in () at /usr/lib/libwayland-server.so.0 #15 0x00007f7daae6c193 in () at /usr/lib/libwayland-server.so.0 #16 0x00007f7daae6d7f2 in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0 #17 0x00007f7daae6c39c in wl_display_run () at /usr/lib/libwayland-server.so.0 This crash happens because focus can only be set on mapped surfaces.
* desktop/output: fix mem leak in handle_new_outputLibravatar Brian Ashworth2020-01-16
| | | | | | This fixes a memory leak of oc (the output config) in handle_new_output. Output configs returned from find_output_config are not stored and need to be freed after use.
* Fix unreliable scaling filterLibravatar Simon Ser2020-01-13
| | | | | | | | | | | | | Two changes were made: - Bind the texture before glTexParameteri - Set the scaling filter before each wlr_render_texture_with_matrix call Logging in wlroots allows to check that the scaling filter is properly set prior to rendering. Fixes: 6968fb3123e6 ("add scale_filter output config option") Closes: https://github.com/swaywm/sway/issues/4798
* render: do not render indicator on floating viewsLibravatar Brian Ashworth2020-01-05
| | | | | | | | | This adds a check to make it so the indicator is only rendered on views with a parent, which floating views do not. Since floating views do not have a parent, the workspace layout was being incorrectly used to determine whether to show the split indicator previously. This has no impact on floating containers and a view within a floating container will still have indicators rendered appropriately.
* xwayland: handle size_hints == NULLLibravatar Rouven Czerwinski2020-01-03
| | | | | | | | In case xcb-iccm is not installed on the system, size_hints will be null. Handle this as if the get_constraints functions was not implemented and return the defaults. Fixes #4870
* Re-add support for wlr_output's atomic APILibravatar Simon Ser2019-12-30
| | | | | | | | | | | | | This reverts commit 724926ea6ae119956dc7b1e39c2e30c1e3657676 and re-applies commit 6e0565e9de4247bbf0ca662565c58e0a54258d6e. Outputs now need to be explicitly enabled when performing a modeset. We need to roll back wlr_output_attach_render when we decide not to render. See also: https://github.com/swaywm/wlroots/pull/1797 (wlroots PR) See also: https://github.com/swaywm/sway/pull/4355 (Original sway PR) See also: https://github.com/swaywm/sway/pull/4434 (Revert sway PR)
* layer-shell: refocus if keyboard interactive lostLibravatar Brian Ashworth2019-12-27
| | | | | | | | When arranging layer-shell layers, verify that the currently focused layer, if any, for each seat is still keyboard interactive. If the layer is no longer keyboard interactive and there is not a keyboard interactive overlay or top layer to change the focus to, refocus the focus inactive node for the seat.
* desktop/surface: Fix crash when timer is NULLLibravatar Manuel Stoeckl2019-12-24
| | | | | | | | | | | | | When many surfaces are created, sway can run out of file descriptors, making wl_event_loop_add_timer (which creates a timerfd) fail and return NULL. This patch posts a "no memory" error when that is the case, and only removes the timer if it was created. (Why "no memory"? It is not easy to distinguish between failures due to running out of memory and failures due to running out of file descriptors. Also, using the newer `wl_client_post_implementation_error` function would lead to an increased version requirement for the libwayland-server dependency.)
* layer-shell: unfocus output-less layer on unmapLibravatar Brian Ashworth2019-12-10
| | | | | | | | | If a layer is focused by any seat, it needs to be unfocused on unmap. If the unmap was due to an output being disabled, there would not be a sway_output and unmap would do an early return. This results in a use-after-free if the layer was focused by any seat prior to being unmapped. This change just moves the refocusing code above the early returns.
* output: Restore previous max_render_time behaviorLibravatar Kenny Levinsen2019-12-01
|
* output: Schedule idle frames if we do not renderLibravatar Kenny Levinsen2019-12-01
| | | | | | | | | | | | | | | | | | | | Repaint scheduling delays output render and frame done events from output frame events, and block idle frame events from being scheduled in between output frame done and output render in this period of time. If a surface is committed after its frame done event, but before output render, idle frame requests will be blocked, and the surface relies on the upcoming render to schedule a frame. If when the repaint timer expires, output render is deemed unnecessary, no frame will be scheduled. This can lead to surfaces never having their frame callbacks fire. To fix this, we store that a surface has requested a frame in surface_needs_frame. When the repaint expires, if no render is deemed necessary, we check this flag and schedule an idle frame. Fixes #4768
* output: Replace block_idle_frame with frame_pendingLibravatar Kenny Levinsen2019-12-01
|
* add scale_filter output config optionLibravatar Ronan Pigott2019-11-29
|
* output: Ensure that frame_done is delayed on max_render_timeLibravatar Kenny Levinsen2019-11-28
| | | | | | | | | | | | | | | | | | | max_render_time can be set on output, view, or both. However, if only applied to the output, send_frame_done_iterator would erroneously send frame_done immediately, ignoring the output max_render_time. As damage_handle_frame processed max_render_time correctly, idle frames would be blocked in anticipation of the delay that was meant to happen. Without the delay, frame events would be dispatched during the idle frame block, and some clients would never receive the frame done events they had requested, at least not until something else actively drove another render. Respecting both view and output max_render_time in send_frame_done_iterator ensures that the frame events are always correctly delayed. Fixes #4756
* Amend typosLibravatar Jason2019-11-23
|
* Use new presentation-time helperLibravatar Simon Ser2019-11-21
| | | | | This has the advantage to (1) reduce boilerplate and (2) make us correctly handle wlr_output_event_present.commit_seq.
* output: check wlr_output in repaint handlerLibravatar Ivan Molodetskikh2019-11-17
| | | | | | It's possible for the output to be disconnected in just the right moment for wlr_output to be NULL in the repaint handler, causing a crash. This check fixes that crash.
* view: add max_render_timeLibravatar Ivan Molodetskikh2019-11-17
|
* Add sway_surfaceLibravatar Ivan Molodetskikh2019-11-17
| | | | For extending wlr_surface with additional things.
* output: add max_render_timeLibravatar Ivan Molodetskikh2019-11-17
|
* xwayland: get_constraints using size hintsLibravatar Rouven Czerwinski2019-11-16
| | | | | | Previously, Xwayland windows did not have size_constraints implemented, resulting in the window being resizable. This implements the constraints through the X11 size hints supplied by the window itself.
* Fix presentation feedback when scanning out fullscreen viewLibravatar Simon Ser2019-10-27
| | | | Closes: https://github.com/swaywm/sway/issues/4663
* Handle layer changes for layer shell surfacesLibravatar Simon Ser2019-10-27
| | | | | Closes: https://github.com/swaywm/sway/issues/4644 References: https://github.com/emersion/rootston/commit/1982106c9b0fbd48ee9fe20e013524125f6ca3cf
* Fix segfault in wlr_output_manager_v1_set_configurationLibravatar Simon Ser2019-10-27
| | | | | | | | | | | | | | Calling wlr_output_manager_v1_set_configuration with an enabled output and a NULL mode is incorrect if the output doesn't support modes. When DPMS'ing an output, wlr_output_enable(output, false) is called. This de-allocates the CRTC and sets wlr_output.current_mode to NULL. Because we mark DPMS'ed outputs as enabled, we also need to provide a correct output mode. Add a field to sway_output to hold the current mode. Closes: https://github.com/swaywm/wlroots/issues/1867
* Fix refresh rate scale of outputLibravatar Danilo Spinella2019-10-21
| | | | | | | | When applying config, value mode->refresh is mHz; convert it to Hz before assigning it to the temporary output config. oc->refresh_rate will be converted back to mHz in set_mode function. Fix debug log printing GHz instead of Hz.