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

Fixed the menu location in order to fit on the display it is activated #583

Merged
merged 4 commits into from
Oct 1, 2024

Conversation

Micheus
Copy link
Collaborator

@Micheus Micheus commented May 13, 2024

OBS: There are two fix on this PR because the second one was causing conflict if it was separated.

1) This issue was added when I remove a old workaround for multiple display
setup and didn't pay attention that it was also making the menu window
to fit on a display. I revert the commit and rewrote it.

It's not perfect for setups where the displays have different resolution.
When the window is placed entirely on a display everything works fine, but
if a window is shared by multiple displays, in a location where
a window is scaled, the correct dimensions can not be safely evaluated
and then we can still get the popup menu cropped. (see images bellow)

IMG_20231017_163219

IMG_20231017_163118

2) This issue was introduced by the fix for another menu issue that was crashing
Wings3D when closing a window with the context menu active (commit: #be68730).
* It can be seen in the previous image in which we see two items selected when the menu was shown.

The fix redraw the entire menu unselected before it be displayed. It was also
needed to find for the window of the submenu item because it's not stored in
the object property of menudata.

NOTE:

  • Fixed the popup menu location that can be shown out of screen.
    Thanks to Xavier
  • Fixed the menu selection that was letting garbage.
    Thanks to sciroccorics

Micheus added 3 commits May 13, 2024 15:43
This issue was added when I remove a old workaround for multiple display
setup and didn't pay attention that it was also making the menu window
to fit on a display. I revert the commit and rewrote it.

It's not perfect for setups where the displays have different resolution.
In that situation if a window is shared by multiple displays in a location
where a window is scaled the correct dimensions can not be safely evaluated
and then we can still get the popup menu cropped.

NOTE: Fixed the popup menu location that can be shown out of screen.
Thanks to Xavier
This issue was introduced by the fix for another menu issue that was crashing
Wings3D when closing a window with the context menu active (commit: #be68730)

The fix redraw the entire menu unselected before it be displayed. It was also
needed to find for the window of the submenu item because it's not stored in
the object property of menudata.

NOTE: Fixed the menu selection that was letting garbage. Thanks to sciroccorics
Comment on lines -394 to +401
{move, Pos} ->
{move, {X,Y}} ->
Frame = maps:get(frame, MenuData),
Pos = fit_menu_on_display(Frame, {X,Y}),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use Pos here?

src/wings_menu.erl Outdated Show resolved Hide resolved
@dgud dgud merged commit 5afc4fe into dgud:master Oct 1, 2024
2 checks passed
@Micheus Micheus deleted the mv/v2.3-fix-menu-cropped branch October 22, 2024 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants