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

SWTException "unsupported color type" when moving between differently scaled monitors #226

Closed
HeikoKlare opened this issue Feb 4, 2025 · 2 comments · Fixed by eclipse-platform/eclipse.platform.swt#1790
Assignees
Labels
Bug A Derivation of Expected Behavior HiDPI A HiDPI-Related Issue or Feature SWT Issue for SWT
Milestone

Comments

@HeikoKlare
Copy link
Contributor

How to reproduce

  • Primary monitor (to the right): 150%
  • Secondary monitor (to the left): 100%
  1. Start the ControlExample (on 150% monitor)
  2. Move the shell to the secondary 100% monitor
  3. Move the shell back to the primary 150% monitor
  4. The application crashes with an SWTException (see below)

Log

This exception is logged:

Exception in thread "main" org.eclipse.swt.SWTException: Unsupported color depth
	at org.eclipse.swt.SWT.error(SWT.java:4932)
	at org.eclipse.swt.SWT.error(SWT.java:4847)
	at org.eclipse.swt.SWT.error(SWT.java:4818)
	at org.eclipse.swt.graphics.Image$ImageHandle.getImageData(Image.java:2568)
	at org.eclipse.swt.graphics.Image.getImageData(Image.java:1402)
	at org.eclipse.swt.internal.ImageList.set(ImageList.java:413)
	at org.eclipse.swt.internal.ImageList.lambda$1(ImageList.java:400)
	at java.base/java.util.HashMap.forEach(HashMap.java:1421)
	at org.eclipse.swt.internal.ImageList.setForAllHandles(ImageList.java:400)
	at org.eclipse.swt.internal.ImageList.add(ImageList.java:64)
	at org.eclipse.swt.widgets.Button._setImage(Button.java:144)
	at org.eclipse.swt.widgets.Button.handleDPIChange(Button.java:1571)
	at org.eclipse.swt.internal.DPIZoomChangeRegistry.applyChange(DPIZoomChangeRegistry.java:55)
	at org.eclipse.swt.widgets.Composite.handleDPIChange(Composite.java:1984)
	at org.eclipse.swt.internal.DPIZoomChangeRegistry.applyChange(DPIZoomChangeRegistry.java:55)
	at org.eclipse.swt.widgets.Composite.handleDPIChange(Composite.java:1984)
	at org.eclipse.swt.internal.DPIZoomChangeRegistry.applyChange(DPIZoomChangeRegistry.java:55)
	at org.eclipse.swt.widgets.Composite.handleDPIChange(Composite.java:1984)
	at org.eclipse.swt.internal.DPIZoomChangeRegistry.applyChange(DPIZoomChangeRegistry.java:55)
	at org.eclipse.swt.widgets.Composite.handleDPIChange(Composite.java:1984)
	at org.eclipse.swt.internal.DPIZoomChangeRegistry.applyChange(DPIZoomChangeRegistry.java:55)
	at org.eclipse.swt.widgets.Composite.handleDPIChange(Composite.java:1984)
	at org.eclipse.swt.internal.DPIZoomChangeRegistry.applyChange(DPIZoomChangeRegistry.java:55)
	at org.eclipse.swt.widgets.Composite.handleDPIChange(Composite.java:1984)
	at org.eclipse.swt.internal.DPIZoomChangeRegistry.applyChange(DPIZoomChangeRegistry.java:55)
	at org.eclipse.swt.widgets.Control.WM_DPICHANGED(Control.java:4938)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4849)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:336)
	at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1482)
	at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2354)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5072)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(Native Method)
	at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:512)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4856)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:336)
	at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1482)
	at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2354)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5072)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(Native Method)
	at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:512)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4856)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:336)
	at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1482)
	at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2354)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5072)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(Native Method)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3688)
	at org.eclipse.swt.examples.controlexample.ControlExample.main(ControlExample.java:240)
@HeikoKlare HeikoKlare added this to HiDPI Feb 4, 2025
@HeikoKlare HeikoKlare converted this from a draft issue Feb 4, 2025
@HeikoKlare HeikoKlare added SWT Issue for SWT HiDPI A HiDPI-Related Issue or Feature labels Feb 4, 2025
@HeikoKlare HeikoKlare added this to the 4.35 M3 milestone Feb 4, 2025
@akoch-yatta akoch-yatta self-assigned this Feb 4, 2025
@akoch-yatta akoch-yatta moved this from 🔖 Ready: Atomic to 🏗 In Work: Short in HiDPI Feb 4, 2025
@akoch-yatta akoch-yatta added the Bug A Derivation of Expected Behavior label Feb 4, 2025
@akoch-yatta
Copy link

Is related to #71 and will be fixed by that to my testing

@ShahzaibIbrahim
Copy link

eclipse-platform/eclipse.platform.swt#1790 This PR may close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A Derivation of Expected Behavior HiDPI A HiDPI-Related Issue or Feature SWT Issue for SWT
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants