| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_AURA_DISPLAY_CHANGE_OBSERVER_X11_H | |
| 6 #define UI_AURA_DISPLAY_CHANGE_OBSERVER_X11_H | |
| 7 | |
| 8 #include <X11/Xlib.h> | |
| 9 | |
| 10 // Xlib.h defines RootWindow. | |
| 11 #undef RootWindow | |
| 12 | |
| 13 #include "base/basictypes.h" | |
| 14 #include "base/message_loop.h" | |
| 15 | |
| 16 namespace aura { | |
| 17 namespace internal { | |
| 18 | |
| 19 // An object that observes changes in display configuration and | |
| 20 // update DisplayManagers. | |
| 21 class DisplayChangeObserverX11 : public MessageLoop::Dispatcher { | |
| 22 public: | |
| 23 DisplayChangeObserverX11(); | |
| 24 virtual ~DisplayChangeObserverX11(); | |
| 25 | |
| 26 // Overridden from Dispatcher overrides: | |
| 27 virtual bool Dispatch(const base::NativeEvent& xev) OVERRIDE; | |
| 28 | |
| 29 // Reads display configurations from the system and notifies | |
| 30 // |display_manager_| about the change. | |
| 31 void NotifyDisplayChange(); | |
| 32 | |
| 33 private: | |
| 34 Display* xdisplay_; | |
| 35 | |
| 36 ::Window x_root_window_; | |
| 37 | |
| 38 int xrandr_event_base_; | |
| 39 | |
| 40 DISALLOW_COPY_AND_ASSIGN(DisplayChangeObserverX11); | |
| 41 }; | |
| 42 | |
| 43 } // namespace internal | |
| 44 } // namespace aura | |
| 45 | |
| 46 #endif // UI_AURA_DISPLAY_CHANGE_OBSERVER_X11_H | |
| OLD | NEW |