Ticket #25 (closed defect: fixed)

Opened 5 years ago

Last modified 4 years ago

Window size doesn't restore if closed when maximised

Reported by: uncle_fungus Assigned to: uncle_fungus
Priority: major Milestone: 2.3.2
Component: GUI Keywords:
Cc:

Description

If you close FahMon when the window is maximised it doesn't restore this maximised setting when you next launch FahMon, instead it opens with the default dimensions

Change History

10/30/07 17:46:40 changed by uncle_fungus

  • status changed from new to assigned.

11/09/07 15:51:35 changed by uncle_fungus

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed in r110

11/19/07 10:18:08 changed by Bastien

  • status changed from closed to reopened.
  • resolution deleted.

It could be a problem at my side and I don't now if it is related to this.

When using SVNr119 Fahmon didn't popup when I push the trayicon. I see Fahmon displayed on the taskbar but I have to click on the taskbar button to see Fahmon. I have tried this with version 2.3.1, and there it is working normally (also without windowblinds).

11/19/07 10:30:41 changed by uncle_fungus

Is that when FahMon should appear maximised?

I'll check this again on the Windows build.

11/19/07 10:35:28 changed by Bastien

Not only when I have maximised the Fahmon window, but also with a resized one.

11/19/07 12:56:03 changed by uncle_fungus

OK, I agree, there is a problem with the Windows version, which is annoying since it works perfectly on Linux.

11/26/07 04:48:02 changed by calxalot

This is also an issue on osx. The window size at launch is always the default size.

If I show the log, quit, and relaunch, all I see is the log until I resize or toggle the log.

11/26/07 05:39:32 changed by uncle_fungus

True, but at the moment the reason for this is that the window size settings are not saved because FahMon never shuts down cleanly.

11/26/07 16:54:45 changed by calxalot

Well, I see in MainDialog::OnClose(), that it will only save its frame if win32 and not iconized:

	// Don't save window size if it is iconized (win32 bug)
#ifdef _FAHMON_WIN32_
	if(!IsIconized())
	{
		// Save the size of the frame
		_PrefsSetInt(PREF_MAINDIALOG_FRAMEWIDTH,  GetSize().GetWidth());
		_PrefsSetInt(PREF_MAINDIALOG_FRAMEHEIGHT, GetSize().GetHeight());

		// Save the position of the frame
		_PrefsSetInt(PREF_MAINDIALOG_FRAME_POS_X, GetPosition().x);
		_PrefsSetInt(PREF_MAINDIALOG_FRAME_POS_Y, GetPosition().y);
	}
#endif

I think you want this:

	// Don't save window size if it is iconized (win32 bug)
#ifdef _FAHMON_WIN32_
	if(!IsIconized())
#endif
	{
		// Save the size of the frame
		_PrefsSetInt(PREF_MAINDIALOG_FRAMEWIDTH,  GetSize().GetWidth());
		_PrefsSetInt(PREF_MAINDIALOG_FRAMEHEIGHT, GetSize().GetHeight());

		// Save the position of the frame
		_PrefsSetInt(PREF_MAINDIALOG_FRAME_POS_X, GetPosition().x);
		_PrefsSetInt(PREF_MAINDIALOG_FRAME_POS_Y, GetPosition().y);
	}

11/26/07 17:22:15 changed by uncle_fungus

Good catch, however this is already fixed in trunk: source:trunk/src/mainDialog.cpp which has been updated.

At the moment the only thing wrong with the code is that on wxmsw the Window isn't raised when you click on the tray icon (whereas it is on wxgtk, not sure about wxmac, since I haven't copied the code to the mac branch yet). The size restoring ability works correctly.

The ifdef is only present in the mactest branch in that for so I could guarantee that it wasn't interfering with the client quit process. Once I copy the most recent trunk changes into the mactest branch, these things should work.

01/17/08 13:49:32 changed by uncle_fungus

  • status changed from reopened to closed.
  • resolution set to fixed.

Finally fixed (and tested) in r134