summaryrefslogtreecommitdiffstats
path: root/ash/display/display_change_observer_x11.h
blob: e0456fcb4c8229d20e1ee94898039e4ab059614f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_X11_H
#define ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_X11_H

#include <X11/Xlib.h>

// Xlib.h defines RootWindow.
#undef RootWindow

#include "base/basictypes.h"
#include "chromeos/display/output_configurator.h"

namespace ash {
namespace internal {

// An object that observes changes in display configuration and
// update DisplayManagers.
class DisplayChangeObserverX11 : public chromeos::OutputConfigurator::Observer {
 public:
  DisplayChangeObserverX11();
  virtual ~DisplayChangeObserverX11();

  // Overriden from chromeos::OutputConfigurator::Observer:
  virtual void OnDisplayModeChanged() OVERRIDE;

 private:
  Display* xdisplay_;

  ::Window x_root_window_;

  int xrandr_event_base_;

  DISALLOW_COPY_AND_ASSIGN(DisplayChangeObserverX11);
};

}  // namespace internal
}  // namespace ash

#endif  // ASH_DISPLAY_AURA_DISPLAY_CHANGE_OBSERVER_X11_H