-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added patch that lets chromium-ozone-wayland track additional Wayland…
… seats, i.e. in the case of VNC/RDP Tested with desktop-shell for main compositor, and fullscreen-shell for VNC compositor.
- Loading branch information
1 parent
b279a4d
commit a0c7258
Showing
2 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
...chromium/recipes-browser/chromium/files/0027-Track-Wayland-seats-other-than-primary.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
From d2f5a74f9d9afc5bbbb550570b972fb5784e0b09 Mon Sep 17 00:00:00 2001 | ||
From: Lachlan Frawley <[email protected]> | ||
Date: Thu, 22 Jun 2023 22:38:29 +0000 | ||
Subject: [PATCH] Track Wayland seats other than primary | ||
|
||
--- | ||
.../wayland/host/wayland_connection.cc | 7 ++++++ | ||
.../wayland/host/wayland_connection.h | 1 + | ||
.../platform/wayland/host/wayland_seat.cc | 24 ++++++++++++++----- | ||
3 files changed, 26 insertions(+), 6 deletions(-) | ||
|
||
diff --git a/ui/ozone/platform/wayland/host/wayland_connection.cc b/ui/ozone/platform/wayland/host/wayland_connection.cc | ||
index f04dbf016..01005d419 100644 | ||
--- a/ui/ozone/platform/wayland/host/wayland_connection.cc | ||
+++ b/ui/ozone/platform/wayland/host/wayland_connection.cc | ||
@@ -609,6 +609,13 @@ void WaylandConnection::GlobalRemove(void* data, | ||
wl_registry* registry, | ||
uint32_t name) { | ||
auto* connection = static_cast<WaylandConnection*>(data); | ||
+ | ||
+ // We track the names of seats locally | ||
+ auto extra_seat_it = connection->extra_seats_.find(name); | ||
+ if(extra_seat_it != connection->extra_seats_.end()) { | ||
+ connection->extra_seats_.erase(extra_seat_it); | ||
+ } | ||
+ | ||
// The Wayland protocol distinguishes global objects by unique numeric names, | ||
// which the WaylandOutputManager uses as unique output ids. But, it is only | ||
// possible to figure out, what global object is going to be removed on the | ||
diff --git a/ui/ozone/platform/wayland/host/wayland_connection.h b/ui/ozone/platform/wayland/host/wayland_connection.h | ||
index c0197481b..e48f995ae 100644 | ||
--- a/ui/ozone/platform/wayland/host/wayland_connection.h | ||
+++ b/ui/ozone/platform/wayland/host/wayland_connection.h | ||
@@ -429,6 +429,7 @@ class WaylandConnection { | ||
zwp_relative_pointer_manager_; | ||
std::unique_ptr<WaylandZwpPointerGestures> zwp_pointer_gestures_; | ||
std::unique_ptr<WaylandSeat> seat_; | ||
+ base::flat_map<uint32_t, std::unique_ptr<WaylandSeat>> extra_seats_; | ||
std::unique_ptr<WaylandBufferManagerHost> buffer_manager_host_; | ||
std::unique_ptr<XdgActivation> xdg_activation_; | ||
std::unique_ptr<XdgForeignWrapper> xdg_foreign_; | ||
diff --git a/ui/ozone/platform/wayland/host/wayland_seat.cc b/ui/ozone/platform/wayland/host/wayland_seat.cc | ||
index 061e0560d..08b4b1380 100644 | ||
--- a/ui/ozone/platform/wayland/host/wayland_seat.cc | ||
+++ b/ui/ozone/platform/wayland/host/wayland_seat.cc | ||
@@ -33,8 +33,9 @@ void WaylandSeat::Instantiate(WaylandConnection* connection, | ||
CHECK_EQ(interface, kInterfaceName) << "Expected \"" << kInterfaceName | ||
<< "\" but got \"" << interface << "\""; | ||
|
||
- if (connection->seat_ || | ||
- !wl::CanBind(interface, version, kMinVersion, kMaxVersion)) { | ||
+ // Only check if we can bind the interface | ||
+ if(!wl::CanBind(interface, version, kMinVersion, kMaxVersion)) { | ||
+ LOG(ERROR) << "Cannot bind wl_seat"; | ||
return; | ||
} | ||
|
||
@@ -44,11 +45,22 @@ void WaylandSeat::Instantiate(WaylandConnection* connection, | ||
LOG(ERROR) << "Failed to bind to wl_seat global"; | ||
return; | ||
} | ||
- connection->seat_ = std::make_unique<WaylandSeat>(seat.release(), connection); | ||
|
||
- // The seat is one of objects needed for data exchange. Notify the connection | ||
- // so it might set up the rest if all other parts are in place. | ||
- connection->CreateDataObjectsIfReady(); | ||
+ // If we have no "primary" seat, then assume whatever seat we get first is | ||
+ // meant to be the primary seat | ||
+ if(!connection->seat_) { | ||
+ connection->seat_ = std::make_unique<WaylandSeat>(seat.release(), connection); | ||
+ | ||
+ // The seat is one of objects needed for data exchange. Notify the connection | ||
+ // so it might set up the rest if all other parts are in place. | ||
+ connection->CreateDataObjectsIfReady(); | ||
+ } else { | ||
+ if(connection->extra_seats_.find(name) != connection->extra_seats_.end()) { | ||
+ LOG(ERROR) << "Seat with name already exists"; | ||
+ return; | ||
+ } | ||
+ connection->extra_seats_.emplace(name, std::make_unique<WaylandSeat>(seat.release(), connection)); | ||
+ } | ||
} | ||
|
||
WaylandSeat::WaylandSeat(wl_seat* seat, WaylandConnection* connection) | ||
-- | ||
2.34.1 | ||
|