feisty: metacity: inconsistent window maximize behavior

Bug #132283 reported by Brian Hart
2
Affects Status Importance Assigned to Milestone
metacity (Ubuntu)
Fix Released
Low
Ubuntu Desktop Bugs

Bug Description

Binary package hint: metacity

New application windows pick up some partial notion of "maximized" by virtue of having been created with a maximal width or height. "maximized" is conceptually distinct from "at maximal width/height"--windows created with the latter attribute shouldn't assume the former.

Steps to recreate in the vertical using Firefox are described below. The problem is not restricted to Firefox (I can recreate with gedit), nor to the vertical (I can recreate in the horizontal as well).

To recreate:

- Open a new Firefox instance. Arrange that the new instance will open in a window that's smaller than maximum in both horizontal and vertical directions and is not adjacent to either panel or left or right screen edges.

- Move the initial Firefox window so the top of the window is adjacent to the top panel.

- Resize the Firefox window vertically so that the bottom of the window is adjacent to the bottom panel.

- Open a new Firefox window (ctrl-N).

- Note that the original window can be moved and resized both horizontally and vertically.

- Note that the new window can only be moved and resized horizontally, not vertically. Note that when the cursor approaches the top or bottom border of the new window, it changes to the resize cursor, but an attempt to resize does not work.

- Maximize the new window. Note that when maximized the cursor does not change to the resize cursor when it approaches a window border.

- Unmaximize the new window. Note that it can now be moved and resized both horizontally and vertically.

If the initial window is resized to maximal width _and_ height before the new window is created, then the new window is created fully maximized and cannot be moved or resized in either direction. The window can then be unmaximized; it will still be at maximal width and height, but can then be resized or moved in either direction.

Relevant package levels:

$ dpkg -l | grep -Ei 'metacity|firefox|gedit'
ii firefox 2.0.0.6+1-0ubuntu1 lightweight web browser based on Mozilla
ii firefox-gnome-support 2.0.0.6+1-0ubuntu1 Support for Gnome in Mozilla Firefox
ii gedit 2.18.1-0ubuntu1 light-weight text editor
ii gedit-common 2.18.1-0ubuntu1 light-weight text editor support files
ii libmetacity0 2.18.2-0ubuntu1.1 library of lightweight GTK2 based Window Man
ii libnspr4 1.firefox2.0.0.6+1-0ubuntu1 Netscape Portable Runtime Library
ii libnss3 1.firefox2.0.0.6+1-0ubuntu1 Network Security Service Libraries - runtime
ii metacity 2.18.2-0ubuntu1.1 A lightweight GTK2 based Window Manager
ii metacity-common 2.18.2-0ubuntu1.1 Shared files of lightweight GTK2 based Windo
ii mozilla-firefox-locale-en-gb 2.0.0.1ubuntu-1 Mozilla Firefox English language/region pack

I believe this is a metacity problem, and it looks to me like the culprit may be in meta_window_place(). The call-chain might be:

meta_window_new_with_attrs() -> meta_window_move_resize_internal() -> meta_window_constrain() -> place_window_if_needed() -> meta_window_place()

I suspect the following code:

  /* Maximize windows if they are too big for their work area (bit of
   * a hack here). Assume undecorated windows probably don't intend to
   * be maximized.
   */
  if (window->has_maximize_func && window->decorated &&
      !window->fullscreen)
    {
      MetaRectangle workarea;
      MetaRectangle outer;

      meta_window_get_work_area_for_xinerama (window,
                                              xineramas_list[placed_on],
                                              &workarea);
      meta_window_get_outer_rect (window, &outer);

      if (outer.width >= workarea.width)
        window->maximize_horizontally_after_placement = TRUE;

      if (outer.height >= workarea.height)
        window->maximize_vertically_after_placement = TRUE;
    }

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. The issue that you reported is one that should be reproducable with the live environment of the Desktop CD of the development release - Gutsy Gibbon. It would help us greatly if you could test with it so we can work on getting it fixed in the next release of Ubuntu. You can find out more about the development release at [WWW] http://www.ubuntu.com/testing/ . Thanks again and we appreciate your help.

Changed in metacity:
assignee: nobody → desktop-bugs
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Brian Hart (hartb-austin) wrote :

I tested with Gutsy Tribe 5; the problem no longer occurs there. I tested with both gedit and Firefox. In both cases, opening new child windows from a maximal-height window results in a child window that can be freely moved and resized.

The inconsistent behaviour is gone, and I think the inconsistency was resolved in the right direction. I suspect the common use case is: User immediately wants to resize or move a new child window. Maximized constrains resize or move, so I think avoiding maximized for new windows is the Right Thing.

I'm satisfied with the Gutsy behaviour. Thank you Sebastien!

Revision history for this message
Brian Hart (hartb-austin) wrote : Re: [Bug 132283] Re: feisty: metacity: inconsistent window maximize behavior

Sebastien,

 Thank you for looking into this...

On Wed, 2007-08-22 at 16:05 +0000, Sebastien Bacher wrote:
> Thank you for taking the time to report this bug and helping to make
> Ubuntu better. The issue that you reported is one that should be
> reproducable with the live environment of the Desktop CD of the
> development release - Gutsy Gibbon. It would help us greatly if you
> could test with it so we can work on getting it fixed in the next
> release of Ubuntu.

 I tested on Gutsy Tribe 5 and updated the Bug. The short summary is
that the problem no longer occurs at Tribe 5 (I didn't test the earlier
Tribes).

 Thank you!

Regards,
brian

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for the update, marking the bug fixed now

Changed in metacity:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.