Page 1 of 1
Moving & Restoring Windows
Posted: Tue Oct 16, 2012 7:47 am
by J. Baker
Maximize the window, then move it and then try to restore it with the maximize button. As long as you don't move it, it can be restored.
Code: Select all
If OpenWindow(0, 0, 0, 300, 300, "Resize me !", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget)
WindowBounds(0, 200, 200, 400, 400)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
Re: PB 5.00 Beta 4 (X64) - Moving & Restoring Windows
Posted: Tue Oct 16, 2012 8:59 am
by wilbert
Strange problem Joe, but I can confirm it.

Re: PB 5.00 Beta 4 (X64) - Moving & Restoring Windows
Posted: Tue Oct 16, 2012 9:59 am
by J. Baker
wilbert wrote:Strange problem Joe, but I can confirm it.

Yeah, I first noticed it with your fullscreen function. Apparently when an app goes fullscreen, it's considered as moved. Therefor, you get the same error of not being able to restore the window. So I broke the code down and noticed it is when the window is moved. Thanks for confirming.

Re: PB 5.00 Beta 4 (X64) - Moving & Restoring Windows
Posted: Mon Oct 22, 2012 5:42 pm
by Fred
Seems to be the OS X normal behaviour. I just tried this code using the default XCode sample cocoa window and it gives the same result. When a window is moved, the restore size seems to be lost.
Code: Select all
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
NSSize max;
max.width = 600.0;
max.height = 400.0;
[_window setContentMaxSize:max];
}
Can anyone confirm with another (non-PB) app ?
Re: PB 5.00 Beta 4 (X64) - Moving & Restoring Windows
Posted: Mon Oct 22, 2012 6:51 pm
by wilbert
I just tried Safari and Twitter and as far as I can tell it behaves the same.
Moving when not maximized restore size doesn't get lost, moving when maximized previous size does get lost.
Re: Moving & Restoring Windows
Posted: Mon Oct 22, 2012 10:22 pm
by Fred
Moved the topic for further references.