Menu

#568 OWLMaker does not honor last Maximized state

OWLMaker
pending
OWLMaker (25)
1
2024-02-23
2024-02-22
No

If OWLMaker is started from a shortcut, or from Windows Explorer, it does not start maximized if it was maximized before closing. The non-maximized main window size is restored correctly.

The problem is that when the application is started from a shortcut or Explorer, apparently the passed flag is SW_SHOWNORMAL and not SW_SHOWDEFAULT, and we are restoring the last window state only on SW_SHOWDEFAULT.

Discussion

  • Ognyan Chernokozhev

    Fix in [r6794]

     

    Related

    Commit: [r6794]

  • Ognyan Chernokozhev

    • status: open --> pending
     
  • Vidar Hasfjord

    Vidar Hasfjord - 2024-02-23

    Good to have maximised state restored since last use, but does this change not mean that you now cannot start OWLMaker in a way that guarantees that it will start in normal state (not maximised)? I figure this was the reason for restoring the maximised state only when SW_SHOWDEFAULT is passed.

    SW_SHOWNORMAL — Activates and displays a window. If the window is minimized, maximized, or arranged, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.

    https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindow

    Is there a way to tell a shortcut to use SW_SHOWDEFAULT? Then we could leave the code as it was, respecting SW_SHOWNORMAL. Alas, you can only choose Maximised, Minimised or Normal for how to run the application from a shortcut. Default is not an option. So your fix might be the best we can do.

     

    Last edit: Vidar Hasfjord 2024-02-23
    • Ognyan Chernokozhev

      If you don't want it to start maximized, then don't have it maximized when you close it :-)

      Also, while for the shortcut case you have at least some control over the startup state - you can force it to be always maximized, but when you start it from Explorer you don't have such options, and I think that fully restoring the last state is the best behavior.

       
      😄
      1
  • Vidar Hasfjord

    Vidar Hasfjord - 2024-02-23

    @jogybl wrote:

    Also, while for the shortcut case you have at least some control over the startup state - you can force it to be always maximized, but when you start it from Explorer you don't have such options, and I think that fully restoring the last state is the best behavior.

    Yes, agree. It is a shame that Explorer tries to dictate SW_SHOWNORMAL. It should have used SW_SHOWDEFAULT, I suppose, and let the application make the decision.

     

Log in to post a comment.