OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/widget/desktop_aura/desktop_screen_x11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_screen_x11.h" |
6 | 6 |
7 #include <X11/extensions/Xrandr.h> | 7 #include <X11/extensions/Xrandr.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 | 9 |
10 // It clashes with out RootWindow. | 10 // It clashes with out RootWindow. |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 218 |
219 void DesktopScreenX11::RemoveObserver(gfx::DisplayObserver* observer) { | 219 void DesktopScreenX11::RemoveObserver(gfx::DisplayObserver* observer) { |
220 change_notifier_.RemoveObserver(observer); | 220 change_notifier_.RemoveObserver(observer); |
221 } | 221 } |
222 | 222 |
223 bool DesktopScreenX11::CanDispatchEvent(const ui::PlatformEvent& event) { | 223 bool DesktopScreenX11::CanDispatchEvent(const ui::PlatformEvent& event) { |
224 return event->type - xrandr_event_base_ == RRScreenChangeNotify || | 224 return event->type - xrandr_event_base_ == RRScreenChangeNotify || |
225 event->type - xrandr_event_base_ == RRNotify; | 225 event->type - xrandr_event_base_ == RRNotify; |
226 } | 226 } |
227 | 227 |
228 uint32_t DesktopScreenX11::DispatchEvent(const ui::PlatformEvent& event) { | 228 ui::PostDispatchAction DesktopScreenX11::DispatchEvent( |
| 229 const ui::PlatformEvent& event) { |
229 if (event->type - xrandr_event_base_ == RRScreenChangeNotify) { | 230 if (event->type - xrandr_event_base_ == RRScreenChangeNotify) { |
230 // Pass the event through to xlib. | 231 // Pass the event through to xlib. |
231 XRRUpdateConfiguration(event); | 232 XRRUpdateConfiguration(event); |
232 } else if (event->type - xrandr_event_base_ == RRNotify) { | 233 } else if (event->type - xrandr_event_base_ == RRNotify) { |
233 // There's some sort of observer dispatch going on here, but I don't think | 234 // There's some sort of observer dispatch going on here, but I don't think |
234 // it's the screen's? | 235 // it's the screen's? |
235 if (configure_timer_.get() && configure_timer_->IsRunning()) { | 236 if (configure_timer_.get() && configure_timer_->IsRunning()) { |
236 configure_timer_->Reset(); | 237 configure_timer_->Reset(); |
237 } else { | 238 } else { |
238 configure_timer_.reset(new base::OneShotTimer<DesktopScreenX11>()); | 239 configure_timer_.reset(new base::OneShotTimer<DesktopScreenX11>()); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 change_notifier_.NotifyDisplaysChanged(old_displays, displays_); | 363 change_notifier_.NotifyDisplaysChanged(old_displays, displays_); |
363 } | 364 } |
364 | 365 |
365 //////////////////////////////////////////////////////////////////////////////// | 366 //////////////////////////////////////////////////////////////////////////////// |
366 | 367 |
367 gfx::Screen* CreateDesktopScreen() { | 368 gfx::Screen* CreateDesktopScreen() { |
368 return new DesktopScreenX11; | 369 return new DesktopScreenX11; |
369 } | 370 } |
370 | 371 |
371 } // namespace views | 372 } // namespace views |
OLD | NEW |