aboutsummaryrefslogtreecommitdiff
path: root/sway
AgeCommit message (Collapse)Author
2020-01-20Add documentation for floating_modifierAlex Maese
2020-01-20Add ability to remove the floating modifierAlex Maese
2020-01-18Check argc>0 before strcasecmp. Should shortcircuitJason Nader
2020-01-18commands/move: Fix crash when required args not providedJason Nader
Fixes #4919.
2020-01-16output: apply oc to outputs using wl_for_each_safeBrian Ashworth
If applying an output config to an output fails, the output may be destroyed. To be able to handle this situation correctly, apply_output_config_to_outputs needs to use wl_list_for_each_safe.
2020-01-16cmd_split: Refuse to split scratchpad hidden split containersRonan Pigott
2020-01-16cmd_move: Fix crash when moving to scratchpad hidden split containersRonan Pigott
2020-01-16Fix crash when showing scratchpad hidden split containersRonan Pigott
2020-01-16desktop/output: fix mem leak in handle_new_outputBrian Ashworth
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.
2020-01-16sway.5: Document missing bindsym flags for unbindsymRonan Pigott
sway.5: Remove indents within long command descriptions
2020-01-16sway-input.5: Document repeat_delay and repeat_rate only onceRonan Pigott
2020-01-16ipc-json: Remove unnecessary dereferenceRonan Pigott
2020-01-16commands/split: Fix error message typosRonan Pigott
2020-01-14container: add inactive fullscreen to focus stackBrian Ashworth
When a container was being made fullscreen and it is on the focused workspace for a seat, focus was being set to the container. However, when the container was on a non-focused workspace, the focus stack wasn't being touched. When assigning a fullscreen container to a workspace or moving a fullscreen container to a different workspace, this would make it so the fullscreen container was never added to the focus stack for the workspace thus preventing access to the workspace. This adds the container to the top of the focus stack, behind the container on the focused workspace.
2020-01-13Fix unreliable scaling filterSimon Ser
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
2020-01-10integer scaling, not integralCassandra McCarthy
2020-01-09view: remove workspace pid mapping for assignsBrian Ashworth
If a view is mapped to a workspace using an assign, the pid should still be removed from the pid mapping list. This prevents child processes from matching against it and mapping a view to a likely undesired workspace.
2020-01-06input/cursor: handle setting a NULL image surfaceBrian Ashworth
This fixes a crash when attempting to listen to a signal on a NULL cursor image surface. If the surface is NULL, the listener is just reinitialized using wl_list_init.
2020-01-05input/cursor: handle image surface destroyBrian Ashworth
This adds a listener for the destroy event of the cursor image surface. This prevents a use-after-free when the last visible image surface is freed, there has not been a new cursor set, and the cursor is reshown.
2020-01-05render: do not render indicator on floating viewsBrian Ashworth
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.
2020-01-05Fix small typo in sway-input(5)Ross Schulman
2020-01-05Add missing items to documentation for GET_TREE response in ipc.Thayne McCombs
A few items in the response for the get_tree ipc call were missing from the documentation. This adds some documentation for them.
2020-01-03xwayland: handle size_hints == NULLRouven Czerwinski
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
2020-01-01input: Assign virtual input devices to their selected seatsAndri Yngvason
2020-01-01Make sure we don't calculate fractional pixel gapsPedro Côrte-Real
When gaps are resized for lack of space the calculation could result in a gap size of non-integer pixels. This would result in containers located at non-integer pixels which would be subtly broken.
2020-01-01Avoid numerical instability in resizePedro Côrte-Real
Because the layout code rounds down the dimensions of the windows resizing would often be off by one pixel. The width/height fraction would not exactly reflect the final computed width and so the resize code would end up calculating things wrong. To fix this first snap the container size fractions to the pixel grid and only then do the resize. Also use round() instead of floor() during layout to avoid a slightly too small width. This applies in two cases: 1. For the container we are actually resizing using floor() might result in being 1px too small. 2. For the other containers it might result in resizing them down by 1px and then if the container being resized is the last all those extra pixels would make the resize too large. Fixes #4391
2019-12-31Add virtual pointer protocolJosef Gajdusek
2019-12-31Fix sway_log using non initialised output_config pointerPaul Riou
This fixes a crash where the `oc->name` would be accessed by sway_log() even when `oc` was NULL.
2019-12-30Re-add support for wlr_output's atomic APISimon Ser
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)
2019-12-29cmd_client_*: support optional args for i3 compatBrian Ashworth
For i3 compatibility, allow the indicator and child_border colors values to be optional. The indicator will fallback to sane defaults and child_border will fallback to the background color for the class.
2019-12-28bar_cmd_colors: remove add_colorBrian Ashworth
This is the third commit in a series of commits to refactor color handling in sway. This removes add_color from commands.c. It was only being used by bar_cmd_colors. This also changes the functions to use parse_color which is used to validate rgb(a) colors throughout the code base and is also what i3bar is using to parse the colors after they are passed over ipc. After parsing the color and ensuring it is valid, the rgba hex string is then generated using snprintf. This refactor also ensures that all the colors for the command are valid before applying any of them.
2019-12-28cmd_client_*: refactor duplicated codeBrian Ashworth
This is the second in a series of commits to refactor the color handling in sway. This removes the duplicated color parsing code in sway/commands/client.c. Additionally, this combines the parsing of colors to float arrays with that in sway/config.c and introduces a color_to_rgba function in commom/util.c. As an added bonus, this also makes it so non of the colors in a border color class will be changed unless all of the colors specified are valid. This ensures that an invalid command does not get partially applied.
2019-12-27layer-shell: refocus if keyboard interactive lostBrian Ashworth
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.
2019-12-27config/output: apply scale_filter even when scale has not changedRonan Pigott
2019-12-24desktop/surface: Fix crash when timer is NULLManuel Stoeckl
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.)
2019-12-16seat_cmd_keyboard_grouping: change keymap to smartBrian Ashworth
This removes `seat <seat> keyboard_grouping keymap` and replaces it with `seat <seat> keyboard_grouping smart`. The smart keyboard grouping will group based on both the keymap and repeat info. The reasoning for this is that deciding what the repeat info should be for a group is either arbitrary or non-deterministic when multiple keyboards in the group have repeat info configured (unless somehow exposed to the user in a reproducible uniquely identifiable fashion).
2019-12-16input/seatop_default: fix focusing floating titlesBrian Ashworth
When clicking on the titlebar of a floating container (or descendant of a floating container), the top-level floating container was being focused and then allowing you to move the top-level floating container. This made it so you couldn't switch to a different tab/stack within the floating container. With this patch, the focus inactive view for the container that the titlebar is associated with is focused, then the traversal to the top-level floating container is performed to use with the move floating operation.
2019-12-16root_scratchpad_hide: disable fullscreen descendantsBrian Ashworth
Any descendant of a scratchpad container may be fullscreen so checking to see if the top-level scratchpad container is fullscreen in root_scratchpad_hide is not sufficient. This iterates through all descendants of the scratchpad container
2019-12-14config/input: set type for new identifier configsBrian Ashworth
When an input becomes available, the input type config for that device type will be merged underneath the input identifier config, provided they both exist. If an input type config gets added or modified at a later point, then those changes get merged onto the input identifier configs for that type. However there was a missing case of the input identifier config being added after the device is already available and the input type config existing. This makes it so that the first time an input identifier config gets stored, there will be a check to see if it matched any of the available devices. If it does, then there will be a search for the associated input type config, which will be merged underneath the input identifier config if found.
2019-12-13input/keyboard: defer wlr_keyboard_group destroyBrian Ashworth
This defers the destruction of wlr_keyboard_groups until idle. This is to prevent the keyboard group's keyboard from being destroyed in the middle of handling a keyboard event. This would occur when changing the keymap of the last keyboard in a group with a keyboard binding. The prevents crashing when attempting to update the xkb state of the keyboard group's keyboard. The sway_keyboard_group is still immediately destroyed so that the group is no longer used
2019-12-13input/keyboard: remove group listeners on destroyBrian Ashworth
This adds two missing calls to wl_list_remove to remove the key and modifier listeners for the keyboard group's keyboard when destroying the keyboard group. This fixes some crashes when changing the keymap of the last keyboard in a group with a keyboard binding.
2019-12-12Auto-detect output scaleSimon Ser
If the screen DPI is high enough, auto-enable scale=2 (if the user hasn't set the scale). Uses heuristics based on [1]. [1]: https://gitlab.gnome.org/GNOME/mutter/blob/05217066171992b0bc50882869aad6385285c878/src/backends/meta-monitor.c#L1590 Closes: https://github.com/swaywm/sway/issues/1800
2019-12-12Add seat <seat> idle_{inhibit,wake} <sources...>Drew DeVault
This adds seat configuration options which can be used to configure what events affect the idle behavior of sway. An example use-case is mobile devices: you would remove touch from the list of idle_wake events. This allows the phone to stay on while you're actively using it, but doesn't wake from idle on touch events while it's sleeping in your pocket.
2019-12-12Fix lingering workspace with scratchpad showRonan Pigott
Showing a window in the scratchpad can move a visible scratchpad window from another workspace to the current one. If the scratchpad window was the last visible container in that workspace, the old workspace should be destroyed.
2019-12-10layer-shell: unfocus output-less layer on unmapBrian Ashworth
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.
2019-12-07input/cursor: remove gesture listeners in destroyBenjamin Cheng
Part of #4794. Forgot to remove gesture listeners when the cursor is destroyed.
2019-12-07input/cursor: pass gesture events to clientsBenjamin Cheng
Some wayland clients (mostly GTK3 apps) like eog or evince support gestures like pinch-to-zoom. These gestures are given to clients via the pointer_gestures_v1 protocol. This is already supported in wlroots, so we just need to hook up the events here in sway. Fixes #4724
2019-12-04config: apply input type configs on reloadBrian Ashworth
When making the reload validation improvements, I forgot that input type configs are stored in a separate list. This makes it so input type configs are correctly applied on reload.
2019-12-02Revert "fix bar_state_update/input event"Jayce Fayne
This reverts commit a3da7fec32b8f18d7a70ea346618e09892c707ed.
2019-12-01fix bar_state_update/input eventRex Hackbro