Moving & Restoring Windows

Mac OSX specific forum
User avatar
J. Baker
Addict
Addict
Posts: 2196
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Moving & Restoring Windows

Post 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
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3944
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: PB 5.00 Beta 4 (X64) - Moving & Restoring Windows

Post by wilbert »

Strange problem Joe, but I can confirm it. :shock:
User avatar
J. Baker
Addict
Addict
Posts: 2196
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: PB 5.00 Beta 4 (X64) - Moving & Restoring Windows

Post by J. Baker »

wilbert wrote:Strange problem Joe, but I can confirm it. :shock:
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. ;)
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
Fred
Administrator
Administrator
Posts: 18499
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PB 5.00 Beta 4 (X64) - Moving & Restoring Windows

Post 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 ?
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3944
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: PB 5.00 Beta 4 (X64) - Moving & Restoring Windows

Post 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.
Fred
Administrator
Administrator
Posts: 18499
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Moving & Restoring Windows

Post by Fred »

Moved the topic for further references.
Post Reply