We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1517

Summary: Debug message and resize window problem
Product: SDL Reporter: PulkoMandy <pulkomandy>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED WONTFIX QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 1.2   
Hardware: All   
OS: Haiku   
Attachments: Fix the window jumping to center on screen at each resize event

Description PulkoMandy 2012-06-09 03:23:56 UTC
Created attachment 874 [details]
Fix the window jumping to center on screen at each resize event

The current code in Haiku tries to open a centered window. This works well, but when the application allows the window to be resized, resizing moves it back to screen center, which is rather annoying behaviour.

Moreover, a PrintToStream call was left in that code, leading to the window size being output on stdout at each resize.

Attached patches fixes both of these, but the window is now open at (0,0), that is, the titlebar and left border are out of the screen.
On Haiku, it is possible to call BWindow::CenterOnScreen() to center the window. I tried to do that just after the window creation in video init, but the window is created with a size of (0,0) so the top left corner is centered on screen, which is not very good either.

I don't think there's a safe spot to do the centering on first creaton of the window, then not on resize (IIRC, resizing a window in SDL 1.2 needs re-running the video init code)
Comment 1 Sam Lantinga 2013-05-29 06:26:58 UTC
This code has been rewritten for SDL 2.0.  Can you look and see if this issue is active there?
http://www.libsdl.org/tmp/SDL-2.0.zip

Thanks!