Age | Commit message (Collapse) | Author |
|
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
|
|
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.
|
|
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
|
|
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
|
|
This function checks whether the backend would accept an output
configuration, without applying the changes.
|
|
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>
|
|
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.
|
|
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.
|
|
Fixes segfault on start:
https://gist.github.com/yorickvP/89eccb3782c6edb22aeda6ce9c6d4fcb
|
|
The smart output filter uses the current output scale.
|
|
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
|
|
Closes: https://github.com/swaywm/sway/issues/4960
|
|
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.
|
|
This fixes a crash where the `oc->name` would be accessed by sway_log()
even when `oc` was NULL.
|
|
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)
|
|
|
|
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.
|
|
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
|
|
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.
|
|
|
|
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.
|
|
|
|
|
|
|
|
Instead of relying on the order of modes, use wlr_output_preferred_mode
to get the preferred mode.
|
|
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")
|
|
|
|
This forces to set the mode as a custom mode.
|
|
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
|
|
If allocation of bindings failed.
Found with clang-tidy
|
|
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
|
|
apply_output_config would call output_enable and always return true,
even if the output couldn't be enabled.
|
|
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.
|
|
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
|
|
This reverts commit 6e0565e9de4247bbf0ca662565c58e0a54258d6e.
This is required for the revert on swaywm/wlroots#1781
|
|
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.
|
|
Result of 'calloc' is converted to a pointer of type 'char *', which
is incompatible with sizeof operand type 'char **'
|
|
See https://github.com/swaywm/wlroots/pull/1762
|
|
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.
|
|
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
|
|
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
|
|
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.
|
|
New 'seat <name> xcursor_theme <theme> [<size>]' command that
configures the default xcursor theme.
The default seat's xcursor theme is also propagated to XWayland, and
exported through the XCURSOR_THEME and XCURSOR_SIZE environment
variables. This is done every time the default seat's configuration is
changed.
|
|
This just makes it so swaybar is handled as a wayland client
|
|
This fixes a typo in `merge_id_on_name` for output configs that
resulted in incorrect id-on-name output configs being generated.
Instead of using the output that matched the name or identifier, the
first output in the list was being used instead. This could cause
merging across unrelated output configs and preventing output configs
from being applied correctly
|
|
When reloading, this destroys the old config's swaybg client before
spawning the new config's swaybg. This fixes a race condition where the
old config's swaybg client's destroy was being called after the new
config's swaybg client was being spawned. This was causing the
reference to the new swaybg client to be removed and never destroyed.
This also modifies handle_swaybg_client_destroy to grab the config
reference using wl_container_of on the listener since the swaybg client
may be the old config swaybg client and should be used instead of the
global config instance
|
|
|
|
|
|
Add support for configurations that apply to a type of inputs
(i.e. natural scrolling on all touchpads). A type config is
differentiated by a `type:` prefix followed by the type it
corresponds to.
When new devices appear, the device config is merged on top of its
type config (if it exists). New type configs are applied on top of
existing configs.
|
|
This spawns swaynag as a wayland client similar to how swaybar and
swaybg are already done
|