After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 701144 - Tiling maximization and client unmaximize request trigger incoherent window sizes
Tiling maximization and client unmaximize request trigger incoherent window s...
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks: 700419
 
 
Reported: 2013-05-28 16:29 UTC by Lionel Landwerlin
Modified: 2018-02-05 09:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
window: ensure tile_mode is coherent with requested unmaximize (2.01 KB, patch)
2013-05-28 16:33 UTC, Lionel Landwerlin
none Details | Review

Description Lionel Landwerlin 2013-05-28 16:29:03 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.
Comment 1 Lionel Landwerlin 2013-05-28 16:31:32 UTC
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();
Comment 2 Lionel Landwerlin 2013-05-28 16:33:14 UTC
Created attachment 245461 [details] [review]
window: ensure tile_mode is coherent with requested unmaximize
Comment 3 Jonas Ådahl 2018-02-05 09:17:39 UTC
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.