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 137185 - [testcase] doesn't restore maximised state when using gtk_window_move
[testcase] doesn't restore maximised state when using gtk_window_move
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
2.8.x
Other Linux
: High normal
: 2.10.x
Assigned To: Metacity maintainers list
Metacity maintainers list
: 169134 308518 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-03-14 20:02 UTC by spark
Modified: 2005-08-26 22:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase.c (794 bytes, text/plain)
2004-11-18 18:52 UTC, Christian Persch
  Details
Unmaximize windows being withdrawn if they've been maximized (848 bytes, patch)
2005-07-12 19:14 UTC, Elijah Newren
accepted-commit_now Details | Review

Description spark 2004-03-14 20:02:27 UTC
Error viewer doesn't remember the restore state properly.

To repro:
Open error viewer
Maximise
Close it
Reopen it
Try to restore

Expected:
Restore to original size.

Actual:
Restores to maximised size.
Comment 1 Adam Hooper 2004-03-15 20:44:11 UTC
This is an EphyDialog bug. You can tell because the History window
does it too :).
Comment 2 Christian Persch 2004-03-16 15:31:17 UTC
The history window is not an EphyDialog.
Comment 3 Marco Pesenti Gritti 2004-04-17 08:20:20 UTC
Is the size persisted if you just make the window bigger rather than maximizing ?
Comment 4 Adam Hooper 2004-04-17 18:31:32 UTC
Yes. When you maximize and then close, it restores to the maximized size but it
is not "maximized" per se -- it's just open to whatever size it was when it
*was* maximized. So you can't get it back to the original state at all without
resizing manually.
Comment 5 Christian Persch 2004-10-13 11:03:02 UTC
Mass reassigning of Epiphany bugs to epiphany-maint@b.g.o
Comment 6 Christian Persch 2004-10-17 18:25:36 UTC
This happens for _all_ windows for which we do

gtk_widget_hide(window);
return TRUE;

in the delete-event handler, and later re-show (gtk_window_present()) the same
window again.

Window manager but, or gtk+ bug ?
Comment 7 Christian Persch 2004-11-18 18:52:43 UTC
Created attachment 33912 [details]
testcase.c
Comment 8 Christian Persch 2004-11-18 18:59:13 UTC
It's the call to gtk_window_move() that seems to cause this problem. If I remove
it, all works as expected.

Since I also cannot reproduce this in kwin, I assume this is a metacity bug.
Re-assigning.
Comment 9 Christian Persch 2004-11-18 19:13:30 UTC
Forgot to mention that this is with metacity 2.8.6 (but also happened with gnome
2.6's version).

Steps to reproduce:
0) Compile & run the attached testcase
1) Click the maximise button on the window frame
2) Click the close button on the window frame

Expected results:
When the window is shown again, it's maximised again.

Actual results:
When the window is shown again, it occupies the whole screen but is not maximised.
Comment 10 Elijah Newren 2005-03-03 21:31:04 UTC
I was hoping to find time for this before 2.10.0.  I'll try to take a look
during 2.10.x...
Comment 11 Michaël Arnauts 2005-05-05 09:14:54 UTC
I tried to compile the testcase, but it failed because it didn't found the glib
and gtk header files. I guess I have to add some comandline options like the
pkg-config things? Can somebody tell me how to do this?
Comment 12 Elijah Newren 2005-05-05 15:11:40 UTC
gcc testcase.c -o testcase `pkg-config --cflags --libs gtk+-2.0`
Comment 13 Michaël Arnauts 2005-05-15 20:30:24 UTC
*** Bug 169134 has been marked as a duplicate of this bug. ***
Comment 14 Elijah Newren 2005-07-12 19:12:58 UTC
Hehe, after reading lots of nasty verbose log information, I finally come find
out that window.c:meta_window_free() has the following line in it:

  /* FIXME restore original size if window has maximized */

I'll attach a patch that does that in just a minute.  :)
Comment 15 Elijah Newren 2005-07-12 19:14:35 UTC
Created attachment 49048 [details] [review]
Unmaximize windows being withdrawn if they've been maximized
Comment 16 Havoc Pennington 2005-07-24 05:05:32 UTC
Comment on attachment 49048 [details] [review]
Unmaximize windows being withdrawn if they've been maximized

Looks good, should double check though that meta_window_unmaximize is safe to
call in window_free, since the window is partially destroyed already...

Maybe you can unmaximize earlier in the function? (In particular before all
that unqueue() stuff)
Comment 17 Elijah Newren 2005-07-25 01:42:21 UTC
Yeah, it works before all the unqueue stuff so I moved it up there.  :)

2005-07-24  Elijah Newren  <newren@gmail.com>

	* src/window.c (meta_window_free): restore original window size if
	the window was maximized, as the FIXME says.  ;-) Fixes #137185.
	Thanks to Christian Persch for the testcase that made this easier
	to track down.
Comment 18 Elijah Newren 2005-08-26 22:14:36 UTC
*** Bug 308518 has been marked as a duplicate of this bug. ***