Skip to content

Commit ec89772

Browse files
committed
Issue #603: [win32] Windows TaskBar shows wrong overlay after closing related Shell
Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
1 parent 27f5e36 commit ec89772

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskItem.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,28 @@ protected void checkSubclass () {
9090

9191
@Override
9292
void destroyWidget () {
93+
if (null != parent.mTaskbarList3) { // extra safety just in case
94+
// MSDN for 'ITaskbarList3::SetOverlayIcon' says:
95+
// Because a single overlay is applied to the taskbar button instead
96+
// of to the individual window thumbnails, this is a per-group
97+
// feature rather than per-window. Requests for overlay icons can
98+
// be received from individual windows in a taskbar group, but they
99+
// do not queue. The last overlay received is the overlay shown.
100+
// If the last overlay received is removed, the overlay that it
101+
// replaced is restored so long as it is still active. As an example,
102+
// windows 1, 2, and 3 set, in order, overlays A, B, and C.
103+
// Because overlay C was received last, it is shown on the taskbar button.
104+
// Window 2 calls SetOverlayIcon with a NULL value to remove overlay B.
105+
// Window 3 then does the same to remove overlay C.
106+
// Because window 1's overlay A is still active, that overlay is then
107+
// displayed on the taskbar button.
108+
// This implies that Shell should pass NULL before closing.
109+
//
110+
// Issue #603: On Win11 the lack of this actually caused wrong overlay
111+
// to show after closing Shell.
112+
parent.mTaskbarList3.SetOverlayIcon(shell.handle, 0, 0);
113+
}
114+
93115
parent.destroyItem (this);
94116
releaseHandle ();
95117
}

0 commit comments

Comments
 (0)