Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Unified Diff: components/exo/wayland/server.cc

Issue 2109303003: third_party: Update to version 8 of remote_shell_protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/exo/wayland/server.cc
diff --git a/components/exo/wayland/server.cc b/components/exo/wayland/server.cc
index e6368d98980c5f4df9244f5faf6f38815d121a82..55df4d18b6cc7c186fe6701ecbf06b58ba0c81ca 100644
--- a/components/exo/wayland/server.cc
+++ b/components/exo/wayland/server.cc
@@ -1497,6 +1497,15 @@ void remote_surface_set_top_inset(wl_client* client,
GetUserDataAs<ShellSurface>(resource)->SetTopInset(height);
}
+void remote_surface_set_system_modal(wl_client* client, wl_resource* resource) {
+ GetUserDataAs<ShellSurface>(resource)->SetSystemModal(true);
+}
+
+void remote_surface_unset_system_modal(wl_client* client,
+ wl_resource* resource) {
+ GetUserDataAs<ShellSurface>(resource)->SetSystemModal(false);
+}
+
const struct zwp_remote_surface_v1_interface remote_surface_implementation = {
remote_surface_destroy,
remote_surface_set_app_id,
@@ -1511,7 +1520,9 @@ const struct zwp_remote_surface_v1_interface remote_surface_implementation = {
remote_surface_unfullscreen,
remote_surface_set_rectangular_shadow,
remote_surface_set_title,
- remote_surface_set_top_inset};
+ remote_surface_set_top_inset,
+ remote_surface_set_system_modal,
+ remote_surface_unset_system_modal};
////////////////////////////////////////////////////////////////////////////////
// notification_surface_interface:
@@ -1573,6 +1584,12 @@ class WaylandRemoteShell : public ash::ShellObserver,
// Overridden from ash::ShellObserver:
void OnDisplayWorkAreaInsetsChanged() override { SendConfigure(); }
+ void OnMaximizeModeStarted() override {
+ SendLayoutModeChange(ZWP_REMOTE_SHELL_V1_LAYOUT_MODE_TABLET);
+ }
+ void OnMaximizeModeEnded() override {
+ SendLayoutModeChange(ZWP_REMOTE_SHELL_V1_LAYOUT_MODE_WINDOWED);
+ }
// Overridden from aura::client::ActivationChangeObserver:
void OnWindowActivated(
@@ -1595,6 +1612,13 @@ class WaylandRemoteShell : public ash::ShellObserver,
wl_client_flush(wl_resource_get_client(remote_shell_resource_));
}
+ void SendLayoutModeChange(int mode) {
+ if (wl_resource_get_version(remote_shell_resource_) < 8)
+ return;
+ zwp_remote_shell_v1_send_layout_mode_changed(remote_shell_resource_, mode);
+ wl_client_flush(wl_resource_get_client(remote_shell_resource_));
+ }
+
void SendActivated(aura::Window* gained_active, aura::Window* lost_active) {
Surface* gained_active_surface =
gained_active ? ShellSurface::GetMainSurface(gained_active) : nullptr;
@@ -1780,7 +1804,7 @@ const struct zwp_remote_shell_v1_interface remote_shell_implementation = {
remote_shell_destroy, remote_shell_get_remote_surface,
remote_shell_get_notification_surface};
-const uint32_t remote_shell_version = 6;
+const uint32_t remote_shell_version = 8;
void bind_remote_shell(wl_client* client,
void* data,

Powered by Google App Engine
This is Rietveld 408576698