Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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_autohide_systemui(wl_client* client, | |
| 1982 wl_resource* resource, | |
| 1983 uint32_t autohide) { | |
| 1984 GetUserDataAs<ShellSurface>(resource)->SetAutohideShelf(autohide); | |
| 1985 } | |
| 1986 | |
| 1981 void remote_surface_ack_configure(wl_client* client, | 1987 void remote_surface_ack_configure(wl_client* client, |
| 1982 wl_resource* resource, | 1988 wl_resource* resource, |
| 1983 uint32_t serial) { | 1989 uint32_t serial) { |
| 1984 GetUserDataAs<ShellSurface>(resource)->AcknowledgeConfigure(serial); | 1990 GetUserDataAs<ShellSurface>(resource)->AcknowledgeConfigure(serial); |
| 1985 } | 1991 } |
| 1986 | 1992 |
| 1987 void remote_surface_move(wl_client* client, wl_resource* resource) { | 1993 void remote_surface_move(wl_client* client, wl_resource* resource) { |
| 1988 GetUserDataAs<ShellSurface>(resource)->Move(); | 1994 GetUserDataAs<ShellSurface>(resource)->Move(); |
| 1989 } | 1995 } |
| 1990 | 1996 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 2001 remote_surface_maximize, | 2007 remote_surface_maximize, |
| 2002 remote_surface_minimize, | 2008 remote_surface_minimize, |
| 2003 remote_surface_restore, | 2009 remote_surface_restore, |
| 2004 remote_surface_fullscreen, | 2010 remote_surface_fullscreen, |
| 2005 remote_surface_unfullscreen, | 2011 remote_surface_unfullscreen, |
| 2006 remote_surface_pin, | 2012 remote_surface_pin, |
| 2007 remote_surface_unpin, | 2013 remote_surface_unpin, |
| 2008 remote_surface_set_system_modal, | 2014 remote_surface_set_system_modal, |
| 2009 remote_surface_unset_system_modal, | 2015 remote_surface_unset_system_modal, |
| 2010 remote_surface_set_rectangular_surface_shadow, | 2016 remote_surface_set_rectangular_surface_shadow, |
| 2017 remote_surface_set_autohide_systemui, | |
| 2011 remote_surface_ack_configure, | 2018 remote_surface_ack_configure, |
| 2012 remote_surface_move}; | 2019 remote_surface_move}; |
| 2013 | 2020 |
| 2014 //////////////////////////////////////////////////////////////////////////////// | 2021 //////////////////////////////////////////////////////////////////////////////// |
| 2015 // notification_surface_interface: | 2022 // notification_surface_interface: |
| 2016 | 2023 |
| 2017 void notification_surface_destroy(wl_client* client, wl_resource* resource) { | 2024 void notification_surface_destroy(wl_client* client, wl_resource* resource) { |
| 2018 wl_resource_destroy(resource); | 2025 wl_resource_destroy(resource); |
| 2019 } | 2026 } |
| 2020 | 2027 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 2047 SendActivated(helper->GetActiveWindow(), nullptr); | 2054 SendActivated(helper->GetActiveWindow(), nullptr); |
| 2048 } | 2055 } |
| 2049 ~WaylandRemoteShell() override { | 2056 ~WaylandRemoteShell() override { |
| 2050 auto* helper = WMHelper::GetInstance(); | 2057 auto* helper = WMHelper::GetInstance(); |
| 2051 helper->RemoveMaximizeModeObserver(this); | 2058 helper->RemoveMaximizeModeObserver(this); |
| 2052 helper->RemoveActivationObserver(this); | 2059 helper->RemoveActivationObserver(this); |
| 2053 display::Screen::GetScreen()->RemoveObserver(this); | 2060 display::Screen::GetScreen()->RemoveObserver(this); |
| 2054 } | 2061 } |
| 2055 | 2062 |
| 2056 bool IsMultiDisplaySupported() const { | 2063 bool IsMultiDisplaySupported() const { |
| 2057 return wl_resource_get_version(remote_shell_resource_) >= 3; | 2064 return wl_resource_get_version(remote_shell_resource_) >= 4; |
| 2058 } | 2065 } |
| 2059 | 2066 |
| 2060 std::unique_ptr<ShellSurface> CreateShellSurface(Surface* surface, | 2067 std::unique_ptr<ShellSurface> CreateShellSurface(Surface* surface, |
| 2061 int container) { | 2068 int container) { |
| 2062 return display_->CreateRemoteShellSurface(surface, container); | 2069 return display_->CreateRemoteShellSurface(surface, container); |
| 2063 } | 2070 } |
| 2064 | 2071 |
| 2065 std::unique_ptr<NotificationSurface> CreateNotificationSurface( | 2072 std::unique_ptr<NotificationSurface> CreateNotificationSurface( |
| 2066 Surface* surface, | 2073 Surface* surface, |
| 2067 const std::string& notification_id) { | 2074 const std::string& notification_id) { |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2340 wl_resource_get_version(resource), id); | 2347 wl_resource_get_version(resource), id); |
| 2341 SetImplementation(notification_surface_resource, | 2348 SetImplementation(notification_surface_resource, |
| 2342 ¬ification_surface_implementation, | 2349 ¬ification_surface_implementation, |
| 2343 std::move(notification_surface)); | 2350 std::move(notification_surface)); |
| 2344 } | 2351 } |
| 2345 | 2352 |
| 2346 const struct zcr_remote_shell_v1_interface remote_shell_implementation = { | 2353 const struct zcr_remote_shell_v1_interface remote_shell_implementation = { |
| 2347 remote_shell_destroy, remote_shell_get_remote_surface, | 2354 remote_shell_destroy, remote_shell_get_remote_surface, |
| 2348 remote_shell_get_notification_surface}; | 2355 remote_shell_get_notification_surface}; |
| 2349 | 2356 |
| 2350 const uint32_t remote_shell_version = 3; | 2357 const uint32_t remote_shell_version = 3; |
|
Dominik Laskowski
2017/03/28 18:07:31
4.
yorkelee
2017/03/28 20:52:43
Done.
| |
| 2351 | 2358 |
| 2352 void bind_remote_shell(wl_client* client, | 2359 void bind_remote_shell(wl_client* client, |
| 2353 void* data, | 2360 void* data, |
| 2354 uint32_t version, | 2361 uint32_t version, |
| 2355 uint32_t id) { | 2362 uint32_t id) { |
| 2356 wl_resource* resource = | 2363 wl_resource* resource = |
| 2357 wl_resource_create(client, &zcr_remote_shell_v1_interface, | 2364 wl_resource_create(client, &zcr_remote_shell_v1_interface, |
| 2358 std::min(version, remote_shell_version), id); | 2365 std::min(version, remote_shell_version), id); |
| 2359 | 2366 |
| 2360 SetImplementation(resource, &remote_shell_implementation, | 2367 SetImplementation(resource, &remote_shell_implementation, |
| (...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3914 DCHECK(event_loop); | 3921 DCHECK(event_loop); |
| 3915 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); | 3922 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); |
| 3916 } | 3923 } |
| 3917 | 3924 |
| 3918 void Server::Flush() { | 3925 void Server::Flush() { |
| 3919 wl_display_flush_clients(wl_display_.get()); | 3926 wl_display_flush_clients(wl_display_.get()); |
| 3920 } | 3927 } |
| 3921 | 3928 |
| 3922 } // namespace wayland | 3929 } // namespace wayland |
| 3923 } // namespace exo | 3930 } // namespace exo |
| OLD | NEW |