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

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

Issue 2785283003: Add set_autohide_systemui to wayland protocol (Closed)
Patch Set: 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 NOTIMPLEMENTED(); 1995 NOTIMPLEMENTED();
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, gfx::Point(), container); 2070 return display_->CreateRemoteShellSurface(surface, gfx::Point(), 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
2309 wl_resource_get_version(resource), id); 2317 wl_resource_get_version(resource), id);
2310 SetImplementation(notification_surface_resource, 2318 SetImplementation(notification_surface_resource,
2311 &notification_surface_implementation, 2319 &notification_surface_implementation,
2312 std::move(notification_surface)); 2320 std::move(notification_surface));
2313 } 2321 }
2314 2322
2315 const struct zcr_remote_shell_v1_interface remote_shell_implementation = { 2323 const struct zcr_remote_shell_v1_interface remote_shell_implementation = {
2316 remote_shell_destroy, remote_shell_get_remote_surface, 2324 remote_shell_destroy, remote_shell_get_remote_surface,
2317 remote_shell_get_notification_surface}; 2325 remote_shell_get_notification_surface};
2318 2326
2319 const uint32_t remote_shell_version = 2; 2327 const uint32_t remote_shell_version = 4;
2320 2328
2321 void bind_remote_shell(wl_client* client, 2329 void bind_remote_shell(wl_client* client,
2322 void* data, 2330 void* data,
2323 uint32_t version, 2331 uint32_t version,
2324 uint32_t id) { 2332 uint32_t id) {
2325 wl_resource* resource = 2333 wl_resource* resource =
2326 wl_resource_create(client, &zcr_remote_shell_v1_interface, 2334 wl_resource_create(client, &zcr_remote_shell_v1_interface,
2327 std::min(version, remote_shell_version), id); 2335 std::min(version, remote_shell_version), id);
2328 2336
2329 SetImplementation(resource, &remote_shell_implementation, 2337 SetImplementation(resource, &remote_shell_implementation,
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after
3883 DCHECK(event_loop); 3891 DCHECK(event_loop);
3884 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); 3892 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds());
3885 } 3893 }
3886 3894
3887 void Server::Flush() { 3895 void Server::Flush() {
3888 wl_display_flush_clients(wl_display_.get()); 3896 wl_display_flush_clients(wl_display_.get());
3889 } 3897 }
3890 3898
3891 } // namespace wayland 3899 } // namespace wayland
3892 } // namespace exo 3900 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698