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

PopupMenu visual issues in 3.6 RC1 #96149

Closed
Alternalo opened this issue Aug 27, 2024 · 6 comments
Closed

PopupMenu visual issues in 3.6 RC1 #96149

Alternalo opened this issue Aug 27, 2024 · 6 comments

Comments

@Alternalo
Copy link

Tested versions

  • Reproducible in 3.6 RC1
  • Not reproducible in 3.5.2 Stable

System information

Windows 10

Issue description

Simply adding a PopupMenu to the scene with some items will result in this look in 3.5.2:
popupmenu_3 5

Doing the same thing in 3.6 RC1 will make it look like this
popupmenu_3 6

And applying separators on items in 3.6 will make it look like this
popupmenu_with_separators_3 6

Steps to reproduce

  • Create a new UI scene
  • Add a PopupMenu node to the scene
  • Add items to the Popupmenu node
  • Make the node visible, so you can see the issue

Minimal reproduction project (MRP)

PopupIssue.zip

@lawnjelly
Copy link
Member

Haven't bisected, but likely related to:
#66711
@rsubtil

@akien-mga
Copy link
Member

akien-mga commented Sep 3, 2024

Haven't bisected, but likely related to: #66711 @rsubtil

Indeed, I've confirmed that reverting that PR (and the follow-ups which fixed regressions from that PR) would solve this issue. Branch with all relevant changes reverted: https://github.com/akien-mga/godot/commits/revert-66711/

That's one option, but a heavy handed one at this stage, it would be good to at least get the issue debugged a bit to see if the problem is a fundamental one that will require e.g. breaking the behavior again, or an oversight that can be patched easily.

@rsubtil
Copy link
Contributor

rsubtil commented Sep 3, 2024

I can have a quick look in the coming days, but if the issue is not simple, I don't think I'll have the availability to fix it. I'll leave any findings if that's the case, maybe someone can pick up from there.

@timothyqiu
Copy link
Member

timothyqiu commented Sep 4, 2024

Moving the four add_constant_override() calls to NOTIFICATION_VISIBILITY_CHANGED (the same as the original #41640) seems to solve the issue.

case NOTIFICATION_POST_POPUP: {
initial_button_mask = Input::get_singleton()->get_mouse_button_mask();
during_grabbed_click = (bool)initial_button_mask;
// Set margin on the margin container
Ref<StyleBox> panel_style = get_stylebox("panel");
margin_container->add_constant_override("margin_top", panel_style->get_margin(Margin::MARGIN_TOP));
margin_container->add_constant_override("margin_bottom", panel_style->get_margin(Margin::MARGIN_BOTTOM));
margin_container->add_constant_override("margin_left", panel_style->get_margin(Margin::MARGIN_LEFT));
margin_container->add_constant_override("margin_right", panel_style->get_margin(Margin::MARGIN_RIGHT));
} break;

Note that there is also a later PR that removes the need for a separate MarginContainer on the master branch.

@lawnjelly
Copy link
Member

It looks like the fix #87462 itself may introduce more regressions.
This illustrates the pitfalls of cherry picking from 4.x in areas such as GUI, because of the entangled dependencies.

I guess we must also consider @akien-mga 's test approach of reverting all the popup menu related PRs to 3.5 state.

akien-mga added a commit to akien-mga/godot that referenced this issue Sep 4, 2024
Fixes godotengine#96149.

Co-authored-by: Haoyu Qiu <timothyqiu32@gmail.com>
@lawnjelly
Copy link
Member

Fixed by #96557 .

@akien-mga akien-mga modified the milestones: 3.x, 3.6 Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants