aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config
Commit message (Collapse)AuthorAge
* output: Reconfigure xcursor when applying output configLibravatar Tadeo Kondrak2021-02-24
| | | | | | | | | | | | Before this commit, when an output had its scale dynamically changed, Sway would not load a cursor theme with the new scale. This results in stale cursor images when moving the cursor into an area controlled by the compositor, like the background or resize areas. To reproduce: - Using IPC, set an output scale to a value that isn't currently used - Move the cursor into a compositor-controlled area - The cursor will not change
* config/output: correct refresh rate rounding errorLibravatar Ronan Pigott2021-01-15
|
* hide_cursor: Add an option to hide when typingLibravatar Tamir Zahavi-Brunner2020-10-30
| | | | | Add an option for the `hide_cursor` command to hide the cursor when typing, i.e. whenever a key is pressed.
* input/tablet: add tool_mode option to set tablet tools as relative inputLibravatar Tudor Brindus2020-10-12
| | | | Closes #4139.
* Add support for workspace_min_width bar option.Libravatar Tarmack2020-10-11
|
* config/output: don't change output state before commitLibravatar Simon Ser2020-07-10
| | | | | | | | | | | | | | | | | | | | | | | Previously, we called output_disable prior to wlr_output_commit. This mutates Sway's output state before the output commit actually succeeds. This results in Sway's state getting out-of-sync with wlroots'. An alternative fix [1] was to revert the changes made by output_disable in case of failure. This is a little complicated. Instead, this patch makes it so Sway's internal state is never changed before a successful wlr_output commit. We had two output flags: enabled and configured. However enabled was set prior to the output becoming enabled, and was used to prevent the output event handlers (specifically, the mode handler) from calling apply_output_config again (infinite loop). Rename enabled to enabling and use it exclusively for this purpose. Rename configure to enabled, because that's what it really means. [1]: https://github.com/swaywm/sway/pull/5521 Closes: https://github.com/swaywm/sway/issues/5483
* input: disable events for map_to_output devices when output not presentLibravatar Tudor Brindus2020-06-19
| | | | Fixes #3449.
* Use new wlroots API for clearing keyboard/pointer focus during grabsLibravatar Thomas Hebb2020-06-05
| | | | | | | | | We are not allowed to do what we did in #5222 and pass a `NULL` surface wlr_seat_pointer_notify_enter(), and it's causing crashes when an xdg-shell popup is active (see #5294 and swaywm/wlroots#2161). Instead, solve #5220 using the new wlroots API introduced in swaywm/wlroots#2217.
* config/output: reconfigure input devices after full output initLibravatar Tudor Brindus2020-04-26
| | | | | | | | | | Previously in 3de1a39, it "worked by accident" in my testing since the display being used in `map_to_output` was initialized first (the map would not be applied because the display hadn't actually come online yet), and was followed by a second display (at which point the map would get applied for the first display). Refs #5231
* config/output: reconfigure input devices on new outputLibravatar Tudor Brindus2020-04-24
| | | | | | | | | | | | Some input rules, like `map_to_output`, are dependent on a specific screen being present. This currently does not work for hotplugged outputs, or outputs that are processed after the input device is initially probed. This commit fixes both cases, by reconfiguring inputs on each output addition. Fixes #5231.
* Don't add disabled outputs back to output layoutLibravatar Simon Ser2020-04-09
| | | | | | | Return early from apply_output_config if the output is disabled. This restores our previous behavior [1]. [1]: https://github.com/swaywm/sway/commit/0cdcf66bbccfeb1e3a8191cedd5f824bb27776a6#diff-4f65f4327e987fef8ec3796cdb07644eL349
* Fix initial modesetLibravatar Simon Ser2020-04-09
| | | | | | | | | | | | An if branch takes care of the case where the output needs to be turned off (DPMS'ed or disabled). The other branch needs to unconditionally enable the output. output->current_mode is already taken care of in apply_config. Sorry about that, probably made a bad change by mistake after my DRM testing. Closes: https://github.com/swaywm/sway/issues/5193
* Introduce test_output_configLibravatar Simon Ser2020-04-08
| | | | | This function checks whether the backend would accept an output configuration, without applying the changes.
* commands: Add shortcuts_inhibitor commandLibravatar Michael Weiser2020-03-11
| | | | | | | | | | | | | | | | | | | Add a command to influence keyboard shortcuts inhibitors. In its current form it can be used to activate, deactivate or toggle an existing inhibitor on the surface currently receiving input. This can be used to define an escape shortcut such as: bindsym --inhibited $mod+Escape seat - shortcuts_inhibitor deactivate It also allows the user to configure a per-seat default of whether keyboard inhibitors are honoured by default (the default) or not. Using the activate/toggle command they can then enable the lingering inhibitor at a later time of their choosing. As a side effect this allows to specifically address a named seat for actions as well, whatever use-case that might serve. Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
* Add an adaptive_sync output commandLibravatar Simon Ser2020-03-07
| | | | | | | | | This enables/disables adaptive synchronization on the output. For now, the default is disabled because it might cause flickering on some hardware if clients don't submit frames at regular enough intervals. In the future an "auto" option will only enable adaptive sync if a fullscreen client opts-in via a Wayland protocol.
* output: fix updating output manager configLibravatar Brian Ashworth2020-02-16
| | | | | | | | | | | | | | | | | | The output manager config is created when the output is created. It is updated when the mode, transform, scale, or layout for the output changes, as well as, when the output is destroyed. Since the output->enabled property was not being set before calling apply_output_config, the output event handlers were early returning and never updating the output manager config when the output state was committed. This fixes the issue by setting output->enabled in apply_output_config below the output disabling section. There are also a few other minor changes that are required to function. Additionally, this renames output_enable to output_configure to better describe the recent changes.
* Fix crash: use wlr_output->name instead of possibly missing oc->nameLibravatar Yorick van Pelt2020-02-13
| | | | | Fixes segfault on start: https://gist.github.com/yorickvP/89eccb3782c6edb22aeda6ce9c6d4fcb
* Apply the output scale filter after the output commitLibravatar Simon Ser2020-02-11
| | | | The smart output filter uses the current output scale.
* Stop calling apply_output_config from output_enableLibravatar Simon Ser2020-02-11
| | | | | | | | | | | | | | | | The only output_enable caller is now apply_output_config. Stop calling apply_output_config from output_enable to simplify the code and avoid the back-and-forth between these two functions. output_enable is now the symmetric of output_disable: it just marks the output as enabled and performs bookkeeping (e.g. creating teh default workspace). It is called from apply_output_config after the output commit, so that it can read the current output state and act accordingly. This change also allows us to avoid an extraneous wlr_output_commit. References: https://github.com/swaywm/sway/issues/4921
* Fix output scale auto-detectionLibravatar Simon Ser2020-02-11
| | | | Closes: https://github.com/swaywm/sway/issues/4960
* output: apply oc to outputs using wl_for_each_safeLibravatar Brian Ashworth2020-01-16
| | | | | | 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.
* Fix sway_log using non initialised output_config pointerLibravatar Paul Riou2019-12-31
| | | | | This fixes a crash where the `oc->name` would be accessed by sway_log() even when `oc` was NULL.
* 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)
* config/output: apply scale_filter even when scale has not changedLibravatar Ronan Pigott2019-12-27
|
* config/input: set type for new identifier configsLibravatar Brian Ashworth2019-12-14
| | | | | | | | | | | | | | 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.
* Auto-detect output scaleLibravatar Simon Ser2019-12-12
| | | | | | | | | | | 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
* Add seat <seat> idle_{inhibit,wake} <sources...>Libravatar Drew DeVault2019-12-12
| | | | | | | | | | 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.
* add scale_filter output config optionLibravatar Ronan Pigott2019-11-29
|
* Add support for wlr_keyboard_groupLibravatar Brian Ashworth2019-11-21
| | | | | | | | | | | | | | | | | A wlr_keyboard_group allows for multiple keyboard devices to be combined into one logical keyboard. This is useful for keyboards that are split into multiple input devices despite appearing as one physical keyboard in the user's mind. This adds support for wlr_keyboard_groups to sway. There are two keyboard groupings currently supported, which can be set on a per-seat basis. The first keyboard grouping is none, which disables all grouping and provides no functional change. The second is keymap, which groups the keyboard devices in the seat by their keymap. With this grouping, the effective layout and repeat info is also synced across keyboard devices in the seat. Device specific bindings will still be executed as normal, but everything else related to key and modifier events will be handled by the keyboard group's keyboard.
* output: add max_render_timeLibravatar Ivan Molodetskikh2019-11-17
|
* Use an enum instead of a marker string for map_to_Libravatar Tadeo Kondrak2019-11-17
|
* Implement input map_to_region commandLibravatar Tadeo Kondrak2019-11-17
|
* Use wlr_output_preferred_mode instead of the last modeLibravatar Simon Ser2019-11-05
| | | | | Instead of relying on the order of modes, use wlr_output_preferred_mode to get the preferred mode.
* Fix segfault in set_modeLibravatar Simon Ser2019-11-05
| | | | | | | best is NULL prior to being assigned to a mode. Closes: https://github.com/swaywm/sway/issues/4705 Fixes: f33dcd4c604f ("Prefer higher refresh rate default modes")
* Prefer higher refresh rate default modesLibravatar Ronan Pigott2019-11-05
|
* Add --custom to `output mode` commandLibravatar Simon Ser2019-11-04
| | | | This forces to set the mode as a custom mode.
* Rename symbol set_cloexec to sway_set_cloexec, remove duplicates.Libravatar Sheena Artrip2019-11-01
| | | | | | | | set_cloexec is defined by both sway and wlroots (and who-knows-else), so rename the sway one for supporting static linkage. We also remove the duplicate version of this in client/. Fixes: https://github.com/swaywm/sway/issues/4677
* Fix potential NULL reference on cleanupLibravatar lbonn2019-11-01
| | | | | | If allocation of bindings failed. Found with clang-tidy
* 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 apply_output_config return value when enabling outputLibravatar Simon Ser2019-10-27
| | | | | apply_output_config would call output_enable and always return true, even if the output couldn't be enabled.
* 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.
* swaybar: complete barconfig_update event handlingLibravatar Brian Ashworth2019-09-04
| | | | | | | | This adds complete support for the barconfig_update ipc event. This also changes the bar command and subcommand handlers to correctly emit the event. This makes it so all bar subcommands other than id and swaybar_command are dynamically changeable at runtime. sway-bar.5 has been updated accordingly
* Revert "Add support for wlr_output's atomic API"Libravatar Rouven Czerwinski2019-08-07
| | | | | | This reverts commit 6e0565e9de4247bbf0ca662565c58e0a54258d6e. This is required for the revert on swaywm/wlroots#1781
* config/output: rebase cursors after config appliedLibravatar Brian Ashworth2019-08-07
| | | | | | | When applying an output config, an output may transform or be altered in some way that effects the cursor. In order for the cursor images to be updated properly, all cursors need to be rebased after applying output configs.
* Allocator sizeof operand mismatchLibravatar Antonin Décimo2019-08-02
| | | | | Result of 'calloc' is converted to a pointer of type 'char *', which is incompatible with sizeof operand type 'char **'
* Add support for wlr_output's atomic APILibravatar Simon Ser2019-08-02
| | | | See https://github.com/swaywm/wlroots/pull/1762
* Implement input_cmd_xkb_file (#3999)Libravatar Ed Younis2019-07-17
| | | | | | | Adds a new commend "xkb_file", which constructs the internal xkb_keymap from a xkb file rather than an RMLVO configuration. This allows greater flexibility when specifying xkb configurations. An xkb file can be dumped with the xkbcomp program.
* config/output: correctly set width/height in applyLibravatar Brian Ashworth2019-07-10
| | | | | | | | | | | | In apply_output_config, this sets output->{width,height} using the values in the output box. Previously, they were being set using wlr_output_transformed_resolution, which takes the width and height from the wlr_output and just checks whether they should be swapped based on the transform. This did not take into account the output's scale. wlr_output_effective_resolution could be used instead, which handles both transform and scale. However, the values in the output box have already been processed by wlr_output_effective_resolution so they can just be used directly
* Add calibration_matrix config optionLibravatar Sergei Dolgov2019-07-05
| | | | | | | | | | | | | | | | | | | | | | Can be used to change the orientation of a touchscreen. Example usage with swaymsg: # identity swaymsg input type:touch calibration_matrix '"1 0 0 0 1 0"' # 90 degree clockwise swaymsg input type:touch calibration_matrix '"0 -1 1 1 0 0"' # 180 degree clockwise swaymsg input type:touch calibration_matrix '"-1 0 1 0 -1 1"' # 270 degree clockwise swaymsg input type:touch calibration_matrix '"0 1 0 -1 0 1"' Documentation: https://wayland.freedesktop.org/libinput/doc/latest/absolute-axes.html#calibration-of-absolute-devices
* config/input: validate xkb keymap before storingLibravatar Brian Ashworth2019-06-09
| | | | | | | | This allows for an optional validation stage when storing an input config. Currently, only the xkb keymap is validated. If storing the delta input config will result in any invalid xkb keymaps, the input config will not be stored and error will be populated with the first line of the xkbcommon log.