Commit b5c57b9a authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

explorer: Set layered style on systray icons only when it's actually layered.

Fixes a regression introduced by 229b4561, which caused the icons to not be visible initially in the virtual desktop systray. Signed-off-by: 's avatarGabriel Ivăncescu <gabrielopcode@gmail.com>
parent 5e7a8f4d
...@@ -624,6 +624,7 @@ static BOOL show_icon(struct icon *icon) ...@@ -624,6 +624,7 @@ static BOOL show_icon(struct icon *icon)
{ {
icon->display = ICON_DISPLAY_DOCKED; icon->display = ICON_DISPLAY_DOCKED;
icon->layered = TRUE; icon->layered = TRUE;
SetWindowLongW( icon->window, GWL_EXSTYLE, GetWindowLongW( icon->window, GWL_EXSTYLE ) | WS_EX_LAYERED );
SendMessageW( icon->window, WM_SIZE, SIZE_RESTORED, MAKELONG( icon_cx, icon_cy ) ); SendMessageW( icon->window, WM_SIZE, SIZE_RESTORED, MAKELONG( icon_cx, icon_cy ) );
} }
systray_add_icon( icon ); systray_add_icon( icon );
...@@ -645,6 +646,7 @@ static BOOL hide_icon(struct icon *icon) ...@@ -645,6 +646,7 @@ static BOOL hide_icon(struct icon *icon)
{ {
icon->display = ICON_DISPLAY_HIDDEN; icon->display = ICON_DISPLAY_HIDDEN;
icon->layered = FALSE; icon->layered = FALSE;
SetWindowLongW( icon->window, GWL_EXSTYLE, GetWindowLongW( icon->window, GWL_EXSTYLE ) & ~WS_EX_LAYERED );
} }
ShowWindow( icon->window, SW_HIDE ); ShowWindow( icon->window, SW_HIDE );
systray_remove_icon( icon ); systray_remove_icon( icon );
...@@ -732,7 +734,7 @@ static BOOL add_icon(NOTIFYICONDATAW *nid) ...@@ -732,7 +734,7 @@ static BOOL add_icon(NOTIFYICONDATAW *nid)
icon->owner = nid->hWnd; icon->owner = nid->hWnd;
icon->display = ICON_DISPLAY_HIDDEN; icon->display = ICON_DISPLAY_HIDDEN;
CreateWindowExW( WS_EX_LAYERED, tray_icon_class.lpszClassName, NULL, WS_CLIPSIBLINGS | WS_POPUP, CreateWindowExW( 0, tray_icon_class.lpszClassName, NULL, WS_CLIPSIBLINGS | WS_POPUP,
0, 0, icon_cx, icon_cy, 0, NULL, NULL, icon ); 0, 0, icon_cx, icon_cy, 0, NULL, NULL, icon );
if (!icon->window) ERR( "Failed to create systray icon window\n" ); if (!icon->window) ERR( "Failed to create systray icon window\n" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment