Age | Commit message (Collapse) | Author |
|
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 #4929
Replaces criteria_get_views with criteria_get_containers which can
return containers without views when the criteria only contains
container properties.
|
|
|
|
|
|
This reverts commit 79c5f5ba1245a8c3d575770419a6501447e78919.
Fixes: https://github.com/swaywm/sway/issues/4908
|
|
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.
|
|
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.
|
|
Containers are always fixed to the pixel grid so position and size them
with integers instead of doubles.
Functionally this should be no different since rounding down is already
being done on things like layout. But it makes it clear what the
intention is and avoids bugs where fractional pixels are used. The
translating and moving code is still using doubles because the cursors
can have fractional pixels and thus the code is plumbed that way. But
that could also probably be changed easily by doing the integer
conversions earlier and plumbing with int.
|
|
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
|
|
|
|
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.
|
|
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).
|
|
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.
|
|
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
|
|
Repaint scheduling delays output render and frame done events from
output frame events, and block idle frame events from being scheduled in
between output frame done and output render in this period of time.
If a surface is committed after its frame done event, but before output
render, idle frame requests will be blocked, and the surface relies on
the upcoming render to schedule a frame.
If when the repaint timer expires, output render is deemed unnecessary,
no frame will be scheduled. This can lead to surfaces never having their
frame callbacks fire.
To fix this, we store that a surface has requested a frame in
surface_needs_frame. When the repaint expires, if no render is deemed
necessary, we check this flag and schedule an idle frame.
Fixes #4768
|
|
|
|
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.
|
|
|
|
For extending wlr_surface with additional things.
|
|
|
|
|
|
|
|
|
|
This forces to set the mode as a custom mode.
|
|
Closes: https://github.com/swaywm/sway/issues/4644
References: https://github.com/emersion/rootston/commit/1982106c9b0fbd48ee9fe20e013524125f6ca3cf
|
|
|
|
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.
|
|
Following i3 support: https://github.com/i3/i3/pull/3407
|
|
Sway has basic support for drawing tablets, but does not expose
properties such as pressure sensitivity. This implements the wlr tablet
v2 protocol, providing tablet events to Wayland clients.
|
|
|
|
|
|
This just adds a force option to cmd_xwayland that allows for xwayland
to be immediately launched instead of lazily launched. This is useful
for slower machines so it can be part of the startup time instead of
when the user is actively trying to use it
|
|
This keeps track of whether surfaces received a key press event and
will only send a key release event if the pressed event was sent. This
also requires changing the keycodes that are sent via wl_keyboard_enter
to only include those that were previously sent. This makes it so
surfaces do not receive key release events for keys that they never
received a key press for and makes it so switching focus doesn't leak
keycodes that were consumed by bindings.
|
|
All major toolkits and apps have gained xdg-shell stable support.
Closes: https://github.com/swaywm/sway/issues/3690
|
|
|
|
This adds support for specifying a binding for a specific group. Any
binding without a group listed will be available in all groups. The
priority for matching bindings is as follows: input device, group, and
locked state.
For full compatibility with i3, this also adds Mode_switch as an alias
for Group2. Since i3 only supports this for backwards compatibility
with older versions of i3, it is implemented here, but not documented.
|
|
The documentation for wayland-server.h says:
> Use of this header file is discouraged. Prefer including
> wayland-server-core.h instead, which does not include the server protocol
> header and as such only defines the library PI, excluding the deprecated API
> below.
Replacing wayland-server.h with wayland-server-core.h allows us to drop the
WL_HIDE_DEPRECATED declaration.
This commit si similar to wlroots' ca45f4490ccc ("Remove all wayland-server.h
includes").
|
|
|
|
This adds a libinput_config change type to the input event for when
the libinput config for a device changes
In order for this to be possible to track, the libinput config code
had to be refactored. It is now extracted into a separate file to
isolate it from the rest of the input management code.
|
|
This adds an ipc event related to input devices. Currently the
following changes are supported:
- added: when an input device becomes available
- removed: when an input device is no longer available
- xkb_keymap_changed: (keyboards only) the keymap changed
- xkb_layout_changed: (keyboards only) the effective layout changed
|
|
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.
|
|
The output manager config was not properly updated if the position
of the output got changed.
|
|
When the gaps become too large for the space available gracefully
reduced them all the way to 0 if needed.
Fixes #4294
|
|
Instead of tracking gaps per child apply gaps in two logical places:
1. In tiled containers use the layout code to add the gaps between
windows. This is much simpler and guarantees that the sizing of children
is correct.
2. In the workspace itself apply all the gaps around the edge. Here
we're in the correct position to size inner and outer gaps correctly and
decide on smart gaps in a single location.
Fixes #4296
|
|
Instead of using container->width/height as both the input and output
of the layout calculation have container->width_fraction/height_fraction
as the share of the parent this container occupies and calculate the
layout based on that. That way the container arrangement can always be
recalculated even if width/height have been altered by things like
fullscreen.
To do this several parts are reworked:
- The vertical and horizontal arrangement code is ajusted to work with
fractions instead of directly with width/height
- The resize code is then changed to manipulate the fractions when
working on tiled containers.
- Finally the places that manipulated width/height are adjusted to
match. The adjusted parts are container split, swap, and the input
seat code.
It's possible that some parts of the code are now adjusting width and
height only for those to be immediately recalculated. That's harmless
and since non-tiled containers are still sized with width/height
directly it may avoid breaking other corner cases.
Fixes #3547
Fixes #4297
|
|
This adds a --reload flag to cmd_bindswitch that allows for the binding
to be executed on reload. One possible use case for this is to allow
users to disable outputs when the lid closes and enable them when the
lid opens without having to open and re-close the lid after a reload.
|
|
Now the highlighted center area of containers triggers a swap action
instead of moving around the containers.
|
|
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
|
|
Without this change, the handlers listed in the config_handlers or
command_handlers arrays (depending on reading or active) in commands.c
would be valid subcommands. To make matters worse, they would also take
precedence over the defined subcommand handlers.
This corrects find_handler to only work on the handler array given
instead of implicitly trying others.
|