Skip to content

Commit

Permalink
Removes zxdg_shell
Browse files Browse the repository at this point in the history
Sommelier has stopped using this and Lacros doesn't use it so it doesn't seem like it's being used anywhere

Bug: N/A
Change-Id: I4e9daf3b4a39de3d19cac83c3f89c16ec4b93cca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4305659
Commit-Queue: Justin Huang <justinhuang@google.com>
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1113197}
  • Loading branch information
Justin Huang authored and Chromium LUCI CQ committed Mar 6, 2023
1 parent 79a9594 commit 37647e0
Show file tree
Hide file tree
Showing 21 changed files with 49 additions and 1,153 deletions.
2 changes: 0 additions & 2 deletions components/exo/wayland/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ source_set("wayland") {
"zxdg_decoration_manager.h",
"zxdg_output_manager.cc",
"zxdg_output_manager.h",
"zxdg_shell.cc",
"zxdg_shell.h",
]

defines = [ "EXO_IMPLEMENTATION" ]
Expand Down
80 changes: 22 additions & 58 deletions components/exo/wayland/clients/client_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -619,65 +619,29 @@ bool ClientBase::Init(const InitParams& params) {
wl_shell_surface_set_toplevel(shell_surface.get());
}
} else {
if (!globals_.xdg_wm_base) {
// use zxdg
if (!globals_.xdg_shell_v6) {
LOG(ERROR) << "Can't find xdg_shell or zxdg_shell_v6 interface";
return false;
}

zxdg_surface_.reset(zxdg_shell_v6_get_xdg_surface(
globals_.xdg_shell_v6.get(), surface_.get()));
if (!zxdg_surface_) {
LOG(ERROR) << "Can't get zxdg surface";
return false;
}
static const zxdg_surface_v6_listener zxdg_surface_v6_listener = {
[](void* data, struct zxdg_surface_v6* zxdg_surface_v6,
uint32_t layout_mode) {
zxdg_surface_v6_ack_configure(zxdg_surface_v6, layout_mode);
},
};
zxdg_surface_v6_add_listener(zxdg_surface_.get(),
&zxdg_surface_v6_listener, this);
zxdg_toplevel_.reset(zxdg_surface_v6_get_toplevel(zxdg_surface_.get()));
if (!zxdg_toplevel_) {
LOG(ERROR) << "Can't get zxdg toplevel";
return false;
}
static const zxdg_toplevel_v6_listener zxdg_toplevel_v6_listener = {
[](void* data, struct zxdg_toplevel_v6* zxdg_toplevel_v6,
int32_t width, int32_t height, struct wl_array* states) {},
[](void* data, struct zxdg_toplevel_v6* zxdg_toplevel_v6) {}};
zxdg_toplevel_v6_add_listener(zxdg_toplevel_.get(),
&zxdg_toplevel_v6_listener, this);
} else {
// use xdg
xdg_surface_.reset(xdg_wm_base_get_xdg_surface(globals_.xdg_wm_base.get(),
surface_.get()));
if (!xdg_surface_) {
LOG(ERROR) << "Can't get xdg surface";
return false;
}
static const xdg_surface_listener xdg_surface_listener = {
[](void* data, struct xdg_surface* xdg_surface,
uint32_t layout_mode) {
xdg_surface_ack_configure(xdg_surface, layout_mode);
},
};
xdg_surface_add_listener(xdg_surface_.get(), &xdg_surface_listener, this);
xdg_toplevel_.reset(xdg_surface_get_toplevel(xdg_surface_.get()));
if (!xdg_toplevel_) {
LOG(ERROR) << "Can't get xdg toplevel";
return false;
}
static const xdg_toplevel_listener xdg_toplevel_listener = {
[](void* data, struct xdg_toplevel* xdg_toplevel, int32_t width,
int32_t height, struct wl_array* states) {},
[](void* data, struct xdg_toplevel* xdg_toplevel) {}};
xdg_toplevel_add_listener(xdg_toplevel_.get(), &xdg_toplevel_listener,
this);
xdg_surface_.reset(xdg_wm_base_get_xdg_surface(globals_.xdg_wm_base.get(),
surface_.get()));
if (!xdg_surface_) {
LOG(ERROR) << "Can't get xdg surface";
return false;
}
static const xdg_surface_listener xdg_surface_listener = {
[](void* data, struct xdg_surface* xdg_surface, uint32_t layout_mode) {
xdg_surface_ack_configure(xdg_surface, layout_mode);
},
};
xdg_surface_add_listener(xdg_surface_.get(), &xdg_surface_listener, this);
xdg_toplevel_.reset(xdg_surface_get_toplevel(xdg_surface_.get()));
if (!xdg_toplevel_) {
LOG(ERROR) << "Can't get xdg toplevel";
return false;
}
static const xdg_toplevel_listener xdg_toplevel_listener = {
[](void* data, struct xdg_toplevel* xdg_toplevel, int32_t width,
int32_t height, struct wl_array* states) {},
[](void* data, struct xdg_toplevel* xdg_toplevel) {}};
xdg_toplevel_add_listener(xdg_toplevel_.get(), &xdg_toplevel_listener,
this);

if (fullscreen_) {
LOG(ERROR) << "full screen not supported yet.";
Expand Down
2 changes: 0 additions & 2 deletions components/exo/wayland/clients/client_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ class ClientBase {
std::unique_ptr<wl_shell_surface> shell_surface_;
std::unique_ptr<xdg_surface> xdg_surface_;
std::unique_ptr<xdg_toplevel> xdg_toplevel_;
std::unique_ptr<zxdg_surface_v6> zxdg_surface_;
std::unique_ptr<zxdg_toplevel_v6> zxdg_toplevel_;
std::unique_ptr<wl_pointer> wl_pointer_;
std::unique_ptr<zcr_pointer_stylus_v2> zcr_pointer_stylus_;
Globals globals_;
Expand Down
3 changes: 0 additions & 3 deletions components/exo/wayland/clients/client_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ DEFAULT_DELETER(wl_data_device_manager, wl_data_device_manager_destroy)
DEFAULT_DELETER(wp_content_type_manager_v1, wp_content_type_manager_v1_destroy)
DEFAULT_DELETER(wp_content_type_v1, wp_content_type_v1_destroy)
DEFAULT_DELETER(wp_viewporter, wp_viewporter_destroy)
DEFAULT_DELETER(zxdg_shell_v6, zxdg_shell_v6_destroy)
DEFAULT_DELETER(xdg_wm_base, xdg_wm_base_destroy)
DEFAULT_DELETER(zwp_text_input_manager_v1, zwp_text_input_manager_v1_destroy)
DEFAULT_DELETER(zcr_secure_output_v1, zcr_secure_output_v1_destroy)
Expand Down Expand Up @@ -111,8 +110,6 @@ DEFAULT_DELETER(zxdg_decoration_manager_v1, zxdg_decoration_manager_v1_destroy)
DEFAULT_DELETER(zcr_extended_drag_v1, zcr_extended_drag_v1_destroy)
DEFAULT_DELETER(xdg_surface, xdg_surface_destroy)
DEFAULT_DELETER(xdg_toplevel, xdg_toplevel_destroy)
DEFAULT_DELETER(zxdg_surface_v6, zxdg_surface_v6_destroy)
DEFAULT_DELETER(zxdg_toplevel_v6, zxdg_toplevel_v6_destroy)
DEFAULT_DELETER(zxdg_output_manager_v1, zxdg_output_manager_v1_destroy)
DEFAULT_DELETER(weston_test, weston_test_destroy)
DEFAULT_DELETER(zwp_idle_inhibit_manager_v1,
Expand Down
4 changes: 0 additions & 4 deletions components/exo/wayland/clients/client_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include <xdg-decoration-unstable-v1-client-protocol.h>
#include <xdg-output-unstable-v1-client-protocol.h>
#include <xdg-shell-client-protocol.h>
#include <xdg-shell-unstable-v6-client-protocol.h>
#include "base/scoped_generic.h"

#if defined(USE_GBM)
Expand Down Expand Up @@ -105,7 +104,6 @@ DEFAULT_DELETER_FDECL(wl_data_device_manager)
DEFAULT_DELETER_FDECL(wp_content_type_manager_v1)
DEFAULT_DELETER_FDECL(wp_content_type_v1)
DEFAULT_DELETER_FDECL(wp_viewporter)
DEFAULT_DELETER_FDECL(zxdg_shell_v6)
DEFAULT_DELETER_FDECL(xdg_wm_base)
DEFAULT_DELETER_FDECL(zwp_text_input_manager_v1)
DEFAULT_DELETER_FDECL(zcr_secure_output_v1)
Expand All @@ -130,8 +128,6 @@ DEFAULT_DELETER_FDECL(zxdg_decoration_manager_v1)
DEFAULT_DELETER_FDECL(zcr_extended_drag_v1)
DEFAULT_DELETER_FDECL(xdg_surface)
DEFAULT_DELETER_FDECL(xdg_toplevel)
DEFAULT_DELETER_FDECL(zxdg_surface_v6)
DEFAULT_DELETER_FDECL(zxdg_toplevel_v6)
DEFAULT_DELETER_FDECL(zxdg_output_manager_v1)
DEFAULT_DELETER_FDECL(weston_test)
DEFAULT_DELETER_FDECL(zwp_idle_inhibit_manager_v1)
Expand Down
1 change: 0 additions & 1 deletion components/exo/wayland/clients/globals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ void RegistryHandler(void* data,
BIND(wl_output, output)
BIND(zwp_linux_explicit_synchronization_v1, linux_explicit_synchronization)
BIND(zcr_vsync_feedback_v1, vsync_feedback)
BIND(zxdg_shell_v6, xdg_shell_v6)
BIND(xdg_wm_base, xdg_wm_base)
BIND(zcr_stylus_v2, stylus)
BIND(zcr_remote_shell_v1, cr_remote_shell_v1)
Expand Down
1 change: 0 additions & 1 deletion components/exo/wayland/clients/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ struct Globals {
Object<wl_touch> touch;
Object<zaura_shell> aura_shell;
Object<zaura_output> aura_output;
Object<zxdg_shell_v6> xdg_shell_v6;
Object<xdg_wm_base> xdg_wm_base;
Object<zwp_fullscreen_shell_v1> fullscreen_shell;
Object<zwp_input_timestamps_manager_v1> input_timestamps_manager;
Expand Down
38 changes: 0 additions & 38 deletions components/exo/wayland/clients/security_delegate_binding_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <wayland-client.h>
#include <wayland-server.h>
#include <xdg-shell-client-protocol.h>
#include <xdg-shell-unstable-v6-client-protocol.h>

#include "components/exo/client_controlled_shell_surface.h"
#include "components/exo/shell_surface.h"
Expand Down Expand Up @@ -110,43 +109,6 @@ TEST_F(SecurityDelegateBindingTest, XdgSurfaceHasSecurityDelegate) {
nullptr);
}

TEST_F(SecurityDelegateBindingTest, ZxdgSurfaceV6HasSecurityDelegate) {
class ClientData : public test::TestClient::CustomData {
public:
std::unique_ptr<wl_surface> surface;
std::unique_ptr<zxdg_surface_v6> zxdg_surface;
};

test::ResourceKey zxdg_surface_key;

PostToClientAndWait([&](test::TestClient* client) {
auto data = std::make_unique<ClientData>();

data->surface.reset(wl_compositor_create_surface(client->compositor()));
data->zxdg_surface.reset(zxdg_shell_v6_get_xdg_surface(
client->xdg_shell_v6(), data->surface.get()));

zxdg_surface_key =
test::client_util::GetResourceKey(data->zxdg_surface.get());

client->set_data(std::move(data));
});

EXPECT_EQ(test::server_util::GetUserDataForResource<WaylandXdgSurface>(
server_.get(), zxdg_surface_key)
->shell_surface->GetSecurityDelegate(),
server_security_delegate_);

PostToClientAndWait([](test::TestClient* client) {
// Destroy the client objects.
client->set_data(nullptr);
});

EXPECT_EQ(test::server_util::GetUserDataForResource<WaylandXdgSurface>(
server_.get(), zxdg_surface_key),
nullptr);
}

TEST_F(SecurityDelegateBindingTest, ZcrRemoteSurfaceV1HasSecurityDelegate) {
class ClientData : public test::TestClient::CustomData {
public:
Expand Down
3 changes: 0 additions & 3 deletions components/exo/wayland/clients/test/client_version_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <weston-test-server-protocol.h>
#include <xdg-decoration-unstable-v1-server-protocol.h>
#include <xdg-shell-server-protocol.h>
#include <xdg-shell-unstable-v6-server-protocol.h>

#include <memory>
#include <string>
Expand Down Expand Up @@ -79,7 +78,6 @@ struct Globals {
std::unique_ptr<wl_data_device_manager> wl_data_device_manager;
std::unique_ptr<wp_content_type_manager_v1> wp_content_type_manager_v1;
std::unique_ptr<wp_viewporter> wp_viewporter;
std::unique_ptr<zxdg_shell_v6> zxdg_shell_v6;
std::unique_ptr<xdg_wm_base> xdg_wm_base;
std::unique_ptr<zwp_text_input_manager_v1> zwp_text_input_manager_v1;
std::unique_ptr<zcr_secure_output_v1> zcr_secure_output_v1;
Expand Down Expand Up @@ -173,7 +171,6 @@ void RegistryHandler(void* data,
REGISTRY_CALLBACK(wp_content_type_manager_v1,
wp_content_type_manager_v1),
REGISTRY_CALLBACK(wp_viewporter, wp_viewporter),
REGISTRY_CALLBACK(zxdg_shell_v6, zxdg_shell_v6),
REGISTRY_CALLBACK(xdg_wm_base, xdg_wm_base),
REGISTRY_CALLBACK(zwp_text_input_manager_v1,
zwp_text_input_manager_v1),
Expand Down
1 change: 0 additions & 1 deletion components/exo/wayland/compatibility_test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ server_wayland_protocols = [
"//third_party/wayland-protocols/src/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml",
"//third_party/wayland-protocols/src/unstable/relative-pointer/relative-pointer-unstable-v1.xml",
"//third_party/wayland-protocols/src/unstable/text-input/text-input-unstable-v1.xml",
"//third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v6.xml",
"//third_party/wayland-protocols/unstable/alpha-compositing/alpha-compositing-unstable-v1.xml",
"//third_party/wayland-protocols/unstable/cursor-shapes/cursor-shapes-unstable-v1.xml",
"//third_party/wayland-protocols/unstable/gaming-input/gaming-input-unstable-v2.xml",
Expand Down
1 change: 0 additions & 1 deletion components/exo/wayland/fuzzer/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ kDefaultWaylandProtocols = [
"//third_party/wayland-protocols/src/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml",
"//third_party/wayland-protocols/src/unstable/relative-pointer/relative-pointer-unstable-v1.xml",
"//third_party/wayland-protocols/src/unstable/text-input/text-input-unstable-v1.xml",
"//third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v6.xml",
"//third_party/wayland-protocols/unstable/alpha-compositing/alpha-compositing-unstable-v1.xml",
"//third_party/wayland-protocols/unstable/cursor-shapes/cursor-shapes-unstable-v1.xml",
"//third_party/wayland-protocols/unstable/gaming-input/gaming-input-unstable-v2.xml",
Expand Down
20 changes: 1 addition & 19 deletions components/exo/wayland/fuzzer/wayland_sequencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,25 +181,7 @@ def GetManualSequences(dep_graph):
c.RecordInterfaceCreated('wl_data_offer')

e = SequenceBuilder('empty', dep_graph)

p = SequenceBuilder('popup_configuration', dep_graph)
p_positioner = p.BuildInterface('zxdg_positioner_v6')
p_parent = p.BuildInterface('zxdg_toplevel_v6')
p.AppendCall('zxdg_surface_v6', 'set_window_geometry',
[('receiver', p_parent), ('x', 0), ('y', 0), ('width', 10),
('height', 10)])
p.AppendRoundTrip()
p.AppendCall('wl_surface', 'commit', [('receiver', p_parent)])
p.AppendRoundTrip()
p.AppendCall('zxdg_surface_v6', 'ack_configure', [('receiver', p_parent),
('serial', 1)])
p_child = p.BuildInterface('zxdg_surface_v6')
p.AppendCall('zxdg_surface_v6', 'get_popup', [('receiver', p_child),
('parent', p_parent),
('positioner', p_positioner)])
p.AppendRoundTrip()

return [c, e, p]
return [c, e]


def SequenceToTemplate(parsed_arguments, builder):
Expand Down
7 changes: 0 additions & 7 deletions components/exo/wayland/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include <xdg-decoration-unstable-v1-server-protocol.h>
#include <xdg-output-unstable-v1-server-protocol.h>
#include <xdg-shell-server-protocol.h>
#include <xdg-shell-unstable-v6-server-protocol.h>

#include <linux-dmabuf-unstable-v1-server-protocol.h>
#include <memory>
Expand Down Expand Up @@ -105,7 +104,6 @@
#include "components/exo/wayland/zwp_text_input_manager.h"
#include "components/exo/wayland/zxdg_decoration_manager.h"
#include "components/exo/wayland/zxdg_output_manager.h"
#include "components/exo/wayland/zxdg_shell.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/ozone/public/ozone_platform.h"
Expand Down Expand Up @@ -398,11 +396,6 @@ void Server::Initialize() {
zcr_text_input_extension_data_.get(),
bind_text_input_extension);

zxdg_shell_data_ =
std::make_unique<WaylandZxdgShell>(display_, serial_tracker_.get());
wl_global_create(wl_display_.get(), &zxdg_shell_v6_interface, 1,
zxdg_shell_data_.get(), bind_zxdg_shell_v6);

xdg_shell_data_ =
std::make_unique<WaylandXdgShell>(display_, serial_tracker_.get());
wl_global_create(wl_display_.get(), &xdg_wm_base_interface, 3,
Expand Down
2 changes: 0 additions & 2 deletions components/exo/wayland/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ struct WaylandSeat;
struct WaylandTextInputExtension;
struct WaylandTextInputManager;
struct WaylandXdgShell;
struct WaylandZxdgShell;
struct WaylandRemoteShellData;
class WaylandDmabufFeedbackManager;
class WestonTest;
Expand Down Expand Up @@ -135,7 +134,6 @@ class Server : public display::DisplayObserver {
std::unique_ptr<WaylandKeyboardExtension> zcr_keyboard_extension_data_;
std::unique_ptr<WaylandTextInputManager> zwp_text_manager_data_;
std::unique_ptr<WaylandTextInputExtension> zcr_text_input_extension_data_;
std::unique_ptr<WaylandZxdgShell> zxdg_shell_data_;
std::unique_ptr<WaylandXdgShell> xdg_shell_data_;
std::unique_ptr<WaylandRemoteShellData> remote_shell_data_;
std::unique_ptr<WestonTest> weston_test_holder_;
Expand Down
1 change: 0 additions & 1 deletion components/exo/wayland/test/test_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class TestClient {
wl_touch* touch() { return globals().touch.get(); }
zaura_shell* aura_shell() { return globals().aura_shell.get(); }
zaura_output* aura_output() { return globals().aura_output.get(); }
zxdg_shell_v6* xdg_shell_v6() { return globals().xdg_shell_v6.get(); }
xdg_wm_base* xdg_wm_base() { return globals().xdg_wm_base.get(); }
zwp_fullscreen_shell_v1* fullscreen_shell() {
return globals().fullscreen_shell.get();
Expand Down

0 comments on commit 37647e0

Please sign in to comment.