aboutsummaryrefslogtreecommitdiffstats
path: root/sway
Commit message (Collapse)AuthorAge
* seatop_down: Change type of sx, sy to double in begin_seatop_downLibravatar David Rosca2021-08-05
| | | | | | | | | | | | | | | Losing the precision resulted in wlr_cursor and wlr_seat::pointer_state getting out of sync during pointer motion in seatop_down. Since the difference was always under 1 px, it was practically impossible to notice in normal use. But because of being out of sync, cursor_rebase would always end up incorrectly calling wlr_seat_pointer_notify_motion from seatop_default_begin (on releasing mouse button) which broke cursor locking. See #5405 Closes #4632
* man: update Pango font description URLLibravatar frogtile2021-08-04
| | | The old URL gives a 404.
* Fix wl_pointer.frame not sent on touch emulationLibravatar Simon Ser2021-07-26
| | | | | | | | | | | | When emulating touch, the simulating_pointer_from_touch field is set to true. It's switched back to false when a touch_up event is received. However we need to ensure we always send a wl_pointer.frame event following a group of other wl_pointer events. Since a touch_frame event is always guaranteed to come after a group of touch events, unset simulating_pointer_from_touch in the touch_frame handler instead of the touch_up handler. Add a new field to know whether the touch_frame handler should stop emulation.
* Fix crash when starting without HOMELibravatar Tobias Stoeckmann2021-07-23
| | | | | | | | | | If HOME environment variable is not set, sway fails startup with a segmentation fault due to null pointer dereference. Also check calloc return value and only perform the fallback code when really needed. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* Add `gaps <type> <scope> toggle <px>` commandLibravatar bR3iN2021-07-22
| | | | | | | | Add a subcommand for `gaps` that allows to toggle gaps at runtime. This functionality is part of i3-gaps since [1] but is missing in sway. [1] https://github.com/Airblader/i3/pull/264
* Add support for touch frame eventsLibravatar Simon Ser2021-07-08
| | | | | | Update for the breaking change in [1]. [1]: https://github.com/swaywm/wlroots/pull/3001
* Update wlr_box includesLibravatar Simon Ser2021-07-07
| | | | | | Update for the breaking change in [1]. [1]: https://github.com/swaywm/wlroots/pull/3011
* container: ignore borders in fullscreen windowsLibravatar Dudemanguy2021-07-06
| | | | | | | | | | | | | | When setting the geometry from content for floating windows, the coordinates for borders are normally taken into account. However in the case of a floating fullscreen window, we should not be doing this. Since the content of the container takes the space of the entire output, this causes the calculated borders to neccesarily be outside of the output. This later causes a problem when sending surface entrance events since in a multi-monitor setup, the border coordinates will overlap with another output despite the surface not actually being on that output at all. The fix is to just ignore border coordinates for a floating fullscreen container since fullscreen, of course, does not actually have any borders. Fixes #6080.
* tree/container: fix indentationLibravatar Simon Ser2021-07-05
|
* input: Move get_current_time_msec in from utilLibravatar Kenny Levinsen2021-06-23
| | | | | | | get_current_time_msec is only used in cursor.c, so we can move it in and make it static. This is primarily intended to avoid a symbol collision with wlroots, which we unfortunately do not have a good solution for yet.
* Revert "Add workspace {prev,next}_on_output --create"Libravatar Ragnar Groot Koerkamp2021-06-22
| | | | | | | This reverts commit 487c83f0de9ca2a7650ad636eed6fd694ddcb82e. The --create flag is undocumented, not in i3, and at least partially broken (#5913), so this removes the feature.
* Don't apply hide_edge_borders to any floating containerLibravatar novenary2021-06-20
| | | | | | | | | This fixes the following scenario: - Place a floating window so its border is right at the edge of the screen - Create a new split - The border disappears - Moving the window does not restore the border
* Only call workspace_auto_back_and_forth when neededLibravatar Ragnar Groot Koerkamp2021-06-18
| | | | | | Instead of disabling it for some workspace subcommands, this explicitly calls it only in the 2 places it's actually needed: for switching to a named or numbered workspace.
* Move auto_back_and_forth logic out of workspace_switchLibravatar Ragnar Groot Koerkamp2021-06-18
| | | | | | | | This extracts the code to a separate workspace_auto_back_and_forth function. It also removes the bool argument by adding an extra if statement at the call site, and repurposes the no_auto_back_and_forth variable to auto_back_and_forth for simpler understanding.
* Fix #6299 Disable auto_back_and_forth for next_on_outputLibravatar Ragnar Groot Koerkamp2021-06-18
| | | | | | | | | | | | | | This forces no_auto_back_and_forth to true for `workspace next_on_output` and `workspace prev_on_output` to keep parity with i3. In i3, running next_on_output never changes focus to another output. In Sway currently, with workspace_auto_back_and_forth set to yet, running next_on_output on an output with only a single active workspace will typically end up focussing the other output: 1. next_on_output focusses the current workspace, because it's the only one 2. auto_back_and_forth focusses the last focussed workspace, because the current workspace to focus is the current one. This will usually be on the other monitor if the workspace there was last focussed.
* fix typo in sway-output.5.scdLibravatar Rahiel Kasim2021-06-13
|
* sway: restore SIGPIPE handler before exec:ing swaybarLibravatar Daniel Eklöf2021-06-05
| | | | | | | | | | | | Sway ignores SIGPIPE (by installing a SIG_IGN handler), in order to “prevent IPC from crashing Sway”. SIG_IGN handlers are the *only* signal handlers inherited in sub-processes. As such, we should be a good citizen and restore the SIGPIPE handler to its default handler. Original bug report: https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1806907.html
* sway: commands: exec: restore SIGPIPE before exec:ingLibravatar Daniel Eklöf2021-06-05
| | | | | | | | | | | | Sway ignores SIGPIPE (by installing a SIG_IGN handler), in order to “prevent IPC from crashing Sway”. SIG_IGN handlers are the *only* signal handlers inherited in sub-processes. As such, we should be a good citizen and restore the SIGPIPE handler to its default handler. Original bug report: https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1806907.html
* config: Fix swaybar pango_markup inconsistencyLibravatar Daniel Otero2021-06-03
| | | | | | Until now, swaybar did not have pango markup enabled by default, even if the sway config had it on. This patch aims to mimic the i3 behavior, but maintaining the functionality of the "pango_markup" sway config command.
* Only defer seat attachment during initial startupLibravatar Bill Doyle2021-06-03
| | | | | | | | | Deferred commands are only run once, during sway startup. This means that deferring seat attachment based on whether we are reading the config prevents devices from being reattached to the correct seat during a config reload. Instead, only defer if the config is not yet active. Fixes #6048.
* Iterate over subsurfaces below the parent surfaceLibravatar Simon Ser2021-06-03
| | | | | | Update for the breaking change in [1]. [1]: https://github.com/swaywm/wlroots/pull/2948
* Implement xdg-activation-v1Libravatar Simon Ser2021-06-02
| | | | See https://github.com/swaywm/wlroots/pull/2718.
* remove usage of `wlr_texture_get_size`Libravatar Tobias Langendorf2021-05-17
| | | | update for wlroots 6369f7093178f0d66414eb67c312a403bfbb84a4
* view: commit transactions for foreign toplevel requestsLibravatar Ronan Pigott2021-05-17
|
* commands/exec: stop truncating >4095-byte commandsLibravatar Manuel Stoeckl2021-05-10
|
* cmd_fullscreen: ignore fullscreen request on workspacesLibravatar Ronan Pigott2021-05-10
|
* cairo: Replace <cairo/cairo.h> by <cairo.h>Libravatar Issam E. Maghni2021-05-10
| | | | | | | For full context, read https://gitlab.freedesktop.org/cairo/cairo/-/issues/479 TL;DR, cairo’s pc file adds `/cairo` to CFLAGS. So namespace cairo shouldn’t be used.
* Add tab dragging functionalityLibravatar tomKPZ2021-05-06
| | | | | | | | | | | Implements functionality described in [1]. Please see the issue for a video with a demonstration of the new behavior. An issue is that titlebars cover up a significant portion of the top edge drop area. The solution is simply to change the edge drop area hitbox to start at the contents instead of the container. [1] https://github.com/swaywm/sway/issues/6218
* Added scroll_factor input variable to ipc outputLibravatar Erik Reider2021-05-05
|
* main: removed vc4 detection code.Libravatar Bartłomiej Burdukiewicz2021-04-29
| | | Signed-off-by: Bartłomiej Burdukiewicz <bartlomiej.burdukiewicz@gmail.com>
* view: handle case where map_ws is NULLLibravatar Rouven Czerwinski2021-04-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* xdg-shell: ignore unecessary fullscreen request ouput hintsLibravatar Ronan Pigott2021-04-26
|
* workspace: reap empty parents when adding tilesLibravatar Ronan Pigott2021-04-26
|
* Remove support for arbitrary rotationsLibravatar Simon Ser2021-04-26
| | | | | | | There was some unused code-paths for rendering surfaces with an arbitrary rotation applied. This was imported from rootston. Since we don't have plans to make use of this, remove it.
* desktop/render: Pass explicit clip box to renderLibravatar Kenny Levinsen2021-04-26
| | | | | | | | | | | | | render_surface_iterator previously deduced the clip box from an optional container passed with render data. This causes problems when offsets in view geometry need to be compensated for in the clip dimensions. Instead, prepare the clip box in render_view_toplevels where the offsets are being applied, and compensate for them immediately. A similar compensation is applied to render_saved_view. Closes: https://github.com/swaywm/sway/issues/6223
* Remove usage of surface->sx|syLibravatar Kenny Levinsen2021-04-26
| | | | | | | | | | | | | | | These coordinates contain the all-time accumulated buffer attach point, which is a way to perform incremental client-side initiated movement of windows, intended as a way to maintain logical window positioning while compensating for layout changes such as folding in a left side panel. This value is not useful for implementing this feature, and break things if they ever become non-zero. Their inclusion in calculations also tend to cause confusion. Remove usage of these coordinates, removing the ability for clients to move themselves. This may again be supported if a better API is made available from wlroots.
* tree/view: don't give focus to views mapped under fullscreen viewsLibravatar Tudor Brindus2021-04-25
| | | | Fixes #6211.
* view_destroy: fix use-after-free with subsurface_destroyLibravatar Dominique Martinet2021-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remove view from its own unmap event listener so when subsurfaces link try to remove themselves they won't run into it. This fixes the following ASAN use-after-free error on a build slightly modified to instrument wl_list operations: ==71705==ERROR: AddressSanitizer: heap-use-after-free on address 0x6160000829a0 at pc 0x000000508eb7 bp 0x7ffec8fd8030 sp 0x7ffec8fd8028 WRITE of size 8 at 0x6160000829a0 thread T0 #0 0x508eb6 in wl_list_remove ../common/list.c:181 #1 0x4f4998 in view_child_destroy ../sway/tree/view.c:1131 #2 0x4f38fa in subsurface_handle_destroy ../sway/tree/view.c:946 #3 0x7fda50744892 in wlr_signal_emit_safe ../util/signal.c:29 #4 0x7fda5072f0dd in subsurface_destroy ../types/wlr_surface.c:649 #5 0x7fda507312c4 in subsurface_handle_surface_destroy ../types/wlr_surface.c:1094 #6 0x7fda50744892 in wlr_signal_emit_safe ../util/signal.c:29 #7 0x7fda5072f305 in surface_handle_resource_destroy ../types/wlr_surface.c:677 #8 0x7fda508180ce in destroy_resource (/lib64/libwayland-server.so.0+0xc0ce) #9 0x7fda508187f2 in wl_client_destroy (/lib64/libwayland-server.so.0+0xc7f2) #10 0x7fda50818e5f in wl_client_connection_data (/lib64/libwayland-server.so.0+0xce5f) #11 0x7fda50818219 in wl_event_loop_dispatch (/lib64/libwayland-server.so.0+0xc219) #12 0x7fda50818984 in wl_display_run (/lib64/libwayland-server.so.0+0xc984) #13 0x43122c in server_run ../sway/server.c:254 #14 0x42f47c in main ../sway/main.c:433 #15 0x7fda503cab74 in __libc_start_main (/lib64/libc.so.6+0x27b74) #16 0x40f6fd in _start (/opt/wayland/bin/sway+0x40f6fd) 0x6160000829a0 is located 288 bytes inside of 592-byte region [0x616000082880,0x616000082ad0) freed by thread T0 here: #0 0x7fda50f01a27 in free (/lib64/libasan.so.6+0xaea27) #1 0x4532d8 in destroy ../sway/desktop/xdg_shell.c:262 #2 0x4ed17b in view_destroy ../sway/tree/view.c:67 #3 0x4ed300 in view_begin_destroy ../sway/tree/view.c:83 #4 0x454a3f in handle_destroy ../sway/desktop/xdg_shell.c:507 #5 0x7fda50744892 in wlr_signal_emit_safe ../util/signal.c:29 #6 0x7fda506e2c87 in reset_xdg_surface ../types/xdg_shell/wlr_xdg_surface.c:481 #7 0x7fda506e3018 in destroy_xdg_surface ../types/xdg_shell/wlr_xdg_surface.c:516 #8 0x7fda506dfbe5 in xdg_client_handle_resource_destroy ../types/xdg_shell/wlr_xdg_shell.c:71 #9 0x7fda508180ce in destroy_resource (/lib64/libwayland-server.so.0+0xc0ce) previously allocated by thread T0 here: #0 0x7fda50f01ed7 in calloc (/lib64/libasan.so.6+0xaeed7) #1 0x454bc8 in handle_xdg_shell_surface ../sway/desktop/xdg_shell.c:528 #2 0x7fda50744892 in wlr_signal_emit_safe ../util/signal.c:29 #3 0x7fda506e2363 in handle_xdg_surface_commit ../types/xdg_shell/wlr_xdg_surface.c:378 #4 0x7fda5072e368 in surface_commit_state ../types/wlr_surface.c:455 #5 0x7fda5072e51d in surface_commit_pending ../types/wlr_surface.c:474 #6 0x7fda5072ea58 in surface_commit ../types/wlr_surface.c:542 #7 0x7fda4fb3ac03 in ffi_call_unix64 (/lib64/libffi.so.6+0x6c03) Fixes #5168
* commands/exec_always: log error on execlp failureLibravatar Simon Ser2021-04-22
| | | | And exit(1) instead of indicating success.
* Use execlp("sh") instead of execl("/bin/sh")Libravatar Simon Ser2021-04-22
| | | | This stops assuming the POSIX shell command is located in /bin.
* Avoid creating zero-sized textures for marksLibravatar Simon Ser2021-04-20
| | | | | Same as 6327f1b36196 ("Avoid creating zero-sized textures for titlebars") but for marks.
* Use cairo_image_surface_get_stride instead of guessing itLibravatar Simon Ser2021-04-20
|
* Avoid creating zero-sized textures for titlebarsLibravatar Simon Ser2021-04-20
| | | | Creating a zero-sized wlr_texture is incorrect.
* Prevent use-after-free on first bar subcommand errorLibravatar Michael Weiser2021-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If any error is encountered during execution of the first subcommand of a freshly created bar configuration, parsing apparently is to be aborted and the current bar config is freed. The pointer to that memory is left dangling though, leading to a use-after-free on successive bar subcommands. This quite reliably ends in a crash like so: sway -c reproducer.config 00:00:00.083 [sway/config.c:865] Error on line 2 'foo bar': Unknown/invalid command 'foo' (s) free(): double free detected in tcache 2 00:00:00.608 [swaynag/swaynag.c:451] failed to register with the wayland display Aborted (core dumped) Minimal reproducer config: bar { foo bar position top } Other messages: malloc(): unaligned fastbin chunk detected double free or corruption (fasttop) The invalid command has to be the first for a newly created bar config. Removing the command or switching order so it's not the first one masks the problem. Prevent this from occuring by resetting the pointer to NULL after freeing the memory. Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
* cmd_fullscreen: allow fullscreen on fullscreen split containersLibravatar Ronan Pigott2021-04-16
| | | | | | Using the fullscreen command on a child of a fullscreen split container will now fullscreen the child instead of unfullscreening the parent.
* container: don't set fullscreen on childrenLibravatar ash lea2021-04-15
| | | | | | the original behavior set fullscreen for all descendents of a container, which causes issues when firefox is one of those children because it sends its own set_fullscreen request in response to being fullscreened.
* desktop/layer_shell: fix centering for opposing anchorsLibravatar fwsmit2021-04-12
|
* desktop/layer_shell.c: Fix misspelled "exclusive"Libravatar Elyes HAOUAS2021-04-12
| | | | Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
* Log wlroots version on startupLibravatar Simon Ser2021-04-12
| | | | | | Can be useful to make sure a bugfix is included. In the future maybe the wlroots version string could include a commit hash when built from source, too.
* container: retain focus position on floating enableLibravatar Ronan Pigott2021-04-11
| | | | | | When a tiling container is floated, the focus stack needs to be appropraitely modified to return the container to its original position in the tree upon floating disable, like i3.