macOS "Big Sur" and frame height Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

macOS "Big Sur" and frame height

Post by rocrail »

Before "Big Sur" this hard coded Work Around did help:

Code: Select all

    wxSize size = this->getFrame()->GetSize();
    if( size.GetWidth() > 100 && size.GetHeight() > 100 ) {
      wWindow.setcx( wGui.getwindow( m_Ini ), size.GetWidth() );
      wWindow.setcy( wGui.getwindow( m_Ini ), size.GetHeight() );
    }

#ifdef __APPLE__
    if( !wGui.isverticaltoolbar( m_Ini ) )
      wWindow.setcy( wGui.getwindow( m_Ini ), size.GetHeight() - 35 ); // hard coded work around for increasing height.
#endif
But with "Big Sur" I have to double this Work Around value. Can some wxApple Developer check this? Or is FrameSize not equal FrameSize?

The save and restore of the applications frame size works perfect under wx Windows and Linux.
Best regards,
Rob.
https://wiki.rocrail.net
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: macOS "Big Sur" and frame height

Post by ONEEYEMAN »

Hi,
What is the context of this?
Why do you need a conditional for OSX? What happen if you omit this?

Thank you.
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: macOS "Big Sur" and frame height

Post by rocrail »

Hi,

the Frame size of the wxWidgets App is saved, and restored at restart.

The #ifdef is the Work-Around for macOS and wxWidgets, but the used value must be corrected for "Big Sur".
Best regards,
Rob.
https://wiki.rocrail.net
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: macOS "Big Sur" and frame height

Post by ONEEYEMAN »

Hi,
Are you saving the frame size or the client size?
Notice that under OSX/*nix it is better to store the client size, as the window decoration is not yet available...

Thank you.
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: macOS "Big Sur" and frame height

Post by rocrail »

Thanks!

Saving and restoring the client size is OK under macOS "Big Sur".
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: macOS "Big Sur" and frame height

Post by rocrail »

Hi,

this is not the right solution:

1) under Catalina the windows height shrinks. -24
2) under Big Sur the windows height grows. +4

Which solution would be OK for both cases?
Last edited by rocrail on Sun Dec 27, 2020 7:28 am, edited 1 time in total.
Best regards,
Rob.
https://wiki.rocrail.net
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: macOS "Big Sur" and frame height

Post by ONEEYEMAN »

Hi,
It is the right solution.
It should work under all 3 major platforms. Especially on GTK as there the window size is not known prior to rendering.

Are you using wxPersistentManager (wx persistent framework)?

And how do you save/restore the size?

Thank you.
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: macOS "Big Sur" and frame height

Post by rocrail »

I'm saving it in a separate file.

Save:

Code: Select all

    wxSize size = this->getFrame()->GetSize();
#ifdef __APPLE__
    size = this->getFrame()->GetClientSize();
#endif
    if( size.GetWidth() > 100 && size.GetHeight() > 100 ) {
      wWindow.setcx( wGui.getwindow( m_Ini ), size.GetWidth() );
      wWindow.setcy( wGui.getwindow( m_Ini ), size.GetHeight() );
    }
Restore:

Code: Select all

  int iWidth  = wWindow.getcx( wGui.getwindow( m_Ini ) );
  int iHeight = wWindow.getcy( wGui.getwindow( m_Ini ) );

  m_Frame = new RocGuiFrame( _T("Rocrail"), wxPoint(iX, iY), wxDefaultSize, m_Ini, theme, sp, tp, dp );
#ifdef __APPLE__
  m_Frame->SetClientSize(wxSize(iWidth, iHeight));
#else
  m_Frame->SetSize(wxSize(iWidth, iHeight));
#endif
Best regards,
Rob.
https://wiki.rocrail.net
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: macOS "Big Sur" and frame height

Post by ONEEYEMAN »

Hi,
Why do you have conditional for OSX? As I said - it also should work much better on GTK.
Also - out of curiosity - can you try to run persist sample on both systems? Maybe you did find the inconsistency in those versions.

Thank you.
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: macOS "Big Sur" and frame height

Post by rocrail »

Hi,

under Windows the ClientSize does not fit, and grows the height too.
I will check the example, and report.
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: macOS "Big Sur" and frame height

Post by rocrail »

There is no persist sample...

Code: Select all

 samples % ls
Makefile	combo		drawing		htlbox		mdi		propgrid	sound		thread		widgets
animate		config		erase		html		menu		render		splash		toolbar		wizard
archive		dataview	event		image		minimal		ribbon		splitter	treectrl	wrapsizer
artprov		debugrpt	except		internat	notebook	richtext	statbar		treelist	xrc
aui		dialogs		exec		ipc		opengl		sashtest	stc		typetest
calendar	display		font		joytest		popup		scroll		svg		uiaction
caret		dnd		fswatcher	keyboard	power		secretstore	taborder	validate
clipboard	docview		grid		layout		preferences	shaped		taskbar		vscroll
collpane	dragimag	help		listctrl	printing	sockets		text		webview
Best regards,
Rob.
https://wiki.rocrail.net
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: macOS "Big Sur" and frame height

Post by ONEEYEMAN »

Hi,
I'm sorry - there is no sample
However there is a test for a persistence classes - can you try and see if its passes?

Thank you.
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: macOS "Big Sur" and frame height

Post by rocrail »

ONEEYEMAN wrote: Sun Dec 27, 2020 8:56 am However there is a test for a persistence classes - can you try and see if its passes?
in which sample is this?
Or should I try the wxPersistence? Class in my application?
Best regards,
Rob.
https://wiki.rocrail.net
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: macOS "Big Sur" and frame height

Post by ONEEYEMAN »

Hi,
Just try to compile and run tests and test_gui application.

Code: Select all

can wxWidgets/buildMac/tests
make
./test
./test_gui
and see if there will be failures from wxPersistence* classes.

Thank you.
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: macOS "Big Sur" and frame height

Post by rocrail »

Hi,

no such directory found under wxWidgets Source tree.
Best regards,
Rob.
https://wiki.rocrail.net
Post Reply