Commit Graph

4341 Commits

Author SHA1 Message Date
Ronan Pigott 8d78ab6a45 criteria: be lenient on window_role and instance too 2022-12-12 11:26:11 +01:00
Kenny Levinsen 817f1bbec3 seat: Avoid sending redundant keymaps on reload
When we reload the config, we reset every input device and re-apply
configuration from the config file. This means that the keyboard keymap
is updated at least once during config reload, more if the config file
contains keyboard configuration.

When they keyboard keymap changes and is updated through wlr_seat, the
keymap ends up sent to every keyboard bound in every client, seemingly
multiple times. On an x230 of mine with a keyboard layout set in the
config file, I see 42 keymap events sent to foot on config reload.

Reduce events from keyboard configurations by skipping all but the
currently active keyboard for the seat, and by clearing the active
keyboard during input manager device reset. After this change, I only
see a single just-in-time keymap event.

Fixes: https://github.com/swaywm/sway/issues/6654
2022-12-12 11:26:11 +01:00
Ronan Pigott d5872d0880 launcher: export X startup ids and use them for workspace matching
(cherry picked from commit 28fda4c0d3)
2022-11-26 10:29:59 +01:00
Ronan Pigott 97423ca9c7 launcher: export xdga tokens and use them for workspace matching
(cherry picked from commit 30ad4dc4a5)
2022-11-26 10:29:59 +01:00
Ronan Pigott ee9266cf8c launcher: fudge the interface a bit
We want to create a context before knowing the pid it will match with.

(cherry picked from commit bdeb9f9565)
2022-11-26 10:29:59 +01:00
Ronan Pigott 66be031f6c launcher: initialize launcher_ctxs once on startup
(cherry picked from commit 66568508c0)
2022-11-26 10:29:59 +01:00
Ronan Pigott 5794a223ce view: associate launch contexts with views
Views now maintain a reference to a launch context which, as a last
resort, is populated at map time with a context associated with its pid.
This opens the possibility of populating it before map via another
source, e.g. xdga-tokens or configuration.

(cherry picked from commit 864b3a9a18)
2022-11-26 10:29:59 +01:00
Ronan Pigott 9d78ede905 launcher: rename pid_workspace to launcher_ctx
Soon we will match views with more than just a pid.

(cherry picked from commit d75c9f9722)
2022-11-26 10:29:59 +01:00
Ronan Pigott cb13b9d628 launcher: use xdga tokens
This reuses wlroots token tracking for workspace matching. It doesn't
export any xdga tokens for clients yet.

(cherry picked from commit bd66f4943d)
2022-11-26 10:29:59 +01:00
Ronan Pigott 69abc41d25 launcher: track workspaces by node
This removes the need to rename the pid_workspaces when a workspace
is renamed.

It also opens the possibility of tracking other node types. Tracking
containers would allow application to be placed correctly in the
container tree even if the user has moved their focus elsewhere since
it was launched.

(cherry picked from commit 3b49f2782e)
2022-11-26 10:29:59 +01:00
Ronan Pigott 16b391db48 node: prettify node type names
(cherry picked from commit 1c4b94ae3c)
2022-11-26 10:29:59 +01:00
Ronan Pigott 25f559dcde root: move the workspace matching code to its own file
This removes the pid_workspace bits from tree/root before it gets
too interesting.

No functional change.

(cherry picked from commit eb5021ef99)
2022-11-26 10:29:59 +01:00
Simon Ser 52166bc1f5 build: drop intermediate libraries for protocols
(cherry picked from commit af8a5a8918)
2022-11-26 10:29:58 +01:00
Kirill Primak 68b4ed3a4a output: set damage ring bounds to pixel values
Fixes: https://github.com/swaywm/sway/issues/7254
(cherry picked from commit 85005b52fe)
2022-11-26 10:29:58 +01:00
Alexander Orzechowski 5a2563b1a4 workspace_create: Don't allow NULL name
(cherry picked from commit 34933bb843)
2022-11-26 10:29:58 +01:00
Baltazár Radics 5c239eaac5 container_get_siblings: handle NULL workspace 2022-11-11 18:57:29 +01:00
Simon Ser d945c8f519 lock: fix crash on output destroy
Closes: https://github.com/swaywm/sway/issues/7120
2022-11-11 17:01:50 +01:00
Kirill Primak 7862fa670e
Use wlr_damage_ring
wlr_output_damage is to be replaced with wlr_damage_ring, so use that.
2022-11-11 16:29:04 +01:00
Simon Ser dcd2076f38 Use wl_signal_emit_mutable()
This function fixes segfaults when emitting a signal potentially
removes arbitrary listeners.
2022-11-10 22:27:38 +03:00
Callum Andrew 3e19836f0e criteria: allow matching for NULL string criteria 2022-11-04 10:02:11 +01:00
Puck Meerburg e40eb338b9 criteria: allow matching on empty (NULL) titles 2022-10-30 10:57:19 +01:00
Puck Meerburg 0fdeb4ca84 tree: support formatting null titles
Any windows that have never had a title set visually behave closer to
that of an empty title, but are unformattable, as the code bails out
early on a NULL title.
2022-10-30 10:57:19 +01:00
pudiva chip líquida 7cc8ab6d6c Support libinput's 1.21 new dwtp option
Support the new dwtp (disable while trackpointing) option introduced in
libinput 1.21, allowing users to control whether the trackpoint (like
those in Thinkpads, but not only) should be disabled while using the
keyboard/touchpad.

See: https://gitlab.freedesktop.org/libinput/libinput/-/issues/731
2022-10-30 10:56:34 +01:00
Alexander Orzechowski a61815d385 container_floating_set_default_size: Store workspace size box on the stack 2022-10-29 00:47:01 +02:00
Daniel De Graaf 8aa89dc277 Fix focus tracking when session lock is active
Remove the incorrect attempt to block focus changes when an input grab
is present and replace it with the same logic used for layer_shell-based
screen lockers: restore the focus after changing it.

This fixes a use-after-free of seat->workspace if outputs are destroyed
while a screen lock is enabled.
2022-10-28 19:41:24 +02:00
Daniel De Graaf 8f7bb145b7 Rework session lock keyboard focus handling
When removing outputs, it is possible to end up in a situation where
none of the session lock client's surfaces have keyboard focus,
resulting in it not receiving keyboard events.  Track the focused
surface and update it as needed on surface destroy.
2022-10-28 19:41:24 +02:00
Yaroslav de la Peña Smirnov 9d99bb956f Fix keymap being NULL and segfaulting on dev add
Moved `libinput_config` to the callers of
`sway_input_configure_libinput_device` so that we send the event after
the added event.
2022-10-23 11:56:29 +02:00
Tudor Brindus 5e514e6474 input: tweak focus behavior to allow focusing parent containers
Sway focuses the inactive child when focusing split containers. However,
there is currently no way to focus the parent container itself by mouse.
A user must use the keyboard to do so.

This commit maintains the current behavior, but makes it such that a
second click on the split container titlebar (i.e., after its children
are visible) focuses the split container itself.
2022-10-21 10:05:00 +02:00
Simon Ser 9400bd963c Add support for ext-idle-notify-v1
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3753
2022-10-14 15:56:07 +02:00
cparm 99fd096d69 Avoid double free in criteria_destroy() 2022-10-13 14:56:10 +02:00
Simon Ser 7a6afc5199 Fix leaks in criteria_destroy() 2022-10-10 09:51:01 -04:00
Tudor Brindus c7bced9329 input: focus container when scrolling on titlebar
Fixes #6503.
2022-10-10 08:56:51 +02:00
Tudor Brindus 09354db878 input: focus floating container when clicked on border
Fixes #7209.
2022-10-10 08:55:21 +02:00
Ferdinand Schober 99acdb4e62 Use keyboard_state.focused_surface directly 2022-10-09 10:07:51 +02:00
Ferdinand Schober be7707874a use seat directly 2022-10-09 10:07:51 +02:00
Ferdinand Schober e2bb5799af check for NULL 2022-10-09 10:07:51 +02:00
Ferdinand Schober d5659948f1 allow pointer_constraints on layer_shell surfaces 2022-10-09 10:07:51 +02:00
Andri Yngvason b00b05f792 sway/commands/output: Add command for unplugging non-physical outputs 2022-10-07 19:17:39 +02:00
Simon Ser f70d1e1b95 ipc: expose mode picture aspect ratio 2022-10-03 13:35:52 +02:00
マリウス b0fc83485d man: Add XWayland information 2022-09-25 20:05:16 +02:00
Alex Maese 52f0e3a4d5 sway: add non-desktop outputs to json when running `swaymsg -t get_outputs` 2022-09-19 07:26:45 -04:00
Alex Maese c015db4a9f sway: Add non-desktop-output type
Currently, when encountering a non-desktop display, sway offers the
output for leasing and returns without storing it in a sway specific
output type like `struct sway_output`.  Additionally, running
`swaymsg -t get_outputs` doesn't show non-desktop outputs.

This commit stores the non-desktop outputs into a struct called
`sway_output_non_desktop`, and adds them to a list on `sway_root`
2022-09-19 07:26:45 -04:00
Filip Szczepański 1c368fbb5f Fix crash in xdg_activation_v1.c
wlr_xdg_surface_from_wlr_surface() can return a NULL pointer, so check for NULL before dereferencing it.
2022-09-13 00:59:18 +03:00
Simon Ser 07bfeb2abc config/output: test adaptive sync
Required for [1].

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3637
2022-08-30 20:15:29 +02:00
Simon Ser aaa6c4ac89 ipc: drop WLR_OUTPUT_ADAPTIVE_SYNC_UNKNOWN case
This has been removed from wlroots.
2022-08-30 20:15:29 +02:00
Baltazár Radics 6e023257e8 man: sway(5) move fixes 2022-08-11 08:21:37 +02:00
Martin Michlmayr ebf441b359 sway-output.5: improve display of parameter
Since "width" and "height" are separate parameters, show them as such.
2022-08-08 08:03:27 +02:00
Simon Ser 89d73beedb Enable single-pixel-buffer-v1
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3428
2022-08-04 18:44:58 +02:00
Baltazár Radics a5a44ba95b ipc: make get_deco_rect check config->hide_lone_tab
Without this, the `IPC_GET_TREE` ipc call would return false information
about the container's `deco_rect` and `rect` properties if
`hide_edge_borders --i3` was in effect.
2022-07-26 12:06:10 +02:00
Kirill Primak 6b97c4fa71 input: chase delta_discrete semantics change 2022-07-15 14:14:41 -04:00