Maximised WindowFlag

About Monkey 2 Forums Monkey 2 Development Maximised WindowFlag

This topic contains 5 replies, has 2 voices, and was last updated by  skn3 2 years, 5 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #5028

    skn3
    Participant

    Could we get a maximised window flag, to create the main app window maximised?

    #5037

    Mark Sibly
    Keymaster

    Added WindowFlags.Maximized and WindowFlags.Minimzed to develop branch.

    Note: Works best when combined with WindowFlags.Resizable!

    #5038

    skn3
    Participant

    winner thanks 😀

    #5069

    skn3
    Participant

    Given a quick test, seems like it doesn’t redraw properly on startup when the flag is set. I have just a black screen. I have to manually find a gadget in the dark (mojox) that will trigger the redraw. It looks like if you set a smaller window size then the actual maximised sized, then this is where it does not redraw properly.

    Also noticed there is no way to capture when the maximised state in the Window class. Would be nice to get a .Maximized and .Minimized Property on Window.

    This works:

    [/crayon]

    Could we have new events to wrap the SDL ones too:

    [/crayon]

    There doesn’t seem to be a way to capture these without modifying mojo. Would it be possible to add a RawEvent:Void() callback to the app class? So we can hook into all SDL events, even ones not captured into mojo?

    #5124

    Mark Sibly
    Keymaster

    I’ve had a go at fixing some of these issues.

    The ‘wont draw after creating a maximized window’ issue is weird, I’ve hacked around it for now by forcing 3 App.RequestRender’s after opening such a window which works here. There’s no reason it shouldn’t be drawing, I’m guessing the SwapBuffers isn’t working but you can’t check that for failure!

    Added some new event types: WindowMaximized, WindowMinimized and WindowRestored, some properties: Maximized:Bool and Minimized:Bool and some methods: Maximize(), Minimize(), Restore().

    The new event types are always preceded by a WindowResized, so you can generally ignore them.

    There seems to be a bug in SDL on linux where maximized, minimzed etc. events are only generated when the user interacts with the window – not when you can Maximize() programmatically. May fake around this later…

    I also began work on a better fullscreen system. The Fullscreen property is now read-only, and you need to use BeginFullscren()/EndFullscreen() to go into/out of fullscreen. I’ve done it this way because there are several ways you go can into fullscreen, eg: BeginFullscreen() to go into ‘desktop size’ fake fullscreen mode, BeginFullscreen( w,h,r ) to actually change resolution – and there are likely to be more once you can enum display modes. A simple bool just isn’t enough to enable fullscreen. Plus, I’d also like to add some methods for changing res while in fullscreen…

    There also appears to be another bug in SDL where you can’t go from a maximized window into ‘real’ fullscreen (on windows anyway) so be aware of that for now.

    #5144

    skn3
    Participant

    Crikey, one simple request opens up a massive can of worms! Cheers for the continued effort 😀

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.