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

[HiDPI] [Windows] java.lang.NullPointerException: Cannot invoke "org.eclipse.swt.widgets.Display.getPrimaryMonitor()" because the return value of "org.eclipse.swt.widgets.Display.getCurrent()" is null #1759

Open
rhoehener opened this issue Jan 24, 2025 · 1 comment

Comments

@rhoehener
Copy link

Eclipse 2024-12, log at startup. Windows 11, 3-Monitor setup (primary 8k + 4k + HD).

!SUBENTRY 1 org.eclipse.ui 4 4 2025-01-24 09:20:39.008
!MESSAGE Cannot invoke "org.eclipse.swt.widgets.Display.getPrimaryMonitor()" because the return value of "org.eclipse.swt.widgets.Display.getCurrent()" is null
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.swt.widgets.Display.getPrimaryMonitor()" because the return value of "org.eclipse.swt.widgets.Display.getCurrent()" is null
	at org.eclipse.swt.program.Program.getImageData(Program.java:385)
	at org.eclipse.ui.internal.misc.ExternalProgramImageDescriptor.getImageData(ExternalProgramImageDescriptor.java:68)
	at org.eclipse.swt.internal.DPIUtil.lambda$2(DPIUtil.java:543)
	at org.eclipse.swt.internal.DPIUtil.getElementAtZoom(DPIUtil.java:572)
	at org.eclipse.swt.internal.DPIUtil.validateAndGetImageDataAtZoom(DPIUtil.java:543)
	at org.eclipse.swt.graphics.Image.<init>(Image.java:634)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:340)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:289)
	at org.eclipse.ui.internal.registry.EditorDescriptor.getImageDescriptor(EditorDescriptor.java:304)
	at org.eclipse.ui.internal.ide.ContentTypeDecorator.decorate(ContentTypeDecorator.java:57)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:254)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:105)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:359)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:345)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.queue(DecorationScheduler.java:410)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:388)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
@jpstotz
Copy link

jpstotz commented Jan 31, 2025

I have the same problem in Eclipse 2024-06 on Windows 10.
There is only one Full-HD display connected, configured in Windows to 100% scale.

java.lang.NullPointerException: Cannot invoke "org.eclipse.swt.widgets.Display.getPrimaryMonitor()" because the return value of "org.eclipse.swt.widgets.Display.getCurrent()" is null
	at org.eclipse.swt.program.Program.getImageData(Program.java:385)
	at org.eclipse.ui.internal.misc.ExternalProgramImageDescriptor.getImageData(ExternalProgramImageDescriptor.java:68)
	at org.eclipse.swt.internal.DPIUtil.lambda$2(DPIUtil.java:550)
	at org.eclipse.swt.internal.DPIUtil.getElementAtZoom(DPIUtil.java:579)
	at org.eclipse.swt.internal.DPIUtil.validateAndGetImageDataAtZoom(DPIUtil.java:550)
	at org.eclipse.swt.graphics.Image.<init>(Image.java:728)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:340)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:289)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:267)
	at org.eclipse.compare.internal.CompareUIPlugin.getImage(CompareUIPlugin.java:752)
	at org.eclipse.compare.CompareUI.getImage(CompareUI.java:270)
	at org.eclipse.team.svn.ui.compare.ResourceCompareInput.getLeftImage(ResourceCompareInput.java:309)

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

No branches or pull requests

2 participants