GNOME Bugzilla – Bug 701144
Tiling maximization and client unmaximize request trigger incoherent window sizes
Last modified: 2018-02-05 09:17:39 UTC
When triggering the maximization of a window using the tiling code (ie drag your window to the top of the screen and release), if the client later calls gdk_window_unmaximize(), mutter gets confused when resizing/repositioning the window. That is because the window still has the window->tile_mode set to something different than META_TILE_NONE.
Following is a small gjs script to reproduce the problem. Drag the window to the top using the title bar, release, the window gets maximized (mutter's behavior), then click into the window to unmaximize from the client. ====================================================================== const Lang = imports.lang; const Mainloop = imports.mainloop; const Gettext = imports.gettext; const _ = imports.gettext.gettext; const Gio = imports.gi.Gio; const GLib = imports.gi.GLib; const Gdk = imports.gi.Gdk; const Gtk = imports.gi.Gtk; Gtk.init(null, null); let win = new Gtk.Window(); win.resize(800, 600); let ev = new Gtk.EventBox(); win.add(ev); ev.connect('button-press-event', Lang.bind(this, function(widget, event) { let gdk_win = win.get_window(); if (gdk_win.get_state() & Gdk.WindowState.MAXIMIZED) win.unmaximize(); else win.maximize(); })); win.show_all(); Gtk.main();
Created attachment 245461 [details] [review] window: ensure tile_mode is coherent with requested unmaximize
The size of the test case window after unmaximizing as described in the reproduction steps is the same as it was prior to being maximized, so I suppose this was fixed at one point.