aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
authorSimon Zeni <simon@bl4ckb0ne.ca>2019-06-27 13:55:34 -0400
committerSimon Ser <contact@emersion.fr>2021-09-09 15:25:19 +0200
commit30c28ff8f774546c6e930ed3acf717434df55371 (patch)
tree259db63a0caaf17c4c12a42ca0190ecf94ff5da9 /sway/desktop
parente76e13ef854a3f1d291521c6f2c9d6e936bca184 (diff)
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.
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/output.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 2f2ab4bc..a980e958 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -4,8 +4,10 @@
#include <strings.h>
#include <time.h>
#include <wayland-server-core.h>
+#include <wlr/backend/drm.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/types/wlr_buffer.h>
+#include <wlr/types/wlr_drm_lease_v1.h>
#include <wlr/types/wlr_matrix.h>
#include <wlr/types/wlr_output_damage.h>
#include <wlr/types/wlr_output_layout.h>
@@ -836,7 +838,17 @@ static void handle_present(struct wl_listener *listener, void *data) {
void handle_new_output(struct wl_listener *listener, void *data) {
struct sway_server *server = wl_container_of(listener, server, new_output);
struct wlr_output *wlr_output = data;
- sway_log(SWAY_DEBUG, "New output %p: %s", wlr_output, wlr_output->name);
+ sway_log(SWAY_DEBUG, "New output %p: %s (non-desktop: %d)",
+ wlr_output, wlr_output->name, wlr_output->non_desktop);
+
+ if (wlr_output->non_desktop) {
+ sway_log(SWAY_DEBUG, "Not configuring non-desktop output");
+ if (server->drm_lease_manager) {
+ wlr_drm_lease_v1_manager_offer_output(server->drm_lease_manager,
+ wlr_output);
+ }
+ return;
+ }
struct sway_output *output = output_create(wlr_output);
if (!output) {