eclipse.platform.swt icon indicating copy to clipboard operation
eclipse.platform.swt copied to clipboard

[Win32] Shell image broken

Open tmssngr opened this issue 7 months ago • 42 comments
trafficstars

Describe the bug After having upgraded SWT from commit 1ced8a9c to 3670670e in our application it happens occasionally that the image for some shell is missing.

To Reproduce Unfortunately, I have not yet found a way to reproduce it reliably.

Expected behavior The set image should be used. It work without problem until at least commit 1ced8a9c.

Screenshots Image

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • [ ] All OS
    • [x] Windows
    • [ ] Linux
    • [ ] macOS
  1. Additional OS info (e.g. OS version, Linux Desktop, etc) Windows 11

tmssngr avatar Apr 17 '25 17:04 tmssngr

It looks like this behavior is not fixed, but changes during runtime (an invalid image can turn into a correct one).

tmssngr avatar Apr 22 '25 10:04 tmssngr

As this screenshot indicates, the icon is set (see hover), but does not show correctly in the status bar Image

tmssngr avatar Apr 24 '25 12:04 tmssngr

@HeikoKlare Could this bug be resolved with your commit 28fdeb6d?

tmssngr avatar Apr 28 '25 09:04 tmssngr

To be honest, I cannot say whether that commit might have fixed it. The mentioned commit fixes a slight change in behavior that was introduced in the recent months, but without knowing which commit extractly introduced the behavior you report and without being able to properly reproduce it, it's hard to say whether it is fixed now 😟

HeikoKlare avatar Apr 29 '25 10:04 HeikoKlare

@tmssngr Can you please reevaluate with latest master state? We are not able to reproduce the issue. There was another issue with the program icon used for the shell (https://github.com/eclipse-platform/eclipse.platform.swt/issues/2139), but the issue was introduced after the problematic state you refer to. When doing the fix, we also did not experience your issue.

For a reproduction, please also report all relevant configuration (monitor setups, zoom, SWT configuration like autoscale etc.). It's likely that this is somehow related to specific autoscale settings and monitor zooms, but hard to analyze without knowing about the actual settings.

HeikoKlare avatar May 13 '25 08:05 HeikoKlare

There was another issue with the program icon used for the shell (#2139), but the issue was introduced after the problematic state you refer to.

I just added a Workaround to #2139. In there, I mention if the window is not minimized then the issue does not occur. You could try that @tmssngr and see if that's also the case for you (i.e. in this issue). I assume we're all talking about the exact same issue, it's just tricky to nail it down.

fedejeanne avatar May 13 '25 09:05 fedejeanne

I was not able to reliably reproduce the problem. After having switched to SWT commit b8dd8041, I suggest to close this ticket for now and will reopen it if the problem occurs again.

tmssngr avatar May 13 '25 10:05 tmssngr

Hm, ok. I see that you used a commit that does not contain my fix for https://github.com/eclipse-platform/eclipse.platform.swt/issues/2139 (b22775034b12a372ce1ef1cdb9533ac31afd7096) so it might be indeed some other issue.

I'm fine with closing this issue until the problem is reproducible.

fedejeanne avatar May 13 '25 10:05 fedejeanne

This issue was there before the issue fixed with #2139 was introduced, so rather unlikely that the fix affected this PR. Still, there were so many changes to images that it might just have a been a "bad" development state in which the original issue occurred.

HeikoKlare avatar May 13 '25 11:05 HeikoKlare

Right now the Windows taskbar shows no icon while the shell's left top and the Alt-Tab popup does. Hence I reopen.

Image Is there anything I can debug to understand this problem?

tmssngr avatar May 13 '25 16:05 tmssngr

First thing I would do is to collect all information on how to reproduce so that we can easily start debugging, i.e, the version of SWT, all zoom- and auto-scale-related settings, the workflow to achieve that result, ...

HeikoKlare avatar May 13 '25 16:05 HeikoKlare

IIRC, I wrote that the problem is not reproducible reliably. Is there some assertion which can be added when setting the image to the shell?

tmssngr avatar May 13 '25 16:05 tmssngr

I also see some missing icons at the Eclipse item in the Windows toolbar and IIRC also for the shell. Currently it doesn't happen, but I'll keep an eye on it. My settings are: Win10, 4K-Monitors at 175% zoom, swt.autoScale=quarter and swt.autoScale.method=SMOOTH.

HannesWell avatar May 13 '25 18:05 HannesWell

I’ve seen this too but it comes and goes and is currently gone. My main monitor is at 100%.

merks avatar May 13 '25 18:05 merks

Do you know whether that might have been https://github.com/eclipse-platform/eclipse.platform.swt/issues/2139 or is/was it something different?

Is there some assertion which can be added when setting the image to the shell?

I have to admit if all shell images (shell itself, application switch preview, taskbar etc.) are retrieved from the same image instance set at the same place. If that's the case, it is probably set via Decorations#setImages() where you could place an assertion. If this behavior is a regression, it might be because of any of the changes to the Image class or because of a change to the according method in the Decorations class (https://github.com/eclipse-platform/eclipse.platform.swt/pull/1879).

HeikoKlare avatar May 13 '25 19:05 HeikoKlare

It definitely is a regression. It must have been introduced between 1ced8a9c (good) and 3670670e (bad). Sorry, I don't have a smaller range.

tmssngr avatar May 14 '25 06:05 tmssngr

@tmssngr Is the version of SWT with this issue in the latest version of SmartGit Preview? Does it occur in the main SG Shell or a child Shell? Any more clues (screen resolution, scaling?)

Phillipus avatar May 14 '25 06:05 Phillipus

The latest SmartGit 25.1 preview build is based on b8dd804. The problem did not occur with the SWT build used in SmartGit 24.1. I have seen it for top level shells on Windows. My Windows machines use 150% and 175% zoom.

tmssngr avatar May 14 '25 08:05 tmssngr

The latest SmartGit 25.1 preview build is based on https://github.com/eclipse-platform/eclipse.platform.swt/commit/b8dd80410b62e1c17271de084b296d0cd74191f0.

Note that the mentioned commit is affected by https://github.com/eclipse-platform/eclipse.platform.swt/issues/2139. And note that throughout a development cycle, there may always be commits that introduce a regression (which is usually fixed short after). That's why it's so important to know about the state used when an issue was faced and, in best case, to retest on the current master state. And for all potentiall HiDPI-related issues, it's important to know the auto-scale settings, the monitor configuration (how many monitors at which zooms and which of the is primary).

HeikoKlare avatar May 14 '25 08:05 HeikoKlare

I just have one monitor here. So you suggest this bug might be fixed by updating to latest master?

tmssngr avatar May 14 '25 09:05 tmssngr

It might. The version you refer to definitely contained a bug regarding program icons (as documented in the referenced issue). Whether or nor that's the cause for the behavior you have faced is hard to say.

HeikoKlare avatar May 14 '25 18:05 HeikoKlare

I've heavily tested against this issue on latest master state:

  • Two monitors with changing zoom values: different on startup, changed at runtime, low difference and high difference (e.g. 125/200), with changes on both primary and secondary monitor
  • Monitor-specific scaling enabled and disabled, i.e., once with swt.autoScale=integer200 (default without monitor-specific scaling) and with swt.autoScale=quarter (default with monitor-specific scaling)

I was not able to produce a broken shell image in any of the use cases.

HeikoKlare avatar May 16 '25 11:05 HeikoKlare

I've also not seen this in days...

merks avatar May 16 '25 12:05 merks

So cherry-picking d12ad69a would be sufficient to get the fix? After the regressions I had the last 3 times I've upgraded SWT, I'm somewhat reluctant to update to the most bleeding edge state.

tmssngr avatar May 16 '25 16:05 tmssngr

So cherry-picking d12ad69 would be sufficient to get the fix?

It will resolve https://github.com/eclipse-platform/eclipse.platform.swt/issues/2139. Since there is no reproduction for your exact issue, it's hard to say whether it fixes your issue.

After the regressions I had the last 3 times I've upgraded SWT, I'm somewhat reluctant to update to the most bleeding edge state.

To be honest, I really don't like such "passive aggresive" formulations. Which regressions do you refer to? Note that you seem to have always updated to development states, so there may of course be issues in such states. We have just reached M3, so the current master state will be (almost) equal to what the next release contains.

HeikoKlare avatar May 16 '25 17:05 HeikoKlare

I'm cherry-picking d12ad69 and will report after a couple of daily usage whether the missing app icons still appear.

tmssngr avatar May 17 '25 12:05 tmssngr

Unfortunately, having cherry-picked d12ad69 did not fix the broken shell image problem for me.

tmssngr avatar May 23 '25 08:05 tmssngr

Same problem for me. In my app, I have a default shell icon, instead the ones from my app that I've set with shell.setimages

vicenrico avatar Aug 20 '25 15:08 vicenrico

@vicenrico Can you explain how to reproduce the issue? Can you provide any snippet or workflow?

We have not faced this issue for many weeks or months, so it is impossible to work on the issue without a reproducer.

HeikoKlare avatar Aug 20 '25 15:08 HeikoKlare

Not getting any more feedback from me regarding this topic does not mean the problem is fixed. We just switched to an older SWT build for the upcoming SmartGit release. As I already wrote, the issue was not possible to reproduce reliably for me - I know that these bugs are very hard to fix. I only see a way to find out which commit introduced the regression using binary search approach and testing for a couple of weeks. But this takes time or a lot of users willing to test with older SWT builds.

tmssngr avatar Aug 20 '25 17:08 tmssngr