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

[macOS?] Sizers are not setting the size of windows correctly #24530

Open
hwiesmann opened this issue May 14, 2024 · 2 comments
Open

[macOS?] Sizers are not setting the size of windows correctly #24530

hwiesmann opened this issue May 14, 2024 · 2 comments
Labels
macOS Specific to Cocoa macOS port

Comments

@hwiesmann
Copy link
Contributor

hwiesmann commented May 14, 2024

Description

When running the widgets sample the following window opens:

Bildschirmfoto 2024-05-14 um 22 12 44

The upper panel that should show the treebook is clearly not sized correctly. After changing the frame's size the panel is sized correctly.

I think that this is a regression related to some older patches as I have not seen this in (much) older version of wxWidgets.

Platform and version information

  • wxWidgets version you use: up-to-date master branch from GitHub
  • wxWidgets port you use: macOS 14.4.1
@vadz vadz added the macOS Specific to Cocoa macOS port label May 15, 2024
@vadz
Copy link
Contributor

vadz commented May 15, 2024

I can indeed see this, although I had to delete ~/Library/Preferences/widgets Preferences as with it, i.e. when the previously saved position is restored, everything works correctly.

It looks like there is a missing size event, and so layout, on startup, but calling Layout() explicitly doesn't help. I'm not sure what's going on here, more debugging is needed...

@hwiesmann
Copy link
Contributor Author

The main reason for this issue seems to be that adding a page to the tree book does not trigger a request to resize the tree control (only the best size is invalidated). As the tree book has a defined size and the panel's sizer is happy with the tree book's size, the tree book also does not send a resize event (only a move event).
Therefore, nothing is triggering a resize event for the tree control. This means that the size of the tree control is the size when the tree control is created.
Whenever the size of the frame or panel changes, the tree book issue a size event and as a consequence of this event the tree control's size is newly determined.

I have no other idea how to solve this issue besides calling m_book->Layout() after InitBook().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macOS Specific to Cocoa macOS port
Projects
None yet
Development

No branches or pull requests

2 participants