Commit 28cf8f7b authored by tony@chromium.org's avatar tony@chromium.org

Users stuck in fullscreen mode when running gnome-shell.

This fixes the bug by setting _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED
on the window, which causes mutter to not force fullscreen on the
window.

Owen suggested this work around.

BUG=114636
TEST=In gnome-shell, enable auto-hide panels, maximize a chrome window, then
  try toggling fullscreen on and off.

Review URL: https://chromiumcodereview.appspot.com/10388217

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138357 0039d316-1c4b-4281-b951-d872f2087c98
parent cd82dc64
......@@ -428,6 +428,11 @@ void BrowserWindowGtk::Init() {
// Set the initial background color of widgets.
SetBackgroundColor();
HideUnsupportedWindowFeatures();
// Setting _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED tells gnome-shell to not force
// fullscreen on the window when it matches the desktop size.
ui::SetHideTitlebarWhenMaximizedProperty(
ui::GetX11WindowFromGtkWidget(GTK_WIDGET(window_)));
}
gboolean BrowserWindowGtk::OnCustomFrameExpose(GtkWidget* widget,
......
......@@ -469,6 +469,18 @@ void* GetVisualFromGtkWidget(GtkWidget* widget) {
}
#endif // defined(TOOLKIT_GTK)
void SetHideTitlebarWhenMaximizedProperty(XID window) {
uint32 hide = 1;
XChangeProperty(GetXDisplay(),
window,
GetAtom("_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED"),
XA_CARDINAL,
32, // size in bits
PropModeReplace,
reinterpret_cast<unsigned char*>(&hide),
1);
}
int BitsPerPixelForPixmapDepth(Display* dpy, int depth) {
int count;
XPixmapFormatValues* formats = XListPixmapFormats(dpy, &count);
......
......@@ -121,6 +121,9 @@ UI_EXPORT GtkWindow* GetGtkWindowFromX11Window(XID xid);
UI_EXPORT void* GetVisualFromGtkWidget(GtkWidget* widget);
#endif // defined(TOOLKIT_GTK)
// Sets _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED on |window|.
UI_EXPORT void SetHideTitlebarWhenMaximizedProperty(XID window);
// Return the number of bits-per-pixel for a pixmap of the given depth
UI_EXPORT int BitsPerPixelForPixmapDepth(Display* display, int depth);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment