| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/base/x/active_window_watcher_x.h" | 5 #include "ui/base/x/active_window_watcher_x.h" |
| 6 | 6 |
| 7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
| 8 #include <gdk/gdkx.h> | 8 #include <gdk/gdkx.h> |
| 9 |
| 10 #include "base/memory/singleton.h" |
| 11 #include "ui/base/gtk/gdk_x_compat.h" |
| 9 #include "ui/base/gtk/gtk_compat.h" | 12 #include "ui/base/gtk/gtk_compat.h" |
| 10 #include "ui/base/gtk/gdk_x_compat.h" | |
| 11 | |
| 12 #include "ui/base/x/active_window_watcher_x_observer.h" | 13 #include "ui/base/x/active_window_watcher_x_observer.h" |
| 13 #include "ui/base/x/root_window_property_watcher_x.h" | 14 #include "ui/base/x/root_window_property_watcher_x.h" |
| 14 #include "ui/base/x/x11_util.h" | 15 #include "ui/base/x/x11_util.h" |
| 15 | 16 |
| 16 namespace ui { | 17 namespace ui { |
| 17 | 18 |
| 18 static const char* const kNetActiveWindow = "_NET_ACTIVE_WINDOW"; | 19 static const char* const kNetActiveWindow = "_NET_ACTIVE_WINDOW"; |
| 19 | 20 |
| 20 // static | 21 // static |
| 21 ActiveWindowWatcherX* ActiveWindowWatcherX::GetInstance() { | 22 ActiveWindowWatcherX* ActiveWindowWatcherX::GetInstance() { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 GdkDisplay* display = gdk_display_get_default(); | 90 GdkDisplay* display = gdk_display_get_default(); |
| 90 GdkWindow* active_window = gdk_x11_window_lookup_for_display(display, xid); | 91 GdkWindow* active_window = gdk_x11_window_lookup_for_display(display, xid); |
| 91 FOR_EACH_OBSERVER(ActiveWindowWatcherXObserver, observers_, | 92 FOR_EACH_OBSERVER(ActiveWindowWatcherXObserver, observers_, |
| 92 ActiveWindowChanged(active_window)); | 93 ActiveWindowChanged(active_window)); |
| 93 } | 94 } |
| 94 if (property) | 95 if (property) |
| 95 XFree(property); | 96 XFree(property); |
| 96 } | 97 } |
| 97 | 98 |
| 98 } // namespace ui | 99 } // namespace ui |
| OLD | NEW |