Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: ui/base/x/x11_util.cc

Issue 10388217: Users stuck in fullscreen mode when running gnome-shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move outside of TOOLKIT_GTK Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/x/x11_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 #endif // defined(TOOLKIT_GTK) 470 #endif // defined(TOOLKIT_GTK)
471 471
472 void SetHideTitlebarWhenMaximizedProperty(XID window) {
473 uint32 hide = 1;
474 XChangeProperty(GetXDisplay(),
475 window,
476 GetAtom("_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED"),
477 XA_CARDINAL,
478 32, // size in bits
479 PropModeReplace,
480 reinterpret_cast<unsigned char*>(&hide),
481 1);
482 }
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) {
480 if (formats[i].depth == depth) { 492 if (formats[i].depth == depth) {
481 bits_per_pixel = formats[i].bits_per_pixel; 493 bits_per_pixel = formats[i].bits_per_pixel;
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « ui/base/x/x11_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698