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 // This file defines utility functions for X11 (Linux only). This code has been | 5 // This file defines utility functions for X11 (Linux only). This code has been |
6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support | 6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support |
7 // remains woefully incomplete. | 7 // remains woefully incomplete. |
8 | 8 |
9 #include "ui/base/x/x11_util.h" | 9 #include "ui/base/x/x11_util.h" |
10 | 10 |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 XID GetX11RootWindow() { | 318 XID GetX11RootWindow() { |
319 return DefaultRootWindow(GetXDisplay()); | 319 return DefaultRootWindow(GetXDisplay()); |
320 } | 320 } |
321 | 321 |
322 bool GetCurrentDesktop(int* desktop) { | 322 bool GetCurrentDesktop(int* desktop) { |
323 return GetIntProperty(GetX11RootWindow(), "_NET_CURRENT_DESKTOP", desktop); | 323 return GetIntProperty(GetX11RootWindow(), "_NET_CURRENT_DESKTOP", desktop); |
324 } | 324 } |
325 | 325 |
326 #if defined(TOOLKIT_USES_GTK) | 326 #if defined(TOOLKIT_USES_GTK) |
327 XID GetX11WindowFromGtkWidget(GtkWidget* widget) { | 327 XID GetX11WindowFromGtkWidget(GtkWidget* widget) { |
328 return GDK_WINDOW_XID(widget->window); | 328 return GDK_WINDOW_XID(gtk_widget_get_window(widget)); |
329 } | 329 } |
330 | 330 |
331 XID GetX11WindowFromGdkWindow(GdkWindow* window) { | 331 XID GetX11WindowFromGdkWindow(GdkWindow* window) { |
332 return GDK_WINDOW_XID(window); | 332 return GDK_WINDOW_XID(window); |
333 } | 333 } |
334 | 334 |
335 GtkWindow* GetGtkWindowFromX11Window(XID xid) { | 335 GtkWindow* GetGtkWindowFromX11Window(XID xid) { |
336 GdkWindow* gdk_window = | 336 GdkWindow* gdk_window = |
337 gdk_x11_window_lookup_for_display(gdk_display_get_default(), xid); | 337 gdk_x11_window_lookup_for_display(gdk_display_get_default(), xid); |
338 if (!gdk_window) | 338 if (!gdk_window) |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 << "request_code " << static_cast<int>(error_event.request_code) << ", " | 1089 << "request_code " << static_cast<int>(error_event.request_code) << ", " |
1090 << "minor_code " << static_cast<int>(error_event.minor_code) | 1090 << "minor_code " << static_cast<int>(error_event.minor_code) |
1091 << " (" << request_str << ")"; | 1091 << " (" << request_str << ")"; |
1092 } | 1092 } |
1093 | 1093 |
1094 // ---------------------------------------------------------------------------- | 1094 // ---------------------------------------------------------------------------- |
1095 // End of x11_util_internal.h | 1095 // End of x11_util_internal.h |
1096 | 1096 |
1097 | 1097 |
1098 } // namespace ui | 1098 } // namespace ui |
OLD | NEW |