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

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: 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 d67da96ef1fbac542ffe2cfb0186d8e7dbf3bb0c..e73deeb3a3ee4c004bbf235a563bf84a2390508e 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 {
+ SendShellModeChange(ZWP_REMOTE_SHELL_V1_SHELL_MODE_TABLET);
+ }
+ void OnMaximizeModeEnded() override {
+ SendShellModeChange(ZWP_REMOTE_SHELL_V1_SHELL_MODE_WINDOWED);
+ }
// Overridden from aura::client::ActivationChangeObserver:
void OnWindowActivated(
@@ -1595,6 +1612,11 @@ class WaylandRemoteShell : public ash::ShellObserver,
wl_client_flush(wl_resource_get_client(remote_shell_resource_));
}
+ void SendShellModeChange(int mode) {
+ zwp_remote_shell_v1_send_shell_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;

Powered by Google App Engine
This is Rietveld 408576698