Skip to content

Ensure sendMeasureItemEvent is only called for OS.TTN_SHOW or custom tooltips #2324

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arunjose696
Copy link
Contributor

@arunjose696 arunjose696 commented Jul 17, 2025

Prior to PR #2241, Table.sendMeasureItemEvent was only invoked when the tooltip was not a CustomTooltip. However, after that change, sendMeasureItemEvent() is now called for all tooltips.

This results in an unintended side effect: sendMeasureItemEvent() compares the item's width(obtained from TableItem.getBounds()) to the width of column it is present in (obtained from OS.LVM_GETCOLUMNWIDTH) and sometimes concludes incorrectly that the item doesn't fit. This causes an unnecessary scrollbar to appear, even though the item is fully contained within the column.

While the root cause is possibly in how column item width is calculated (which should be addressed separately), this change acts as a fix to prevent scrollbars from appearing erroneously.

This workaround aligns with the original behavior prior to PR #2241 as sendMeasureItemEvent would not be called for non customToolTip and restores expected UI behavior for now.

Steps to reproduce

See the steps in vi-eclipse/Eclipse-Platform#360

@arunjose696 arunjose696 force-pushed the arunjose696/360/scrollbars_temp_fix branch from 943caec to abec851 Compare July 17, 2025 14:07
Copy link
Contributor

github-actions bot commented Jul 17, 2025

Test Results

   546 files  ±0     546 suites  ±0   30m 29s ⏱️ - 1m 3s
 4 407 tests ±0   4 390 ✅ ±0   17 💤 ±0  0 ❌ ±0 
16 713 runs  ±0  16 586 ✅ ±0  127 💤 ±0  0 ❌ ±0 

Results for commit ca8bfa0. ± Comparison against base commit ac52a23.

♻️ This comment has been updated with latest results.

@amartya4256 amartya4256 force-pushed the arunjose696/360/scrollbars_temp_fix branch 2 times, most recently from e399177 to d0d48ce Compare July 17, 2025 15:02
tooltips

Prior to PR eclipse-platform#2241, sendMeasureItemEvent was only invoked when the
tooltip was not a CustomTooltip. However, after that change,
sendMeasureItemEvent is now called for all tooltips.

This results in an unintended side effect: sendMeasureItemEvent compares
the item's width(obtained from TableItem.getBounds()) to the width of column (via OS.LVM_GETCOLUMNWIDTH) it is present in and sometimes
concludes incorrectly that the item doesn't fit. This causes an
unnecessary scrollbar to appear, even though the item is fully contained
within the column.

While the root cause lies in how column item width is calculated (which
should be addressed separately), this change acts as a temporary fix to
prevent scrollbars from appearing erroneously particularly in the
MultipleHyperlinkPresenter.

This workaround aligns with the original behavior prior to PR eclipse-platform#2241 as
sendMeasureItemEvent would not be called for non customToolTip and
restores expected UI behavior for now.
@amartya4256 amartya4256 force-pushed the arunjose696/360/scrollbars_temp_fix branch from d0d48ce to ca8bfa0 Compare July 17, 2025 15:03
@amartya4256
Copy link
Contributor

amartya4256 commented Jul 17, 2025

To simplify this, SendMeasureItemEvent should only be called in 2 cases:

  1. When isCustomToolTip() is true: This compliments the state of the Table tooltip implmentation before Positioning of tooltip on a single monitor was implemented.
  2. When TTN_SHOW is called: As we need to re-position any kind of tooltip.

Hence, the condition in which it must not be called on a WM_NOTIFY message is when isCustomTooltip() is false and the message is a TTN_GETDISPINFO as calling this method can modify the tooltip in this case.

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.

Scrollbars appear over MultipleHyperlinkPresenter
2 participants