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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 gdk_window_get_user_data(gdk_window, | 460 gdk_window_get_user_data(gdk_window, |
461 reinterpret_cast<gpointer*>(>k_window)); | 461 reinterpret_cast<gpointer*>(>k_window)); |
462 if (!gtk_window) | 462 if (!gtk_window) |
463 return NULL; | 463 return NULL; |
464 return gtk_window; | 464 return gtk_window; |
465 } | 465 } |
466 | 466 |
467 void* GetVisualFromGtkWidget(GtkWidget* widget) { | 467 void* GetVisualFromGtkWidget(GtkWidget* widget) { |
468 return GDK_VISUAL_XVISUAL(gtk_widget_get_visual(widget)); | 468 return GDK_VISUAL_XVISUAL(gtk_widget_get_visual(widget)); |
469 } | 469 } |
| 470 |
| 471 void SetHideTitlebarWhenMaximizedProperty(XID window) { |
| 472 uint32 hide = 1; |
| 473 XChangeProperty(GetXDisplay(), |
| 474 window, |
| 475 GetAtom("_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED"), |
| 476 XA_CARDINAL, |
| 477 32, // size in bits |
| 478 PropModeReplace, |
| 479 reinterpret_cast<unsigned char*>(&hide), |
| 480 1); |
| 481 } |
470 #endif // defined(TOOLKIT_GTK) | 482 #endif // defined(TOOLKIT_GTK) |
471 | 483 |
472 int BitsPerPixelForPixmapDepth(Display* dpy, int depth) { | 484 int BitsPerPixelForPixmapDepth(Display* dpy, int depth) { |
473 int count; | 485 int count; |
474 XPixmapFormatValues* formats = XListPixmapFormats(dpy, &count); | 486 XPixmapFormatValues* formats = XListPixmapFormats(dpy, &count); |
475 if (!formats) | 487 if (!formats) |
476 return -1; | 488 return -1; |
477 | 489 |
478 int bits_per_pixel = -1; | 490 int bits_per_pixel = -1; |
479 for (int i = 0; i < count; ++i) { | 491 for (int i = 0; i < count; ++i) { |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1247 << "request_code " << static_cast<int>(error_event.request_code) << ", " | 1259 << "request_code " << static_cast<int>(error_event.request_code) << ", " |
1248 << "minor_code " << static_cast<int>(error_event.minor_code) | 1260 << "minor_code " << static_cast<int>(error_event.minor_code) |
1249 << " (" << request_str << ")"; | 1261 << " (" << request_str << ")"; |
1250 } | 1262 } |
1251 | 1263 |
1252 // ---------------------------------------------------------------------------- | 1264 // ---------------------------------------------------------------------------- |
1253 // End of x11_util_internal.h | 1265 // End of x11_util_internal.h |
1254 | 1266 |
1255 | 1267 |
1256 } // namespace ui | 1268 } // namespace ui |
OLD | NEW |