-
Notifications
You must be signed in to change notification settings - Fork 168
Fit tooltip of the tree on a single monitor #62 #2142
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
Fit tooltip of the tree on a single monitor #62 #2142
Conversation
9ce016e
to
71e41cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only small comments but it looks good. @HeikoKlare once the changes are done then I consider this PR approved ✔️
Thx @amartya4256 !
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the proposal and the nice explanation of how it works.
When testing, I made some observation:
- When a different window has focus while I hover over an element having such a tooltip (like in the breakpoints view), it has a wrong size and shows some artifacts. However, I found that we have the same behavior already in the current master state:
- To see the tooltip, you need to move the mouse from somewhere outside of the element directly onto the text. If you first hover over the checkbox and then to the text, the tooltip will not show up. That's a slight derivation from existing behavior. Is there a way to fix that?
Finally, the issues linked in the commit seem to be inappropriate. I think the fitting issue is this, isn't it?
71e41cf
to
4593ef6
Compare
result = LRESULT.ONE; | ||
} | ||
} else { | ||
// If managedTooltip is false and the cursor is not over the valid part of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand this comment: how is managedTooltip
relevant here? I don't see that it's checked for this condition branch at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there should be a check here so that we don't affect anything for custom tooltips.
This else should only execute when managedTooltip == false
. I'll make the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this has no effect on custom tooltips visually, it's better to have that check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested and I can confirm that the extra check if (!managedTooltip)
doesn't change the functionality. Furthermore, the whole else
block has been added by this PR, which also adds the call to the method positionTooltip(..., false)
meaning that this extra check further ensures that the previous use case (which is now the call to positionTooltip(..., true);
in line 8150) is not affected.
All in all, I think this change is OK.
4593ef6
to
08f99b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @amartya4256 !
This PR solves the critical UI freeze problem at a very low cost of not seeing the popup when first hovering on the checkbox and only later on the name of the method (See point Nr. 2 in #2142 (review)).
I accept that trade and propose to look at the introduced behavior in a follow-up PR.
@HeikoKlare if there are no objections on your side, I'll merge this one today.
Marty found a problem. Awaiting improvement
This commit contributes to handling wmNotify event for tooltip of a Tree regardless of if the Tree object maintains the handle of the tooltip in itemToolTipHandle. If there's a tooltip which is not handled by wmNotifyToolTip, it is completely maintained by windows and hence can span over multiple montiors. Hence, with this PR such tooltips are also positioned inside a single monitor to prevent any infinite loop. Contributes to eclipse-platform#62 and eclipse-platform#128
08f99b7
to
1a3c66d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the latest version (see changes) and I can confirm that the very last issue that @amartya4256 found is fixed.
FTR the issue was triggered like this:
- Primary monitor on the right: 175% zoom
- Secondary monitor on the left: 125% zoom
- Open the workbench on the monitor on the left
- Let the popups try to cross over to the monitor on the right --> UI Freeze
The failing check is unrelated and it resembles the failures that we had a few days ago when we had infrastructure issues (403 Forbidden
is the hint). The checks for previous the status of this PR were all green so I'll ignore the check for now. Here's the current failure:
Error: Plugin org.eclipse.tycho:tycho-versions-plugin:4.0.13-SNAPSHOT or one of its dependencies could not be resolved:
Error: The following artifacts could not be resolved: org.eclipse.tycho:tycho-versions-plugin:pom:4.0.13-SNAPSHOT (absent): org.eclipse.tycho:tycho-versions-plugin:pom:4.0.13-SNAPSHOT failed to transfer from https://repo.eclipse.org/content/repositories/tycho-snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of tycho-snapshots has elapsed or updates are forced. Original error: Could not transfer artifact org.eclipse.tycho:tycho-versions-plugin:pom:4.0.13-SNAPSHOT from/to tycho-snapshots (https://repo.eclipse.org/content/repositories/tycho-snapshots/): status code: 403, reason phrase: Forbidden (403)
So, now it's ready to go on my account.
FYI, there appear to be server problems: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/6135 |
This PR contributes to handling wmNotify event for tooltip of a Tree regardless of if the Tree object maintains the handle of the tooltip in itemToolTipHandle. If there's a tooltip which is not handled by wmNotifyToolTip, it is completely maintained by windows and hence can span over multiple montiors. Hence, with this PR such tooltips are also positioned inside a single monitor to prevent any infinite loop.
Here's the explanation:
Contributes to
#62 and #128
Replaces and thus closes #2142