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

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

Issue 2104473002: third_party: Update to version 8 of remote_shell_protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [WIP]: third_party: Update to version 6 of remote_shell_protocol 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 cd60d5e4ae46fef936643a7bbbc716c21ce3537b..9d01332dfc3a114b112555128439b6ad7a8c2c79 100644
--- a/components/exo/wayland/server.cc
+++ b/components/exo/wayland/server.cc
@@ -1496,6 +1496,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,
@@ -1510,7 +1519,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:
@@ -1572,6 +1583,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(
@@ -1594,6 +1611,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;
@@ -1779,7 +1803,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