aboutsummaryrefslogtreecommitdiff
path: root/sway
AgeCommit message (Collapse)Author
2021-02-09view: Save surface x and y on saved buffersKenny Levinsen
We need to use surface_x and surface_y when rendering and damaging saved buffers as these compensate for views that have been centered due to being smaller than their container. Add them to the surface positions on the saved buffer so we have the values from the time the buffer was saved.
2021-02-04Make command line option lists constManuel Stoeckl
2021-02-04Declare all struct cmd_handler arrays constManuel Stoeckl
And make the functions handling these arrays use const types.
2021-02-02xdg-foreign: add v1 and v2 implementationsAleksei Bavshin
Co-authored-by: Jason Francis <cycl0ps@tuta.io>
2021-01-30Check the output state for recorded workspacesKonstantin Pospelov
Sway records pid, workspace, and output for every new process. However, if the output gets disabled and the workspace disappears, the workspace is still re-created on the disabled output. This commit adds a check for the enabled flag, so that NULL will be passed to workspace_create() in this case.
2021-01-30desktop/layer_shell: Fix allocation type mismatchManuel Stoeckl
2021-01-26desktop/output: Disable head if mode is NULLKenny Levinsen
wlr_output_configuration_head_v1_create normally fills out the head "enabled" field to match the wlr_output state. We overwrite this to also set the head as enabled if it is only turned off with DPMS. However, in some cases we may not have a mode for this display, in which case setting it as enabled will lead to a segfault later on. Therefore, enabled conditional on the presence of a mode.
2021-01-25Implement foreign toplevel fullscreen output hintsfwsmit
2021-01-20Adhere to ICCCM focus specificationBrassyPanache
For certain applications (e.g. JetBrains) the parent window controls input. We need to adhere to the ICCCM input focus specification to properly handle these cases. Relates to swaywm/wlroots#2604
2021-01-17Log when config file is not foundSimon Ser
This happens when Sway is not installed on the system, so there's no default config in /etc.
2021-01-17Raise verbosity of error message in load_main_configSimon Ser
2021-01-16Changed fprintf(stdout,...) to printf(...) for more readable codeSpizzyCoder
2021-01-15config/output: correct refresh rate rounding errorRonan Pigott
2021-01-12Rename output_layer_for_each_surface_{toplevel,popup}Simon Ser
Swap the "surface" part for consistency with wlroots' naming.
2021-01-12Switch to wlr_xdg_surface_for_each_popup_surfaceSimon Ser
Instead of calling wlr_xdg_surface_for_each_popup and then wlr_surface_for_each_surface, use the new for_each_popup_surface helper introduced in [1] that does it in one go. [1]: https://github.com/swaywm/wlroots/pull/2609
2021-01-08desktop/xwayland: use index constants for atom arraySimon Ser
This ensures we don't swap two atoms by mistake.
2021-01-08man: update maintainerSimon Ser
Also remove the AUTHORS section from swaybar-protocol(7), for consistency with the rest of the man pages.
2021-01-04cmd_move: update container representation in sibling swapsRonan Pigott
2021-01-01input/seat: Reset command handler context in seat_destroy()Andri Yngvason
This fixes a dangling reference which causes a use-after-free.
2021-01-01input/seat: Clean up focus_stack in seat_destroy()Andri Yngvason
This fixes use-after-free when seat_destroy() has been called.
2021-01-01input: Clean up input_method_relay in seat_destoy()Andri Yngvason
This fixes a crash that happens when input_method_new or text_method_new events are emitted after the seat has been freed.
2020-12-30Remove create_renderer_func argumentSimon Ser
It's removed upstream [1]. [1]: https://github.com/swaywm/wlroots/pull/2561
2020-12-24container: set fullscreen mode before attempting focusRonan Pigott
2020-12-20workspace: rework workspace prev|next like i3Ronan Pigott
Changes workspace prev|next commands to visit each numbered or named workspace first before considering workspace from the other category
2020-12-20commands/move: reset geometry of promoted containersRonan Pigott
2020-12-20commands/move: squash workspace after directional con moveRonan Pigott
2020-12-20introduce workspace_squashRonan Pigott
workspace_squash is container_flatten in the reverse direction. Instead of eliminating redundant splits that are parents of the target container, it eliminates pairs of redundant H/V splits that are children of the workspace. Splits are redundant if a con and its grandchild have the same layout, and the immediate child has the opposite split. For example, layouts are transformed like: H[V[H[app1 app2]] app3] -> H[app1 app2 app3] i3 uses this operation to simplify the tree after moving heavily nested containers to a higher level in the tree via an orthogonal move.
2020-12-20commands/move: rework container_move_in_directionRonan Pigott
This changes the move command to better match i3 behavior after the layout changes. workspace_rejigger handled the case where containers would escape their workspace in an orthogonal move by changing the layout to accomodate them, but this case is now handled within the loop.
2020-12-20Change workspace_layout to match i3 behaviorRonan Pigott
In i3, the workspace_layout command does not affect the workspace layout. Instead, new workspace level containers are wrapped in the desired layout and the workspace layout always defaults to the output orientation.
2020-12-20Revert "commands/move: maintain workspace_layout when moving"Ronan Pigott
This is in preparation for changing the workspace_layout command to work like it does in i3. This reverts commit b4a75a1ab2a72842830aeea37733311f85e6f660.
2020-12-20commands/move: don't flatten on move; reap empty former parent insteadTudor Brindus
Some comparisons of current Sway versus i3 behavior: 1) T[T[T[app]]] + move left * Sway: T[app] * i3: T[T[app]] 2) H[V[H[V[app]]]] + move left * Sway: H[app] * i3: H[V[app]] After this commit, Sway behavior matches i3. The intermediate states are now: T[T[T[app]]] -> T[T[app T[]]] -> T[T[app]] H[V[H[V[app]]]] -> H[V[app H[V[]]]] -> H[V[app]]
2020-12-20commands/layout: don't change the layout of workspaces with childrenRonan Pigott
In i3 the layout command on a workspace affects the workspace layout only on empty workspaces. Otherwise children are placed in a new container with the desired layout to preserve the workspace layout.
2020-12-20container: don't split single childrenRonan Pigott
In i3 splits are ineffective on singleton H/V containers, and the command is interpreted to affect the parent layout instead.
2020-12-20Test output before direct scan-outSimon Ser
This avoids some log spam. Eventually when we wire up the atomic test commit this will take care of the other log spam referenced below. References: https://github.com/swaywm/sway/pull/5010 References: https://github.com/swaywm/wlroots/issues/2181 Closes: https://github.com/swaywm/wlroots/issues/2532
2020-12-09Route wlroots logs into Sway logging infrastructureSimon Ser
Instead of letting wlroots print messages to stdout, route debugging messages into Sway's logging functions. This allows a more consistent output (e.g. if Sway or wlroots changes its output style, they don't get out-of-sync). I also added a [wlr] prefix to wlroots messages, not yet sure it's a good thing.
2020-12-08Handle secondary headless backend failuresSimon Ser
2020-12-08Drop gtk-primary-selection supportIsaac Freund
2020-12-07Add layer shell subsurfacesVlad Pănăzan
Damage subsurfaces created by layer surfaces on map, unmap and commit. This fixes the flicker of Gtk Popovers. Fixes #5617
2020-12-06input/cursor: unhide cursor on synthetic inputTudor Brindus
Fixes #5847.
2020-12-04criteria: fix crash when comparing NULL propertiesPaul Riou
For each following combinations of criteria & command below, the command would crash sway without the fix. It's particular about the __focused__ criteria, where the view matches part of the criteria but not the focused app, leading to a failure when calling `strcmp` with NULL. "xterm" is a non-wayland app (X11) and "kitty" is. Both are terminals. # "class" is specific to X11 # The view is X11 (xterm) leading to the criteria checking for the # focused app's class, leading to a crash for_window [class="__focused__"] floating enable exec kitty -e xterm # Similarly, crash as the focused app (xterm) has no app_id when the view has one for_window [app_id="__focused__"] floating enable exec xterm -e kitty # If the view has a title but not the focused app: NULL title will crash criteria checking for_window [title="__focused__"] floating enable exec xterm -title "" -e xterm
2020-11-24xdg_shell: allow views to change geometry anytimeRonan Pigott
Currently, when sway sends a configure with some geometry and the client responds with a different geometry in a commit that acks that configure, sway ignores the new size. Sway applies the surface geometry it had requested to the container, not what was actually committed, in the following transaction. This change allows any client commit to change its surface geometry, even if it is a response to a configure event.
2020-11-21document parse_errorRex Hackbro
2020-11-16Log which output is using direct scan-outSimon Ser
2020-11-12input/keyboard: fix Group# bindings for keyboard groupsBrian Ashworth
The keyboard group's effective keyboard layout was never being changed due to a condition that incorrectly preventing it from being performed. The IPC event that follows the change was correctly being prevented.
2020-11-11tree/container: introduce `container_is_sticky[_or_child]` functionsTudor Brindus
To query whether a container is sticky, checking `con->is_sticky` is insufficient. `container_is_floating_or_child` must also return true; this led to a lot of repetition. This commit introduces `container_is_sticky[_or_child]` functions, and switches all stickiness checks to use them. (Including ones where the container is already known to be floating, for consistency.)
2020-11-11Add missing includes for wlr_input_device.hSimon Ser
References: https://github.com/swaywm/wlroots/pull/2470
2020-11-11Replace wlr_key_state with wl_keyboard_key_stateSimon Ser
References: https://github.com/swaywm/wlroots/pull/2446
2020-11-05input/seatop_default: consider fullscreen views to have no edgesTudor Brindus
Previously, `find_edge` on a single fullscreen view would occasionally return an edge rather than `WLR_EDGE_NONE`. This would trigger entry into `seatop_resize_tiling`, which doesn't have meaning for a fullscreen view. The result was that the fullscreen container hitbox was considered to be that of where it'd be if it were tiling, so most clicks would not go through. Fixes #5792.
2020-11-01input: fully change focus when scrolling tabs/stacksTudor Brindus
When scrolling on a tabbed/stacked container, i3 focuses its inactive-focused focused child. Sway does the same, but then resets the focus to whatever was focused previously. Ref https://github.com/i3/i3/blob/e5992eed163179f5cd2715c2c212d3d757f04b31/src/click.c#L207-L219
2020-11-01commands/focus: force container warp when fulfilling `focus mode_toggle`Tudor Brindus
This commit switches focusing behavior to force a warp when executing `focus mode_toggle`. Fixes #5772.