Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odd Window positioning behaviour (MacOS) #4791

Closed
whalley opened this issue Jul 6, 2022 · 16 comments
Closed

Odd Window positioning behaviour (MacOS) #4791

whalley opened this issue Jul 6, 2022 · 16 comments
Assignees
Labels
fixed mac related to OSX / MacOS
Milestone

Comments

@whalley
Copy link
Member

whalley commented Jul 6, 2022

When re-opening MMEX the application recognizes that it can fit into one of the attached monitors and then opens in the X,Y position BUT it opens at another location. In addition to opening on the wrong display, the toolbar then has additional margin padding

CleanShot 2022-07-06 at 17 06 32

On my setup the windows are reported as:

screen 0: x:0, y:25, w:1680, h:969, fit:false, primary:true
screen 1: x:-918, y:-1415, w:3440, h:1415, fit:false, primary:false
screen 2: x:-3478, y:-1415, w:2560, h:1415, fit:true, primary:false

In reality, the screens are laid out as:
CleanShot 2022-07-06 at 19 31 06

The saved position that the application is trying to recover to is:

saved dimensions : x:-3087, y:-1232, w:1850, h:993, maximized:false

this should restore to screen 2 but actually restores across screens 0 and 1, as shown below in yellow
CleanShot 2022-07-06 at 19 31 06

Needs a bit of investigation....

@whalley whalley added the mac related to OSX / MacOS label Jul 6, 2022
@whalley whalley self-assigned this Jul 6, 2022
@whalley
Copy link
Member Author

whalley commented Jul 6, 2022

Tried re-ordering logical screens to be one continuous row..

saved dimensions : x:5331, y:-157, w:1431, h:802, maximized:false
screen 0: x:0, y:25, w:1680, h:1025, fit:false, primary:true
screen 1: x:1680, y:-365, w:3440, h:1352, fit:false, primary:false
screen 2: x:5120, y:-365, w:2560, h:1415, fit:true, primary:false
current dimensions : x:851, y:-157, w:1431, h:802, maximized:false

...but same result

As soon as the mmGUIFrame is created with (x:5331, y:-157, w:1431, h:802), I check the Window size via:

app->m_frame = new mmGUIFrame(app, mmex::getProgramName(), wxPoint(valX, valY), wxSize(valW, valH));
int x,y,w,h;
app->m_frame->GetPosition(&x,&y);
app->m_frame->GetSize(&w,&h);
wxLogDebug("mmGUIFrame: %d,%d,%d,%d", x,y,w,h);

but get:
Debug: mmGUIFrame: 851,-157,1431,802

However......
If I do this

app->m_frame = new mmGUIFrame(app, mmex::getProgramName(), wxPoint(valX, valY), wxSize(valW, valH));
wxPoint point(valX, valY);
app->m_frame->SetPosition(point);

The window is correctly placed, but the toolbar still has extra padding. Something must be screwing up in mmGUIFrame of wxFrame that is causing this odd positioning and sizing.

...the quest continues.

@whalley
Copy link
Member Author

whalley commented Jul 8, 2022

Only way I could find of fixing the toolbar padding issue, which only seemed to appear on retina Mac screens was to change wxToolBar to wxAuiToolBar, which seemed the right way to go anyway.

@vomikan Can you please check for no ill effects on Windows.

@tactilis
Copy link

tactilis commented Jul 8, 2022

@whalley

First run on Windows 7:

image

@tactilis
Copy link

tactilis commented Jul 8, 2022

Changing the Toolbar icon size to small... Toolbar still too tall.

image

@tactilis
Copy link

tactilis commented Jul 8, 2022

The toolbar seems to be set to a height appropriate for Toolbar icon size: Huge

image

@tactilis
Copy link

tactilis commented Jul 8, 2022

Note that detaching the toolbar sets height correctly... until it is reattached

mmex_YAjRjZfqTA.mp4

whalley pushed a commit to whalley/moneymanagerex that referenced this issue Jul 8, 2022
@whalley
Copy link
Member Author

whalley commented Jul 8, 2022

Hoping this will fix it...
toolBar_->SetToolBorderPadding(1);

On MacOS...
CleanShot 2022-07-08 at 19 35 03

UPDATE: Though not so sure as if I increase padding it happened vertically and horizontally, even when undocked!

whalley pushed a commit to whalley/moneymanagerex that referenced this issue Jul 8, 2022
vomikan added a commit that referenced this issue Jul 8, 2022
@vomikan
Copy link
Member

vomikan commented Jul 8, 2022

It's OK for me for any sizes.

@whalley whalley added the on hold waiting for something label Jul 8, 2022
@whalley
Copy link
Member Author

whalley commented Jul 8, 2022

Put on hold until wxWidgets team can comment on the window positioning issue.

@tactilis
Copy link

tactilis commented Jul 8, 2022

@whalley

Hoping this will fix it... toolBar_->SetToolBorderPadding(1);

Yep. All good under Win 7 now.

@tactilis
Copy link

tactilis commented Jul 8, 2022

Sorry, I spoke too soon.

The toolbar no longer occupies the full width of the main window.

image

The toolbar background colour used to run across the entire width, which looks better than the above

@whalley
Copy link
Member Author

whalley commented Jul 8, 2022

Having the toolbar sized to fit the tools allows it to be moved to the right if needed and allows us to add another toolbar if needed, e.g for access to reports or whatever.

@tactilis
Copy link

tactilis commented Jul 8, 2022

OK. Understood.

@whalley
Copy link
Member Author

whalley commented Aug 5, 2022

wxWidgets team have fixed the window positioning error, so we can pick up in next wxWidgets release.... wxWidgets/wxWidgets@5c5d5f5

@vomikan vomikan added this to the v1.5.21 milestone Sep 2, 2022
@vomikan vomikan modified the milestones: v1.5.21, v1.5.22 Sep 14, 2022
@whalley
Copy link
Member Author

whalley commented Sep 19, 2022

#5100

@whalley whalley removed the on hold waiting for something label Sep 19, 2022
@whalley
Copy link
Member Author

whalley commented Sep 19, 2022

Confirmed. Fixed in wx3.2.1.

@whalley whalley added the fixed label Sep 21, 2022
@whalley whalley closed this as completed Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed mac related to OSX / MacOS
Projects
None yet
Development

No branches or pull requests

3 participants