eclipse-platform / eclipse.platform.ui

Eclipse Platform
https://projects.eclipse.org/projects/eclipse.platform
Eclipse Public License 2.0
81 stars 185 forks source link

UI Freeze on macOS with long texts on progress monitor #1112

Open guw opened 1 year ago

guw commented 1 year ago
Stack Trace
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSend_stret(Native Method)
    at org.eclipse.swt.internal.cocoa.NSLayoutManager.glyphRangeForTextContainer(NSLayoutManager.java:88)
    at org.eclipse.swt.graphics.GC.textExtent(GC.java:4148)
    at org.eclipse.swt.graphics.GC.textExtent(GC.java:4104)
    at org.eclipse.jface.dialogs.Dialog.shortenText(Dialog.java:375)
    at org.eclipse.ui.internal.progress.ProgressInfoItem.updateText(ProgressInfoItem.java:825)
    at org.eclipse.ui.internal.progress.ProgressInfoItem.setLinkText(ProgressInfoItem.java:750)
    at org.eclipse.ui.internal.progress.ProgressInfoItem.refresh(ProgressInfoItem.java:532)
    at org.eclipse.ui.internal.progress.DetailedProgressViewer.internalRefresh(DetailedProgressViewer.java:371)

I recall seeing this before but I did not find an issue or Bugzilla bug. The problem is that NSLayoutManager.glyphRangeForTextContainer seems to be horrendously slow on macOS. It's better to cut the text length already before calling this method. Maybe Dialog.shortenText should have a check to prevent too long string on macOS?

In case anybody is running into this as well: the text is too long. This can also be fixed/worked around at the caller side.

guw commented 1 year ago

This looks/smells very related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=458872