Commit Graph

4365 Commits

Author SHA1 Message Date
Carl Smedstad 9425ce2fba Replace math functions that promote float to double 2023-01-03 21:50:56 +01:00
Carl Smedstad d8212243c9 Remove redundant return statements 2023-01-03 21:50:56 +01:00
Carl Smedstad 6ec57271b6 Make cmd_handler.command const 2023-01-03 21:50:56 +01:00
Carl Smedstad 9540591105 Add missing includes & remove duplicates 2023-01-03 21:50:56 +01:00
Carl Smedstad e3257e646c Remove duplicate declarations 2023-01-03 21:50:56 +01:00
Simon Ser 9e15e2fd4f tree/container: drop unnecessary check in container_get_siblings()
The check for container->pending.workspace already covers this.

References: https://github.com/swaywm/sway/pull/7315#issuecomment-1341716204
2023-01-03 11:01:02 -07:00
Simon Ser 0c23b0ec33 man: fix typo in output disable docs 2023-01-03 10:59:02 -07:00
Kenny Levinsen 1ade0ce753 seat: Set keyboard if seat keyboard is NULL
sway sends wl_keyboard.enter on seat focus change and when a keyboard
active on a seat is configured. If all keyboards are removed and a
keyboard is added back without changing the focused client, no new
notify event would be sent despite having keyboard focus. This could
lead to key events without notify, which is a protocol violation.

As a quick fix, when configuring a keyboard on a seat where no keyboard
is currently active, activate the keyboard so that a focused surface
will receive a notify event.

Regressed by: e1b268af98
Closes: https://github.com/swaywm/sway/issues/7330
2022-12-19 10:02:58 +01:00
Ankit Pandey e3c63bf58d commands/move: Warp cursor after moving workspace to another output
This makes sway's behavior consistent with i3 when `mouse_warping` is
set to any value besides `none`.

Fixes #7027.
2022-12-19 00:31:09 -07:00
Baltazár Radics fbf9191fb8 Fix input command order (rotation_angle)
efd83cb8 added the rotation_angle command but it didn't insert it in
the proper place in the list, so the repeat_delay and repeat_rate
commands became unusable.
2022-12-09 22:36:33 +01:00
Lucas Zampieri efd83cb8b9 Add libinput RotationAngle
This patch adds the libinput option RotationAngle to sway.

Signoff-by: Lucas Zampieri <lzampier@redhat.com>
2022-12-09 11:28:53 +01:00
Ronan Pigott 991d75904f criteria: be lenient on window_role and instance too 2022-12-08 21:20:45 +01:00
Aidan Dang c32a507303 Add `primary_selection` config option
See: https://github.com/swaywm/sway/issues/4511

Adds a bool config option `primary_selection`, which explicitly
enables/disables the primary selection clipboard. Defaults to enabled.

This is implemented as a launch-only option which enables or disables the creation of the
`zwp_primary_selection_device_manager_v1` global.

Co-authored-by: Tilde Rose <t1lde@protonmail.com>
2022-12-05 14:09:29 +01:00
Kenny Levinsen e1b268af98 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-04 13:01:41 -07:00
Simon Zeni 6b3245ac77 sway/lock: handle mode in output commit handler 2022-12-01 23:27:22 +01:00
Simon Zeni aa03a8fcb5 sway/desktop/output: listen to output mode in commit handle 2022-12-01 23:27:22 +01:00
Simon Ser 3bd657c726 Chase breaking changes in wlroots!3903
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3903
2022-11-30 17:18:20 +01:00
Simon Ser e62299daa4 Make libinput backend optional 2022-11-28 13:28:15 -05:00
Simon Ser 46170580b2 Make session optional 2022-11-28 13:28:15 -05:00
Simon Ser e795ea6a0c Make DRM backend optional 2022-11-28 13:28:15 -05:00
Simon Ser 5b64e2fc31 Make GLES2 optional 2022-11-28 13:28:15 -05:00
Ronan Pigott 28fda4c0d3 launcher: export X startup ids and use them for workspace matching 2022-11-26 09:48:58 +01:00
Ronan Pigott 30ad4dc4a5 launcher: export xdga tokens and use them for workspace matching 2022-11-26 09:48:58 +01:00
Ronan Pigott bdeb9f9565 launcher: fudge the interface a bit
We want to create a context before knowing the pid it will match with.
2022-11-26 09:48:58 +01:00
Ronan Pigott 66568508c0 launcher: initialize launcher_ctxs once on startup 2022-11-26 09:48:58 +01:00
Ronan Pigott 864b3a9a18 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.
2022-11-26 09:48:58 +01:00
Ronan Pigott d75c9f9722 launcher: rename pid_workspace to launcher_ctx
Soon we will match views with more than just a pid.
2022-11-26 09:48:58 +01:00
Ronan Pigott bd66f4943d launcher: use xdga tokens
This reuses wlroots token tracking for workspace matching. It doesn't
export any xdga tokens for clients yet.
2022-11-26 09:48:58 +01:00
Ronan Pigott 3b49f2782e 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.
2022-11-26 09:48:58 +01:00
Ronan Pigott 1c4b94ae3c node: prettify node type names 2022-11-26 09:48:58 +01:00
Ronan Pigott eb5021ef99 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.
2022-11-26 09:48:58 +01:00
Simon Ser af8a5a8918 build: drop intermediate libraries for protocols 2022-11-25 10:51:20 +01:00
Simon Ser 7623292734 Update for wlroots!3814
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3814
2022-11-15 22:26:43 +01:00
Simon Ser 717e9ef581 ipc: add view content type
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3599
2022-11-15 11:06:51 -05:00
Simon Ser 907ca48a61 Listen to the output request_state event
References: https://github.com/swaywm/wlroots/pull/2693
2022-11-15 11:05:47 -05:00
Simon Ser 024c3e4428 input/seat: locally compute drag icon offset
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3861
2022-11-15 16:58:20 +03:00
Simon Zeni e1be46875d sway/server: specify wlr-layer-shell version on creation 2022-11-14 16:10:55 +01:00
Kirill Primak 85005b52fe output: set damage ring bounds to pixel values
Fixes: https://github.com/swaywm/sway/issues/7254
2022-11-12 11:50:04 +01:00
Alexander Orzechowski 34933bb843 workspace_create: Don't allow NULL name 2022-11-11 23:44:03 +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