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

Side by Side Diff: components/exo/wayland/server.cc

Issue 2777373002: Add set_autohide_systemui to wayland protocol (Closed)
Patch Set: Add set_systemui_visibility to wayland Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/exo/wayland/server.h" 5 #include "components/exo/wayland/server.h"
6 6
7 #include <alpha-compositing-unstable-v1-server-protocol.h> 7 #include <alpha-compositing-unstable-v1-server-protocol.h>
8 #include <gaming-input-unstable-v1-server-protocol.h> 8 #include <gaming-input-unstable-v1-server-protocol.h>
9 #include <gaming-input-unstable-v2-server-protocol.h> 9 #include <gaming-input-unstable-v2-server-protocol.h>
10 #include <grp.h> 10 #include <grp.h>
(...skipping 1960 matching lines...) Expand 10 before | Expand all | Expand 10 after
1971 wl_resource* resource, 1971 wl_resource* resource,
1972 int32_t x, 1972 int32_t x,
1973 int32_t y, 1973 int32_t y,
1974 int32_t width, 1974 int32_t width,
1975 int32_t height) { 1975 int32_t height) {
1976 ShellSurface* shell_surface = GetUserDataAs<ShellSurface>(resource); 1976 ShellSurface* shell_surface = GetUserDataAs<ShellSurface>(resource);
1977 gfx::Rect content_bounds(x, y, width, height); 1977 gfx::Rect content_bounds(x, y, width, height);
1978 shell_surface->SetRectangularSurfaceShadow(content_bounds); 1978 shell_surface->SetRectangularSurfaceShadow(content_bounds);
1979 } 1979 }
1980 1980
1981 void remote_surface_set_systemui_visibility(wl_client* client,
1982 wl_resource* resource,
1983 uint32_t visibility) {
1984 GetUserDataAs<ShellSurface>(resource)->SetSystemUiVisibility(
1985 visibility != ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_VISIBLE);
1986 }
1987
1981 void remote_surface_ack_configure(wl_client* client, 1988 void remote_surface_ack_configure(wl_client* client,
1982 wl_resource* resource, 1989 wl_resource* resource,
1983 uint32_t serial) { 1990 uint32_t serial) {
1984 GetUserDataAs<ShellSurface>(resource)->AcknowledgeConfigure(serial); 1991 GetUserDataAs<ShellSurface>(resource)->AcknowledgeConfigure(serial);
1985 } 1992 }
1986 1993
1987 void remote_surface_move(wl_client* client, wl_resource* resource) { 1994 void remote_surface_move(wl_client* client, wl_resource* resource) {
1988 GetUserDataAs<ShellSurface>(resource)->Move(); 1995 GetUserDataAs<ShellSurface>(resource)->Move();
1989 } 1996 }
1990 1997
(...skipping 10 matching lines...) Expand all
2001 remote_surface_maximize, 2008 remote_surface_maximize,
2002 remote_surface_minimize, 2009 remote_surface_minimize,
2003 remote_surface_restore, 2010 remote_surface_restore,
2004 remote_surface_fullscreen, 2011 remote_surface_fullscreen,
2005 remote_surface_unfullscreen, 2012 remote_surface_unfullscreen,
2006 remote_surface_pin, 2013 remote_surface_pin,
2007 remote_surface_unpin, 2014 remote_surface_unpin,
2008 remote_surface_set_system_modal, 2015 remote_surface_set_system_modal,
2009 remote_surface_unset_system_modal, 2016 remote_surface_unset_system_modal,
2010 remote_surface_set_rectangular_surface_shadow, 2017 remote_surface_set_rectangular_surface_shadow,
2018 remote_surface_set_systemui_visibility,
2011 remote_surface_ack_configure, 2019 remote_surface_ack_configure,
2012 remote_surface_move}; 2020 remote_surface_move};
2013 2021
2014 //////////////////////////////////////////////////////////////////////////////// 2022 ////////////////////////////////////////////////////////////////////////////////
2015 // notification_surface_interface: 2023 // notification_surface_interface:
2016 2024
2017 void notification_surface_destroy(wl_client* client, wl_resource* resource) { 2025 void notification_surface_destroy(wl_client* client, wl_resource* resource) {
2018 wl_resource_destroy(resource); 2026 wl_resource_destroy(resource);
2019 } 2027 }
2020 2028
(...skipping 26 matching lines...) Expand all
2047 SendActivated(helper->GetActiveWindow(), nullptr); 2055 SendActivated(helper->GetActiveWindow(), nullptr);
2048 } 2056 }
2049 ~WaylandRemoteShell() override { 2057 ~WaylandRemoteShell() override {
2050 auto* helper = WMHelper::GetInstance(); 2058 auto* helper = WMHelper::GetInstance();
2051 helper->RemoveMaximizeModeObserver(this); 2059 helper->RemoveMaximizeModeObserver(this);
2052 helper->RemoveActivationObserver(this); 2060 helper->RemoveActivationObserver(this);
2053 display::Screen::GetScreen()->RemoveObserver(this); 2061 display::Screen::GetScreen()->RemoveObserver(this);
2054 } 2062 }
2055 2063
2056 bool IsMultiDisplaySupported() const { 2064 bool IsMultiDisplaySupported() const {
2057 return wl_resource_get_version(remote_shell_resource_) >= 3; 2065 return wl_resource_get_version(remote_shell_resource_) >= 4;
2058 } 2066 }
2059 2067
2060 std::unique_ptr<ShellSurface> CreateShellSurface(Surface* surface, 2068 std::unique_ptr<ShellSurface> CreateShellSurface(Surface* surface,
2061 int container) { 2069 int container) {
2062 return display_->CreateRemoteShellSurface(surface, container); 2070 return display_->CreateRemoteShellSurface(surface, container);
2063 } 2071 }
2064 2072
2065 std::unique_ptr<NotificationSurface> CreateNotificationSurface( 2073 std::unique_ptr<NotificationSurface> CreateNotificationSurface(
2066 Surface* surface, 2074 Surface* surface,
2067 const std::string& notification_id) { 2075 const std::string& notification_id) {
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
2340 wl_resource_get_version(resource), id); 2348 wl_resource_get_version(resource), id);
2341 SetImplementation(notification_surface_resource, 2349 SetImplementation(notification_surface_resource,
2342 &notification_surface_implementation, 2350 &notification_surface_implementation,
2343 std::move(notification_surface)); 2351 std::move(notification_surface));
2344 } 2352 }
2345 2353
2346 const struct zcr_remote_shell_v1_interface remote_shell_implementation = { 2354 const struct zcr_remote_shell_v1_interface remote_shell_implementation = {
2347 remote_shell_destroy, remote_shell_get_remote_surface, 2355 remote_shell_destroy, remote_shell_get_remote_surface,
2348 remote_shell_get_notification_surface}; 2356 remote_shell_get_notification_surface};
2349 2357
2350 const uint32_t remote_shell_version = 3; 2358 const uint32_t remote_shell_version = 4;
2351 2359
2352 void bind_remote_shell(wl_client* client, 2360 void bind_remote_shell(wl_client* client,
2353 void* data, 2361 void* data,
2354 uint32_t version, 2362 uint32_t version,
2355 uint32_t id) { 2363 uint32_t id) {
2356 wl_resource* resource = 2364 wl_resource* resource =
2357 wl_resource_create(client, &zcr_remote_shell_v1_interface, 2365 wl_resource_create(client, &zcr_remote_shell_v1_interface,
2358 std::min(version, remote_shell_version), id); 2366 std::min(version, remote_shell_version), id);
2359 2367
2360 SetImplementation(resource, &remote_shell_implementation, 2368 SetImplementation(resource, &remote_shell_implementation,
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after
3914 DCHECK(event_loop); 3922 DCHECK(event_loop);
3915 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); 3923 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds());
3916 } 3924 }
3917 3925
3918 void Server::Flush() { 3926 void Server::Flush() {
3919 wl_display_flush_clients(wl_display_.get()); 3927 wl_display_flush_clients(wl_display_.get());
3920 } 3928 }
3921 3929
3922 } // namespace wayland 3930 } // namespace wayland
3923 } // namespace exo 3931 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698