Skip to content

Conversation

@ShahzaibIbrahim
Copy link
Contributor

Setting an image for a shell on top left disappears on monitor change in monitor specific scaling mode. The reason behind it was that the image was being disposed by setImages method called after setImage in handleDPIChanged. The setImages method should not have been called if there are no images present in the array. The solution is to check whether we have any images in the in the array with the null check.

How to Reproduce

  • Run the following snippet with the following arguments
    -Dswt.autoScale.updateOnRuntime=true
    -Dswt.autoScale=quarter
    
 Display display = new Display();
 Image image1 = display.getSystemImage(SWT.ICON_WORKING);
 Shell shell = new Shell(display);
 shell.setText("My Snippet");
 shell.setImage(image1);
 shell.open();
 while (!shell.isDisposed()) {
     if (!display.readAndDispatch()) {
   	  display.sleep();
     }
 }
 display.dispose();
  • Move the shell from one monitor to another (with different zoom levels)
  • The icon on top left of the shell will disappear

image

Expected Result

The icon on top left should remain intact after the zoom change

@ShahzaibIbrahim ShahzaibIbrahim marked this pull request as ready for review February 13, 2025 10:43
@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2025

Test Results

   502 files  ±0     502 suites  ±0   10m 9s ⏱️ - 1m 4s
 4 334 tests ±0   4 320 ✅ ±0   14 💤 ±0  0 ❌ ±0 
16 575 runs  ±0  16 466 ✅ ±0  109 💤 ±0  0 ❌ ±0 

Results for commit 10745e4. ± Comparison against base commit 12e0564.

♻️ This comment has been updated with latest results.

Setting an image for a shell on top left disappears on monitor change in
monitor specific scaling mode. The reason behind it was that the image
was being disposed by setImages method called after setImage in
handleDPIChanged. The setImages method should not have been called if
there are no images present in the array. The solution is to check
whether we have any images in the in the array with the null check.
@HeikoKlare HeikoKlare merged commit 857ac0b into eclipse-platform:master Feb 13, 2025
14 checks passed
@HeikoKlare HeikoKlare deleted the master-231 branch February 13, 2025 16:44
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.

Shell Icon disappears on zoom change (Monitor Specific scaling)

2 participants