Created attachment 2363 [details] fix maximisation state with trayicon When using trayicon from notification plugin maximisation state of main window is wrongly saved under certain circumstances. Way to reproduce this behavior: - start claws-mail with tryicon enabled, maximise main window - click on tray icon or close window button (must have selected "close to tray" option for this to work) to minimise window to tray - close claws-mail by right clicking on tray icon and choosing "Exit Claws Mail" or close desktop session while claws-mail is minimised - on next run main window will be not maximised Proposed patch prevents maximisation state update when hiding to tray by ignoring windows state events with GDK_WINDOW_STATE_WITHDRAWN flag set. This flag appears only when trayicon is used.
I cannot reproduce this. I followed your instructions but on the next run Claws Mail started maximised as expected.
I do reproduce here (CentOS MATE with CM Gtk2, Rocky Linux 9 MATE with CM Gtk3), will check how it behaves with the patch later this week.
Just a note, this needs more work. Just discovered that when option "Hide at startup" is set window is in demaximised state after startup even when clawsrc clearly states: mainwin_maximised=1.
Created attachment 2365 [details] fix maximisation state with trayicon v2 This one fixes all issues for me. Some comments, GDK_WINDOW_STATE_WITHDRAWN state means basically window is not visible. When not visible window is not maximised so ignore events with this flag set when saving maximised state. Move setting of maxmised window to main_window_show() - this function is executed when we click on trayicon to show main window. This part fixes hide_at_startup issue.
Seems window manager dependent, Cinnamon needs fix while under XFCE works fine without.
That's what I thought. Using KDE everything works. I'm not sure we should be "fixing" or working around WMs, at least not with it being reported upstream first.