OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/gtk/browser_window_gtk.h" | 5 #include "chrome/browser/gtk/browser_window_gtk.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 #include <X11/XF86keysym.h> | 8 #include <X11/XF86keysym.h> |
9 | 9 |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 1176 matching lines...) Loading... |
1187 } | 1187 } |
1188 | 1188 |
1189 // static | 1189 // static |
1190 GtkWindow* BrowserWindowGtk::GetBrowserWindowForXID(XID xid) { | 1190 GtkWindow* BrowserWindowGtk::GetBrowserWindowForXID(XID xid) { |
1191 return BrowserWindowGtk::xid_map_.find(xid)->second; | 1191 return BrowserWindowGtk::xid_map_.find(xid)->second; |
1192 } | 1192 } |
1193 | 1193 |
1194 // static | 1194 // static |
1195 void BrowserWindowGtk::RegisterUserPrefs(PrefService* prefs) { | 1195 void BrowserWindowGtk::RegisterUserPrefs(PrefService* prefs) { |
1196 bool custom_frame_default = false; | 1196 bool custom_frame_default = false; |
1197 if (!prefs->HasPrefPath(prefs::kUseCustomChromeFrame)) | 1197 // Avoid checking the window manager if we're not connected to an X server (as |
| 1198 // is the case in Valgrind tests). |
| 1199 if (x11_util::XDisplayExists() && |
| 1200 !prefs->HasPrefPath(prefs::kUseCustomChromeFrame)) { |
1198 custom_frame_default = GetCustomFramePrefDefault(); | 1201 custom_frame_default = GetCustomFramePrefDefault(); |
| 1202 } |
1199 prefs->RegisterBooleanPref( | 1203 prefs->RegisterBooleanPref( |
1200 prefs::kUseCustomChromeFrame, custom_frame_default); | 1204 prefs::kUseCustomChromeFrame, custom_frame_default); |
1201 } | 1205 } |
1202 | 1206 |
1203 void BrowserWindowGtk::SetGeometryHints() { | 1207 void BrowserWindowGtk::SetGeometryHints() { |
1204 // Allow the user to resize us arbitrarily small. | 1208 // Allow the user to resize us arbitrarily small. |
1205 GdkGeometry geometry; | 1209 GdkGeometry geometry; |
1206 geometry.min_width = 1; | 1210 geometry.min_width = 1; |
1207 geometry.min_height = 1; | 1211 geometry.min_height = 1; |
1208 gtk_window_set_geometry_hints(window_, NULL, &geometry, GDK_HINT_MIN_SIZE); | 1212 gtk_window_set_geometry_hints(window_, NULL, &geometry, GDK_HINT_MIN_SIZE); |
(...skipping 553 matching lines...) Loading... |
1762 // are taken from the WMs' source code. | 1766 // are taken from the WMs' source code. |
1763 return (wm_name == "Blackbox" || | 1767 return (wm_name == "Blackbox" || |
1764 wm_name == "compiz" || | 1768 wm_name == "compiz" || |
1765 wm_name == "e16" || // Enlightenment DR16 | 1769 wm_name == "e16" || // Enlightenment DR16 |
1766 wm_name == "Fluxbox" || | 1770 wm_name == "Fluxbox" || |
1767 wm_name == "KWin" || | 1771 wm_name == "KWin" || |
1768 wm_name == "Metacity" || | 1772 wm_name == "Metacity" || |
1769 wm_name == "Openbox" || | 1773 wm_name == "Openbox" || |
1770 wm_name == "Xfwm4"); | 1774 wm_name == "Xfwm4"); |
1771 } | 1775 } |
OLD | NEW |