Skip to content

Fix subwindows occasionally snapping to minimum size 2: Electric Boogaloo#8396

Open
sqrvrt wants to merge 4 commits into
LMMS:masterfrom
sqrvrt:fix/whatever-the-hell-is-happening-to-subwindows-for-real-this-time
Open

Fix subwindows occasionally snapping to minimum size 2: Electric Boogaloo#8396
sqrvrt wants to merge 4 commits into
LMMS:masterfrom
sqrvrt:fix/whatever-the-hell-is-happening-to-subwindows-for-real-this-time

Conversation

@sqrvrt
Copy link
Copy Markdown
Contributor

@sqrvrt sqrvrt commented May 18, 2026

Unlike the previous PR (which this pretty much reverts aside from documentation), this completely removes the layout size constraints on SubWindow when child widget is hidden, essentially allowing it to resize freely, and reapplies them once it's shown.

Possible remaining edge cases:

  • I don't know if just applying size constraints triggers a resize if necessary; if not, it might be beneficial to manually trigger one.
  • I don't remember how the resizes behave when sizes are desynced, i.e. whether the widget fits to subwindow, or if subwindow wraps the child. Second is ideal, it's possible to emulate it by doing setGeometry on child frame plus margin, don't know if there's a better way. Need a test case to do something about it, it's possible that nothing does that as of right now. this was also a thing without this PR, probably better off as a separate issue tbh if it ever becomes relevant
    • looks like Qt doesn't do anything until the first resize event? not really sure, but a resize is now called when layout is set so this should no longer be an issue
  • When the frame is initially constructed the layout is always SetMinAndMaxSize, so if the widget was added while hidden it is possible for the bug to still occur. To do better we need to track childEvent, which is not particularly fun, or rewrite the damn thing without hijacking QMdiSubWindow (i promise i will get to it at some point ( ._.)

i also removed WindowStateChange event suppression because it seems to only cause issues and i never knew what it's even supposed to do.

Removes layout constraints when child is hidden, reapplies when child
is shown.
@sqrvrt
Copy link
Copy Markdown
Contributor Author

sqrvrt commented May 18, 2026

build fails are not mine

sqrvrt added 3 commits May 19, 2026 02:22
I didn't fully soft-revert the last fix so this happened. The issue
was that `|| visible` would steal the thing and QMdiSubWindow handler
wouldn't execute which is important for doing pretty much everything
about the window frame.
…hell-is-happening-to-subwindows-for-real-this-time
@rubiefawn rubiefawn added bug gui needs code review A functional code review is currently required for this PR needs testing This pull request needs more testing labels May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug gui needs code review A functional code review is currently required for this PR needs testing This pull request needs more testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants