aboutsummaryrefslogtreecommitdiff
path: root/sway
AgeCommit message (Collapse)Author
2021-09-03command: implement split noneRonan Pigott
2021-09-02seatop_down: End if surface is destroyed or other seatop startsSimon Plakolb
If the surface the pointer started to interact with is destroyed we also want the seatop_down to end. In case a drag is initiated we receive a call to handle_end.
2021-09-02input: Use seatop_down on layer surface clickSimon Plakolb
This solves an issue where layer-shell items would not receive a button release event when the pointer left them while being pressed. The default seatop changes focus immediately while seatop_down defers any focus changes until the pointer is released or seatop_down is destroyed.
2021-08-31Add `output modeline` commandDavid Rosca
Only works with DRM backend.
2021-08-28desktop/xwayland: restack surface upon activationTudor Brindus
This commit updates Sway for swaywm/wlroots#2915.
2021-08-27Deduplicate code for rendering titlebar textsHugo Osvaldo Barrera
The title itself and marks were being rendered by two very-similar yet different functions, and any changes made to one had to be reflected on the other. This mostly prevents such oversights from happening, and keeps makes sure we keep both consistent.
2021-08-26Use fixed titlebar heightsHugo Osvaldo Barrera
Use fixed titlebar heights. The default height is calculated based on font metrics for the configured font and current locale. Some testing with titles with emoji and CJK characters (which are substantially higher in my setup) shows that the titlebars retain their initial value, text does shift up or down, and all titlebars always remain aligned. Also drop some also now-unecessary title_height calculations. Makes also needed to be updated, since they should be positioned with the same rules.
2021-08-19Update Pango font description URL in sway.5.scdgrumpey
Along with f4cda51 fixes #6217.
2021-08-16Fix typo in sway.5.scdquinno
small typo fix (ptt => ppt)
2021-08-14layer-shell: replace close() with destroy()Simon Ser
Update for the wlroots breaking change in [1]. [1]: https://github.com/swaywm/wlroots/pull/3108
2021-08-14cmd_bind_or_unbind_switch: fix copy/paste typo error messageEric Engestrom
`[0]` is the switch type, not its state; we want `[1]` for that, and it's a string not an int :)
2021-08-12Fallback to other output modes if preferred mode failsSimon Ser
Sometimes the preferred mode is not available due to hardware constraints (e.g. GPU or cable bandwidth limitations). In these cases it's better to fallback to lower modes than to end up with a black screen.
2021-08-12layer_shell: damage previous area when a surface shrinksRonan Pigott
When a layer surface shrinks we need to damage the area it previously occupied, but we don't know the location of all its subsurfaces in the previous state, so instead damage a rectangle that encloses the entire previous extent.
2021-08-12xdg-decoration: let floating clients set bordersDudemanguy
The xdg-decoration protocol allows clients to request whether they want to use server side decorations or client side decorations. Currently, sway ignores this and always enforces whatever the server is currently set to. Although tiled clients cannot be allowed to set borders, there is no harm in listening requests from floating clients. Sidenote: also fix an unrelated style error.
2021-08-05seatop_down: Change type of sx, sy to double in begin_seatop_downDavid Rosca
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
2021-08-04man: update Pango font description URLfrogtile
The old URL gives a 404.
2021-07-26Fix wl_pointer.frame not sent on touch emulationSimon Ser
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.
2021-07-23Fix crash when starting without HOMETobias Stoeckmann
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>
2021-07-22Add `gaps <type> <scope> toggle <px>` commandbR3iN
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
2021-07-08Add support for touch frame eventsSimon Ser
Update for the breaking change in [1]. [1]: https://github.com/swaywm/wlroots/pull/3001
2021-07-07Update wlr_box includesSimon Ser
Update for the breaking change in [1]. [1]: https://github.com/swaywm/wlroots/pull/3011
2021-07-06container: ignore borders in fullscreen windowsDudemanguy
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.
2021-07-05tree/container: fix indentationSimon Ser
2021-06-23input: Move get_current_time_msec in from utilKenny Levinsen
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.
2021-06-22Revert "Add workspace {prev,next}_on_output --create"Ragnar Groot Koerkamp
This reverts commit 487c83f0de9ca2a7650ad636eed6fd694ddcb82e. The --create flag is undocumented, not in i3, and at least partially broken (#5913), so this removes the feature.
2021-06-20Don't apply hide_edge_borders to any floating containernovenary
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
2021-06-18Only call workspace_auto_back_and_forth when neededRagnar Groot Koerkamp
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.
2021-06-18Move auto_back_and_forth logic out of workspace_switchRagnar Groot Koerkamp
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.
2021-06-18Fix #6299 Disable auto_back_and_forth for next_on_outputRagnar Groot Koerkamp
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.
2021-06-13fix typo in sway-output.5.scdRahiel Kasim
2021-06-05sway: restore SIGPIPE handler before exec:ing swaybarDaniel Eklöf
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
2021-06-05sway: commands: exec: restore SIGPIPE before exec:ingDaniel Eklöf
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
2021-06-03config: Fix swaybar pango_markup inconsistencyDaniel Otero
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.
2021-06-03Only defer seat attachment during initial startupBill Doyle
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.
2021-06-03Iterate over subsurfaces below the parent surfaceSimon Ser
Update for the breaking change in [1]. [1]: https://github.com/swaywm/wlroots/pull/2948
2021-06-02Implement xdg-activation-v1Simon Ser
See https://github.com/swaywm/wlroots/pull/2718.
2021-05-17remove usage of `wlr_texture_get_size`Tobias Langendorf
update for wlroots 6369f7093178f0d66414eb67c312a403bfbb84a4
2021-05-17view: commit transactions for foreign toplevel requestsRonan Pigott
2021-05-10commands/exec: stop truncating >4095-byte commandsManuel Stoeckl
2021-05-10cmd_fullscreen: ignore fullscreen request on workspacesRonan Pigott
2021-05-10cairo: Replace <cairo/cairo.h> by <cairo.h>Issam E. Maghni
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.
2021-05-06Add tab dragging functionalitytomKPZ
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
2021-05-05Added scroll_factor input variable to ipc outputErik Reider
2021-04-29main: removed vc4 detection code.Bartłomiej Burdukiewicz
Signed-off-by: Bartłomiej Burdukiewicz <bartlomiej.burdukiewicz@gmail.com>
2021-04-29view: handle case where map_ws is NULLRouven Czerwinski
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-26xdg-shell: ignore unecessary fullscreen request ouput hintsRonan Pigott
2021-04-26workspace: reap empty parents when adding tilesRonan Pigott
2021-04-26Remove support for arbitrary rotationsSimon Ser
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.
2021-04-26desktop/render: Pass explicit clip box to renderKenny Levinsen
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
2021-04-26Remove usage of surface->sx|syKenny Levinsen
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.