Commit Graph

156 Commits

Author SHA1 Message Date
llyyr a946b1aecf Chase wlroots!4440
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4440
2023-11-22 00:42:55 +03:00
Simon Ser 072fa60cb4 Add support for security-context-v1
As a first step, deny access to privileged protocols to sandboxed
apps.

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3589
2023-11-21 15:12:42 +01:00
Simon Ser 7cf4e1d5c6 Drop support for KDE's idle protocol
We support the standard idle-notify protocol since Sway 1.8.
2023-10-05 00:01:54 +02:00
Manuel Stoeckl 8edc48f6dd sway/server: Fix null pointer crash when Xwayland disabled 2023-09-10 08:33:10 +09:00
Simon Ser 4a2210577c Hide xwayland_shell_v1 from regular clients
Regular clients are not allowed to use this interface. wlroots
already sends a protocol error if a non-Xwayland client tries to
use this interface, but let's remove all temptation by hiding it
completely.
2023-08-24 18:27:22 +02:00
Simon Ser 6bd11ad0df Add support for cursor-shape-v1
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4106
2023-07-24 11:28:31 +02:00
Simon Ser fc16fb6549 Send wl_surface.preferred_buffer_scale
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3696
2023-07-12 09:59:00 +02:00
Simon Ser b762f455d9 idle-inhibit-v1: simplify with server global
We only have a single running server, no need to keep track of
multiple server instances. Also no need to support multiple
idle inhibit managers.
2023-06-23 12:32:38 +02:00
Simon Ser b1b3563d54 Handle gamma-control-v1 set_gamma events
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4046
2023-06-08 22:11:50 +02:00
Erik Reider 913a7679cb Add support for wlr-layer-shell ON_DEMAND keyboard interactivity
This allows for layer shell surfaces to receive focus while the surface is explicitly focused, i.e allowing
text fields to receive keyboard input just like a regular surface.
2023-06-06 09:07:05 +02:00
Simon Ser 5e847fe3c8 Pass version to wlr_compositor_create()
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3696
2023-04-14 17:26:03 +02:00
Simon Ser 9162b536f6 Add support for fractional-scale-v1
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3511
2023-02-10 20:36:15 +01:00
Ronan Pigott 4cda9ee3a3 launcher: support external launcher tokens 2023-02-05 00:53:47 -07: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
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 e795ea6a0c Make DRM backend optional 2022-11-28 13:28:15 -05:00
Ronan Pigott 66568508c0 launcher: initialize launcher_ctxs once on startup 2022-11-26 09:48:58 +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 Zeni e1be46875d sway/server: specify wlr-layer-shell version on creation 2022-11-14 16:10:55 +01: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
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
Kenny Levinsen e5728052b5 Refuse to start when SUID is detected
This ensures that those surprised by the deprecation of SUID operation
receive an error rather than accidentally having sway run as root.

This detection will be removed in a future release.
2022-06-03 12:37:40 +02:00
Rouven Czerwinski 3f600565e4 server: request xdg-shell v2
Wlroots does not yet support the newer xdg-shell versions and now
requires the compositor to set the supported xdg-shell version during
creation. Set this to v2 for sway as well.

Fixes https://github.com/swaywm/sway/issues/7001
2022-05-16 11:20:39 -04:00
Daniel De Graaf 519038a7e9 Implement ext-session-lock-v1 2022-04-29 09:06:36 +02:00
Daniel De Graaf 20181974c2 Avoid format-truncation warning
The existing code gives this error when compiled with GCC 12:

../sway/server.c: In function ‘server_init’:
../sway/server.c:217:75: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 8 [-Werror=format-truncation=]
  217 |                 snprintf(name_candidate, sizeof(name_candidate), "wayland-%d", i);
      |                                                                           ^~
../sway/server.c:217:66: note: directive argument in the range [-2147483647, 32]
  217 |                 snprintf(name_candidate, sizeof(name_candidate), "wayland-%d", i);
      |                                                                  ^~~~~~~~~~~~
../sway/server.c:217:17: note: ‘snprintf’ output between 10 and 20 bytes into a destination of size 16
  217 |                 snprintf(name_candidate, sizeof(name_candidate), "wayland-%d", i);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Because i is never negative, this is a false positive, but it is easy to
change i to unsigned to silence the error.
2022-04-09 18:27:57 +02:00
Muhamed Hobi ac7892371c Fix snprintf compiler warning 2022-02-08 09:43:32 +01:00
Simon Ser d6f8820a8b Upgrade for wlroots surface refactoring
See [1] for details.

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3412
2022-01-13 14:01:37 +03:00
Simon Ser 4732325f59 Add support for linux-dmabuf surface hints
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/1376
2021-12-13 09:59:33 -06:00
Simon Ser 3f58f12617 Fixup headless output names
We use the headless backend to create a special fallback output
used when no other output is connected. However this messes up the
"real" headless output names users have come to expect (e.g.
currently the first headless output will be named "HEADLESS-2"
instead of "HEADLESS-1").

Fix this by setting the output name with [1].

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3395
2021-12-09 10:47:01 -06:00
Simon Zeni 0cd8efe0bb sway: replace noop_output by fallback_output
wlroots removed the support for the noop backend. Instead we rely on the
headless backend to provide the fallback output.
2021-11-25 17:48:34 +01:00
Simon Ser 729e18bff5 Replace wlr_headless_backend_create_with_renderer call
Update for the wlroots breaking change in [1].

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3367
2021-11-25 09:39:06 -06:00
Simon Zeni 5865af75cf sway: create wlr_renderer and wlr_allocator
wlroots now required the compositor to create its own wlr_renderer and
wlr_allocator to initialize the wlr_output
2021-11-18 17:47:19 +01:00
Simon Zeni 30c28ff8f7 introduce wlr_drm_lease_v1
This prevents sway from extending the desktop to i.e. VR headsets, and makes
them available for DRM leasing.

Non-desktop wlr_outputs will be offered through the wlr_drm_lease_v1_manager
interface for client to lease.
2021-09-09 15:25:19 +02:00
Simon Ser 9755684fb0 Implement xdg-activation-v1
See https://github.com/swaywm/wlroots/pull/2718.
2021-06-02 19:39:40 +02:00
Simon Ser 1a72049c04 Remove WLR_HAS_XDG_FOREIGN checks
References: https://github.com/swaywm/wlroots/pull/2833
2021-04-11 19:14:05 +02:00
Kenny Levinsen c8bf84c82d transactions: Amend pending transactions
The transaction system contains a necessary optimization where a popped
transaction is combined with later, similar transactions. This breaks
the chronological order of states, and can lead to desynchronized
geometries.

To fix this, we replace the queue with only 2 transactions: current and
pending. If a pending transaction exists, it is updated with new state
instead of creating additional transactions.

As we never have more than a single waiting transaction, we no longer
need the queue optimization that is causing problems.

Closes: https://github.com/swaywm/sway/issues/6012
2021-02-16 00:18:26 +01:00
Aleksei Bavshin 89b4bc4bc7 xdg-foreign: add v1 and v2 implementations
Co-authored-by: Jason Francis <cycl0ps@tuta.io>
2021-02-02 09:32:49 +01:00
Simon Ser 53f5197c26 Remove create_renderer_func argument
It's removed upstream [1].

[1]: https://github.com/swaywm/wlroots/pull/2561
2020-12-30 19:36:55 +01:00
Simon Ser a1591c23d2
Handle secondary headless backend failures 2020-12-08 16:15:48 +01:00
Isaac Freund 5ad3990a6c Drop gtk-primary-selection support 2020-12-08 11:15:03 +01:00
Geoffrey Casper 65a751a21f server: Avoid using "wayland-0" as WAYLAND_DISPLAY
See https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/486
2020-09-16 00:14:20 +02:00
Simon Ser eb4fa18308 Unset DISPLAY when wlr_xwayland fails
Avoids having applications connect to a leftover DISPLAY when Xwayland
fails to initialize.
2020-07-02 23:55:56 -04:00
Drew DeVault 8d5e627bc9 Implement wlr-foreign-toplevel-management-v1 2020-06-23 22:26:00 +02:00
Simon Ser e19bd1e474 Add support for viewporter
Depends on [1].

[1]: https://github.com/swaywm/wlroots/pull/2092
2020-06-17 10:18:58 -06:00
Tudor Brindus 704d675a36 Log Xwayland startup failures
Though unlikely, this commit makes server initialization totally
explicit in the logs.
2020-05-27 18:58:23 +02:00
Simon Ser 5e5e5f2ee5 Add a secondary headless backend
This allows the create_output command to work on DRM too.
2020-05-01 17:00:14 +02:00
xdavidwu 5886187c6e Port input method and text input from rootston
This ports swaywm/wlroots#1203, swaywm/wlroots#1303,
swaywm/wlroots#1308, swaywm/wlroots#1759 rootston part to sway.

Co-Authored-By: Leo Chen <leo881003@gmail.com>
2020-04-04 11:42:04 +02:00
Simon Ser 5ed01c861a Add support for wlr-output-power-management-unstable-v1 2020-02-26 16:26:13 +01:00
Ivan Molodetskikh 5421198489 Add sway_surface
For extending wlr_surface with additional things.
2019-11-17 20:18:42 +01:00