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 491090 - Initially iconified windows regression
Initially iconified windows regression
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
: 360900 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-10-28 15:00 UTC by Owen Taylor
Modified: 2009-02-04 11:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Quick test case (138 bytes, text/plain)
2007-10-28 15:07 UTC, Owen Taylor
  Details
Proposed patch (1.10 KB, patch)
2007-10-28 15:11 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2007-10-28 15:00:20 UTC
The support in metacity for mapping a window initially iconified/minimized
is not working properly.

I'll attach a short test case program that demonstrates this.

The obvious problem is:

  /* See bug 334899; the window may have minimized ancestors
   * which need to be shown.
   *
   * However, we shouldn't unminimize windows here when opening
   * a new display because that breaks passing _NET_WM_STATE_HIDDEN
   * between window managers when replacing them; see bug 358042.
   */
  if (!display->display_opening)
    unminimize_window_and_all_transient_parents (window);

Which gets called even if earlier in the same function we did:

  if (window->initially_iconic)
    {
      /* WM_HINTS said minimized */
      window->minimized = TRUE;
      meta_verbose ("Window %s asked to start out minimized\n", window->desc);
    }

I think that the right fix is:

-  if (!display->display_opening)
+  if (!display->display_opening && !window->minimized)
    unminimize_window_and_all_transient_parents (window);

The display->display_opening check is still needed because it applies to the
case where the window isn't minimized but some parent is ... we still want
to preserve that previous state. (probably ... it's a little pathological)

"unminimize_window_and_all_transient_parents" is used elsewhere, so it 
doesn't need to be changed to "unminimize_all_transient_parents".
Comment 1 Owen Taylor 2007-10-28 15:07:58 UTC
Created attachment 98033 [details]
Quick test case
Comment 2 Owen Taylor 2007-10-28 15:11:02 UTC
Created attachment 98034 [details] [review]
Proposed patch

Here's a patch.

I didn't add a bug reference in the comment to go with the other two bug
references since it's just a logic correction not some obscure user 
behavior tweak that needs history to explain.
Comment 3 Havoc Pennington 2007-10-28 15:28:10 UTC
Looks correct to me, though Elijah or Thomas may have thoughts.
Comment 4 Thomas Thurman 2007-10-30 13:06:06 UTC
Well spotted, works beautifully, nice test case. You can commit if you like, or I will if you'd rather. Thank you!
Comment 5 Owen Taylor 2007-10-30 13:27:51 UTC
Commited, thanks for the review.

2007-10-28  Owen Taylor  <otaylor@redhat.com>

        * src/window.c (meta_window_new_with_attrs): Don't immediately
        unminimize an initially iconic window (#491090)
Comment 6 Elijah Newren 2007-10-31 02:28:12 UTC
The other bugs already filed about this issue should be marked as a duplicate of this one.  Any takers willing to look them up?  At least one mentions xterm...

Thanks for fixing this, Owen.
Comment 7 Elijah Newren 2007-12-13 03:25:59 UTC
*** Bug 360900 has been marked as a duplicate of this bug. ***
Comment 8 Elijah Newren 2007-12-13 03:26:21 UTC
Um, did you only commit on the 2-20 branch?  It'd be nice to have on trunk too.  :-)
Comment 9 Thomas Thurman 2008-03-28 18:45:29 UTC
Checked into trunk!

http://svn.gnome.org/viewvc/metacity?rev=3667&view=rev
Comment 10 Artem Ananiev 2009-02-04 11:49:59 UTC
Still reproducible with 2.22 on my Ubuntu 8.04 with Compiz...