| 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 2109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2120 weak_ptr_factory_.GetWeakPtr()), | 2120 weak_ptr_factory_.GetWeakPtr()), |
| 2121 base::TimeDelta::FromMilliseconds(delay_ms)); | 2121 base::TimeDelta::FromMilliseconds(delay_ms)); |
| 2122 } | 2122 } |
| 2123 | 2123 |
| 2124 void SendDisplayMetrics() { | 2124 void SendDisplayMetrics() { |
| 2125 if (!needs_send_display_metrics_) | 2125 if (!needs_send_display_metrics_) |
| 2126 return; | 2126 return; |
| 2127 needs_send_display_metrics_ = false; | 2127 needs_send_display_metrics_ = false; |
| 2128 | 2128 |
| 2129 const display::Screen* screen = display::Screen::GetScreen(); | 2129 const display::Screen* screen = display::Screen::GetScreen(); |
| 2130 display::Display primary_display = screen->GetPrimaryDisplay(); | |
| 2131 | 2130 |
| 2132 if (IsMultiDisplaySupported()) { | 2131 if (IsMultiDisplaySupported()) { |
| 2133 for (const auto& display : screen->GetAllDisplays()) { | 2132 for (const auto& display : screen->GetAllDisplays()) { |
| 2134 const gfx::Rect& bounds = display.bounds(); | 2133 const gfx::Rect& bounds = display.bounds(); |
| 2135 const gfx::Insets& insets = display.GetWorkAreaInsets(); | 2134 const gfx::Insets& insets = display.GetWorkAreaInsets(); |
| 2136 | 2135 |
| 2137 zcr_remote_shell_v1_send_workspace( | 2136 zcr_remote_shell_v1_send_workspace( |
| 2138 remote_shell_resource_, | 2137 remote_shell_resource_, |
| 2139 static_cast<uint32_t>(display.id() >> 32), | 2138 static_cast<uint32_t>(display.id() >> 32), |
| 2140 static_cast<uint32_t>(display.id()), | 2139 static_cast<uint32_t>(display.id()), |
| 2141 bounds.x(), bounds.y(), bounds.width(), bounds.height(), | 2140 bounds.x(), bounds.y(), bounds.width(), bounds.height(), |
| 2142 insets.left(), insets.top(), insets.right(), insets.bottom()); | 2141 insets.left(), insets.top(), insets.right(), insets.bottom(), |
| 2142 OutputTransform(display.rotation()), |
| 2143 wl_fixed_from_double(display.device_scale_factor())); |
| 2143 } | 2144 } |
| 2144 | 2145 |
| 2145 zcr_remote_shell_v1_send_configure( | 2146 zcr_remote_shell_v1_send_configure(remote_shell_resource_, layout_mode_); |
| 2146 remote_shell_resource_, | |
| 2147 static_cast<uint32_t>(primary_display.id() >> 32), | |
| 2148 static_cast<uint32_t>(primary_display.id()), | |
| 2149 OutputTransform(primary_display.rotation()), | |
| 2150 wl_fixed_from_double(primary_display.device_scale_factor()), | |
| 2151 layout_mode_); | |
| 2152 } | 2147 } |
| 2153 | 2148 |
| 2149 display::Display primary_display = screen->GetPrimaryDisplay(); |
| 2154 const gfx::Insets& insets = primary_display.GetWorkAreaInsets(); | 2150 const gfx::Insets& insets = primary_display.GetWorkAreaInsets(); |
| 2155 | 2151 |
| 2156 zcr_remote_shell_v1_send_configuration_changed( | 2152 zcr_remote_shell_v1_send_configuration_changed( |
| 2157 remote_shell_resource_, | 2153 remote_shell_resource_, |
| 2158 primary_display.size().width(), | 2154 primary_display.size().width(), |
| 2159 primary_display.size().height(), | 2155 primary_display.size().height(), |
| 2160 OutputTransform(primary_display.rotation()), | 2156 OutputTransform(primary_display.rotation()), |
| 2161 wl_fixed_from_double(primary_display.device_scale_factor()), | 2157 wl_fixed_from_double(primary_display.device_scale_factor()), |
| 2162 insets.left(), insets.top(), insets.right(), insets.bottom(), | 2158 insets.left(), insets.top(), insets.right(), insets.bottom(), |
| 2163 layout_mode_); | 2159 layout_mode_); |
| (...skipping 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3918 DCHECK(event_loop); | 3914 DCHECK(event_loop); |
| 3919 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); | 3915 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); |
| 3920 } | 3916 } |
| 3921 | 3917 |
| 3922 void Server::Flush() { | 3918 void Server::Flush() { |
| 3923 wl_display_flush_clients(wl_display_.get()); | 3919 wl_display_flush_clients(wl_display_.get()); |
| 3924 } | 3920 } |
| 3925 | 3921 |
| 3926 } // namespace wayland | 3922 } // namespace wayland |
| 3927 } // namespace exo | 3923 } // namespace exo |
| OLD | NEW |