winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
November 2023
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
989 discussions
Start a n
N
ew thread
Rémi Bernon : explorer: Position the balloons relative to the icon windows.
by Alexandre Julliard
28 Nov '23
28 Nov '23
Module: wine Branch: master Commit: 5312f6242d5c781e7ec0442d92f8112e97e87e0e URL:
https://gitlab.winehq.org/wine/wine/-/commit/5312f6242d5c781e7ec0442d92f811…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Jun 22 21:10:37 2023 +0200 explorer: Position the balloons relative to the icon windows. --- programs/explorer/systray.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index e35962486b3..cc2f6440115 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -154,17 +154,6 @@ static struct icon *get_icon(HWND owner, UINT id) return NULL; } -static RECT get_icon_rect( struct icon *icon ) -{ - RECT rect; - - rect.right = tray_width - icon_cx * icon->display; - rect.left = rect.right - icon_cx; - rect.top = (tray_height - icon_cy) / 2; - rect.bottom = rect.top + icon_cy; - return rect; -} - static void init_common_controls(void) { static BOOL initialized = FALSE; @@ -202,10 +191,10 @@ static void create_tooltip(struct icon *icon) static void set_balloon_position( struct icon *icon ) { - RECT rect = get_icon_rect( icon ); + RECT rect; POINT pos; - MapWindowPoints( tray_window, 0, (POINT *)&rect, 2 ); + GetWindowRect( icon->window, &rect ); pos.x = (rect.left + rect.right) / 2; pos.y = (rect.top + rect.bottom) / 2; SendMessageW( balloon_window, TTM_TRACKPOSITION, 0, MAKELONG( pos.x, pos.y )); @@ -308,8 +297,12 @@ static void update_tooltip_text(struct icon *icon) /* get the position of an icon in the stand-alone tray */ static POINT get_icon_pos( struct icon *icon ) { - RECT rect = get_icon_rect( icon ); - return *(POINT *)▭ + POINT pos; + + pos.x = tray_width - icon_cx * (icon->display + 1); + pos.y = (tray_height - icon_cy) / 2; + + return pos; } /* synchronize tooltip position with tooltip window */
1
0
0
0
Rémi Bernon : explorer: Use the icon windows for their tooltips.
by Alexandre Julliard
28 Nov '23
28 Nov '23
Module: wine Branch: master Commit: a60050abc85778bd86ea968a20a691890bf71618 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a60050abc85778bd86ea968a20a691…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Jun 22 20:53:09 2023 +0200 explorer: Use the icon windows for their tooltips. --- programs/explorer/systray.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index 60b407afa6c..e35962486b3 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -187,17 +187,16 @@ static void create_tooltip(struct icon *icon) TTTOOLINFOW ti; init_common_controls(); - icon->tooltip = CreateWindowExW(WS_EX_TOPMOST, TOOLTIPS_CLASSW, NULL, - WS_POPUP | TTS_ALWAYSTIP, - CW_USEDEFAULT, CW_USEDEFAULT, - CW_USEDEFAULT, CW_USEDEFAULT, - tray_window, NULL, NULL, NULL); + icon->tooltip = CreateWindowExW( WS_EX_TOPMOST, TOOLTIPS_CLASSW, NULL, WS_POPUP | TTS_ALWAYSTIP, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + icon->window, NULL, NULL, NULL ); ZeroMemory(&ti, sizeof(ti)); ti.cbSize = sizeof(TTTOOLINFOW); - ti.hwnd = tray_window; + ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND; + ti.hwnd = icon->window; + ti.uId = (UINT_PTR)icon->window; ti.lpszText = icon->tiptext; - if (icon->display != -1) ti.rect = get_icon_rect( icon ); SendMessageW(icon->tooltip, TTM_ADDTOOLW, 0, (LPARAM)&ti); } @@ -298,7 +297,9 @@ static void update_tooltip_text(struct icon *icon) ZeroMemory(&ti, sizeof(ti)); ti.cbSize = sizeof(TTTOOLINFOW); - ti.hwnd = tray_window; + ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND; + ti.hwnd = icon->window; + ti.uId = (UINT_PTR)icon->window; ti.lpszText = icon->tiptext; SendMessageW(icon->tooltip, TTM_UPDATETIPTEXTW, 0, (LPARAM)&ti); @@ -318,8 +319,10 @@ static void update_tooltip_position( struct icon *icon ) ZeroMemory(&ti, sizeof(ti)); ti.cbSize = sizeof(TTTOOLINFOW); - ti.hwnd = tray_window; - if (icon->display != -1) ti.rect = get_icon_rect( icon ); + ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND; + ti.hwnd = icon->window; + ti.uId = (UINT_PTR)icon->window; + ti.lpszText = icon->tiptext; SendMessageW( icon->tooltip, TTM_NEWTOOLRECTW, 0, (LPARAM)&ti ); if (balloon_icon == icon) set_balloon_position( icon ); }
1
0
0
0
Rémi Bernon : explorer: Display the individual systray icon windows.
by Alexandre Julliard
28 Nov '23
28 Nov '23
Module: wine Branch: master Commit: 76d144477c487747ebd7aa12fdd4df253814a664 URL:
https://gitlab.winehq.org/wine/wine/-/commit/76d144477c487747ebd7aa12fdd4df…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Jun 22 18:56:16 2023 +0200 explorer: Display the individual systray icon windows. --- programs/explorer/systray.c | 180 +++++++++++++++++--------------------------- 1 file changed, 71 insertions(+), 109 deletions(-) diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index a36aa101525..60b407afa6c 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -119,6 +119,10 @@ static HWND balloon_window; static LRESULT WINAPI shell_traywnd_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ); static LRESULT WINAPI tray_icon_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ); +static BOOL show_icon( struct icon *icon ); +static BOOL hide_icon( struct icon *icon ); +static BOOL delete_icon( struct icon *icon ); + static WNDCLASSEXW shell_traywnd_class = { .cbSize = sizeof(WNDCLASSEXW), @@ -320,6 +324,30 @@ static void update_tooltip_position( struct icon *icon ) if (balloon_icon == icon) set_balloon_position( icon ); } +static BOOL notify_owner( struct icon *icon, UINT msg, LPARAM lparam ) +{ + WPARAM wp = icon->id; + LPARAM lp = msg; + + if (icon->version >= NOTIFYICON_VERSION_4) + { + POINT pt = {.x = (short)LOWORD(lparam), .y = (short)HIWORD(lparam)}; + ClientToScreen( icon->window, &pt ); + wp = MAKEWPARAM( pt.x, pt.y ); + lp = MAKELPARAM( msg, icon->id ); + } + + TRACE( "relaying 0x%x\n", msg ); + if (!SendNotifyMessageW( icon->owner, icon->callback_message, wp, lp ) && + (GetLastError() == ERROR_INVALID_WINDOW_HANDLE)) + { + WARN( "application window was destroyed, removing icon %u\n", icon->id ); + delete_icon( icon ); + return FALSE; + } + return TRUE; +} + /* window procedure for the individual tray icon window */ static LRESULT WINAPI tray_icon_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { @@ -342,45 +370,60 @@ static LRESULT WINAPI tray_icon_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPA icon->window = hwnd; create_tooltip( icon ); break; - } - return DefWindowProcW( hwnd, msg, wparam, lparam ); -} - -/* find the icon located at a certain point in the tray window */ -static struct icon *icon_from_point( int x, int y ) -{ - struct icon *icon; - POINT pt = {x, y}; - - LIST_FOR_EACH_ENTRY(icon, &icon_list, struct icon, entry) + case WM_PAINT: { - RECT rect = get_icon_rect( icon ); - if (PtInRect(&rect, pt)) return icon; + PAINTSTRUCT ps; + RECT rc; + HDC hdc; + int cx = GetSystemMetrics( SM_CXSMICON ); + int cy = GetSystemMetrics( SM_CYSMICON ); + + hdc = BeginPaint( hwnd, &ps ); + GetClientRect( hwnd, &rc ); + TRACE( "painting rect %s\n", wine_dbgstr_rect( &rc ) ); + DrawIconEx( hdc, (rc.left + rc.right - cx) / 2, (rc.top + rc.bottom - cy) / 2, + icon->image, cx, cy, 0, 0, DI_DEFAULTSIZE | DI_NORMAL ); + EndPaint( hwnd, &ps ); + return 0; } - return NULL; -} - -/* invalidate the portion of the tray window that contains the specified icons */ -static void invalidate_icons( unsigned int start, unsigned int end ) -{ - RECT rect; + case WM_MOUSEMOVE: + case WM_LBUTTONDOWN: + case WM_LBUTTONUP: + case WM_RBUTTONDOWN: + case WM_RBUTTONUP: + case WM_MBUTTONDOWN: + case WM_MBUTTONUP: + case WM_LBUTTONDBLCLK: + case WM_RBUTTONDBLCLK: + case WM_MBUTTONDBLCLK: + { + MSG message = {.hwnd = hwnd, .message = msg, .wParam = wparam, .lParam = lparam}; + SendMessageW( icon->tooltip, TTM_RELAYEVENT, 0, (LPARAM)&message ); + if (!notify_owner( icon, msg, lparam )) break; + if (icon->version > 0) + { + if (msg == WM_LBUTTONUP) notify_owner( icon, NIN_SELECT, lparam ); + if (msg == WM_RBUTTONUP) notify_owner( icon, WM_CONTEXTMENU, lparam ); + } + break; + } + } - rect.left = tray_width - (end + 1) * icon_cx; - rect.top = (tray_height - icon_cy) / 2; - rect.right = tray_width - start * icon_cx; - rect.bottom = rect.top + icon_cy; - InvalidateRect( tray_window, &rect, TRUE ); + return DefWindowProcW( hwnd, msg, wparam, lparam ); } /* add an icon to the system tray window */ static void systray_add_icon( struct icon *icon ) { + POINT pos; + if (icon->display != -1) return; /* already added */ icon->display = nb_displayed++; - invalidate_icons( icon->display, icon->display ); + pos = get_icon_pos( icon ); + SetWindowPos( icon->window, 0, pos.x, pos.y, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_SHOWWINDOW ); if (nb_displayed == 1 && !hide_systray) do_show_systray(); TRACE( "added %u now %d icons\n", icon->id, nb_displayed ); @@ -408,7 +451,6 @@ static void systray_remove_icon( struct icon *icon ) if (!--nb_displayed && !enable_shell) do_hide_systray(); TRACE( "removed %u now %d icons\n", icon->id, nb_displayed ); - invalidate_icons( icon->display, nb_displayed ); icon->display = -1; } @@ -433,6 +475,7 @@ static BOOL hide_icon(struct icon *icon) if (icon->display == -1) return TRUE; /* already hidden */ + ShowWindow( icon->window, SW_HIDE ); systray_remove_icon( icon ); update_balloon( icon ); @@ -461,7 +504,7 @@ static BOOL modify_icon( struct icon *icon, NOTIFYICONDATAW *nid ) { if (icon->image) DestroyIcon(icon->image); icon->image = CopyIcon(nid->hIcon); - if (icon->display != -1) invalidate_icons( icon->display, icon->display ); + if (icon->display != -1) InvalidateRect( icon->window, NULL, TRUE ); } if (nid->uFlags & NIF_MESSAGE) @@ -787,29 +830,6 @@ static void do_hide_systray(void) ShowWindow( tray_window, SW_HIDE ); } -static BOOL notify_owner( struct icon *icon, UINT msg, POINT pt ) -{ - WPARAM wp = icon->id; - LPARAM lp = msg; - - if (icon->version >= NOTIFYICON_VERSION_4) - { - ClientToScreen( tray_window, &pt ); - wp = MAKEWPARAM( pt.x, pt.y ); - lp = MAKELPARAM( msg, icon->id ); - } - - TRACE( "relaying 0x%x\n", msg ); - if (!SendNotifyMessageW( icon->owner, icon->callback_message, wp, lp ) && - (GetLastError() == ERROR_INVALID_WINDOW_HANDLE)) - { - WARN( "application window was destroyed, removing icon %u\n", icon->id ); - delete_icon( icon ); - return FALSE; - } - return TRUE; -} - static void do_show_systray(void) { SIZE size; @@ -859,64 +879,6 @@ static LRESULT WINAPI shell_traywnd_proc( HWND hwnd, UINT msg, WPARAM wparam, LP } break; - case WM_PAINT: - { - struct icon *icon; - PAINTSTRUCT ps; - HDC hdc; - - hdc = BeginPaint( hwnd, &ps ); - LIST_FOR_EACH_ENTRY( icon, &icon_list, struct icon, entry ) - { - RECT dummy, rect = get_icon_rect( icon ); - if (icon->display != -1 && IntersectRect( &dummy, &rect, &ps.rcPaint )) - DrawIconEx( hdc, rect.left + ICON_BORDER, rect.top + ICON_BORDER, icon->image, - icon_cx - 2*ICON_BORDER, icon_cy - 2*ICON_BORDER, - 0, 0, DI_DEFAULTSIZE|DI_NORMAL); - } - EndPaint( hwnd, &ps ); - break; - } - - case WM_MOUSEMOVE: - case WM_LBUTTONDOWN: - case WM_LBUTTONUP: - case WM_RBUTTONDOWN: - case WM_RBUTTONUP: - case WM_MBUTTONDOWN: - case WM_MBUTTONUP: - case WM_LBUTTONDBLCLK: - case WM_RBUTTONDBLCLK: - case WM_MBUTTONDBLCLK: - { - MSG message; - POINT pt = { (short)LOWORD(lparam), (short)HIWORD(lparam) }; - struct icon *icon = icon_from_point( pt.x, pt.y ); - if (!icon) break; - - message.hwnd = hwnd; - message.message = msg; - message.wParam = wparam; - message.lParam = lparam; - SendMessageW( icon->tooltip, TTM_RELAYEVENT, 0, (LPARAM)&message ); - - if (!notify_owner( icon, msg, pt )) break; - - if (icon->version > 0) - { - switch (msg) - { - case WM_RBUTTONUP: - notify_owner( icon, WM_CONTEXTMENU, pt ); - break; - case WM_LBUTTONUP: - notify_owner( icon, NIN_SELECT, pt ); - break; - } - } - break; - } - case WM_CLOSE: /* don't destroy the tray window, just hide it */ ShowWindow( hwnd, SW_HIDE );
1
0
0
0
Rémi Bernon : explorer: Create individual windows for the systray icons.
by Alexandre Julliard
28 Nov '23
28 Nov '23
Module: wine Branch: master Commit: d2ee32bfe60d401111f47f2d24958963aebc11f2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d2ee32bfe60d401111f47f2d249589…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Jun 27 09:45:28 2023 +0200 explorer: Create individual windows for the systray icons. --- programs/explorer/systray.c | 99 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 80 insertions(+), 19 deletions(-) diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index 8a1b6a8ea3c..a36aa101525 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -64,6 +64,7 @@ struct icon struct list entry; HICON image; /* the image to render */ HWND owner; /* the HWND passed in to the Shell_NotifyIcon call */ + HWND window; /* the adaptor window */ HWND tooltip; /* Icon tooltip */ UINT state; /* state flags */ UINT id; /* the unique id given by the app */ @@ -115,6 +116,25 @@ static HWND balloon_window; #define WM_POPUPSYSTEMMENU 0x0313 +static LRESULT WINAPI shell_traywnd_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ); +static LRESULT WINAPI tray_icon_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ); + +static WNDCLASSEXW shell_traywnd_class = +{ + .cbSize = sizeof(WNDCLASSEXW), + .style = CS_DBLCLKS | CS_HREDRAW, + .lpfnWndProc = shell_traywnd_proc, + .hbrBackground = (HBRUSH)COLOR_WINDOW, + .lpszClassName = L"Shell_TrayWnd", +}; +static WNDCLASSEXW tray_icon_class = +{ + .cbSize = sizeof(WNDCLASSEXW), + .style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS, + .lpfnWndProc = tray_icon_wndproc, + .lpszClassName = L"__wine_tray_icon", +}; + static void do_hide_systray(void); static void do_show_systray(void); @@ -280,6 +300,13 @@ static void update_tooltip_text(struct icon *icon) SendMessageW(icon->tooltip, TTM_UPDATETIPTEXTW, 0, (LPARAM)&ti); } +/* get the position of an icon in the stand-alone tray */ +static POINT get_icon_pos( struct icon *icon ) +{ + RECT rect = get_icon_rect( icon ); + return *(POINT *)▭ +} + /* synchronize tooltip position with tooltip window */ static void update_tooltip_position( struct icon *icon ) { @@ -293,6 +320,33 @@ static void update_tooltip_position( struct icon *icon ) if (balloon_icon == icon) set_balloon_position( icon ); } +/* window procedure for the individual tray icon window */ +static LRESULT WINAPI tray_icon_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) +{ + struct icon *icon = (struct icon *)GetWindowLongPtrW( hwnd, GWLP_USERDATA ); + + TRACE( "hwnd %p, msg %#x, wparam %#Ix, lparam %#Ix\n", hwnd, msg, wparam, lparam ); + + switch (msg) + { + case WM_NCCREATE: + { + /* set the icon data for the window from the data passed into CreateWindow */ + const CREATESTRUCTW *info = (const CREATESTRUCTW *)lparam; + icon = info->lpCreateParams; + SetWindowLongPtrW( hwnd, GWLP_USERDATA, (LONG_PTR)icon ); + break; + } + + case WM_CREATE: + icon->window = hwnd; + create_tooltip( icon ); + break; + } + + return DefWindowProcW( hwnd, msg, wparam, lparam ); +} + /* find the icon located at a certain point in the tray window */ static struct icon *icon_from_point( int x, int y ) { @@ -336,6 +390,7 @@ static void systray_add_icon( struct icon *icon ) static void systray_remove_icon( struct icon *icon ) { struct icon *ptr; + POINT pos; if (icon->display == -1) return; /* already removed */ @@ -346,6 +401,8 @@ static void systray_remove_icon( struct icon *icon ) if (ptr->display < icon->display) continue; ptr->display--; update_tooltip_position( ptr ); + pos = get_icon_pos( ptr ); + SetWindowPos( ptr->window, 0, pos.x, pos.y, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER ); } if (!--nb_displayed && !enable_shell) do_hide_systray(); @@ -365,7 +422,6 @@ static BOOL show_icon(struct icon *icon) systray_add_icon( icon ); update_tooltip_position( icon ); - create_tooltip( icon ); update_balloon( icon ); return TRUE; } @@ -455,17 +511,23 @@ static BOOL add_icon(NOTIFYICONDATAW *nid) icon->owner = nid->hWnd; icon->display = -1; + CreateWindowW( tray_icon_class.lpszClassName, NULL, WS_CHILD, + 0, 0, icon_cx, icon_cy, tray_window, NULL, NULL, icon ); + if (!icon->window) ERR( "Failed to create systray icon window\n" ); + list_add_tail(&icon_list, &icon->entry); return modify_icon( icon, nid ); } /* Deletes tray icon window and icon record */ -static BOOL delete_icon(struct icon *icon) +static BOOL delete_icon( struct icon *icon ) { - hide_icon(icon); - list_remove(&icon->entry); - DestroyIcon(icon->image); + hide_icon( icon ); + list_remove( &icon->entry ); + DestroyWindow( icon->tooltip ); + DestroyWindow( icon->window ); + DestroyIcon( icon->image ); free( icon ); return TRUE; } @@ -777,7 +839,7 @@ static void do_show_systray(void) sync_taskbar_buttons(); } -static LRESULT WINAPI tray_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +static LRESULT WINAPI shell_traywnd_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { switch (msg) { @@ -904,38 +966,37 @@ void handle_parent_notify( HWND hwnd, WPARAM wp ) /* this function creates the listener window */ void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enable_shell ) { - WNDCLASSEXW class; RECT work_rect, primary_rect, taskbar_rect; if (using_root && graphics_driver) wine_notify_icon = (void *)GetProcAddress( graphics_driver, "wine_notify_icon" ); + shell_traywnd_class.hIcon = LoadIconW( 0, (const WCHAR *)IDI_WINLOGO ); + shell_traywnd_class.hCursor = LoadCursorW( 0, (const WCHAR *)IDC_ARROW ); + tray_icon_class.hIcon = shell_traywnd_class.hIcon; + tray_icon_class.hCursor = shell_traywnd_class.hCursor; + icon_cx = GetSystemMetrics( SM_CXSMICON ) + 2*ICON_BORDER; icon_cy = GetSystemMetrics( SM_CYSMICON ) + 2*ICON_BORDER; hide_systray = using_root; enable_shell = arg_enable_shell; /* register the systray listener window class */ - ZeroMemory(&class, sizeof(class)); - class.cbSize = sizeof(class); - class.style = CS_DBLCLKS | CS_HREDRAW; - class.lpfnWndProc = tray_wndproc; - class.hInstance = NULL; - class.hIcon = LoadIconW(0, (LPCWSTR)IDI_WINLOGO); - class.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW); - class.hbrBackground = (HBRUSH) COLOR_WINDOW; - class.lpszClassName = L"Shell_TrayWnd"; - - if (!RegisterClassExW(&class)) + if (!RegisterClassExW( &shell_traywnd_class )) { ERR( "Could not register SysTray window class\n" ); return; } + if (!wine_notify_icon && !RegisterClassExW( &tray_icon_class )) + { + ERR( "Could not register Wine SysTray window classes\n" ); + return; + } SystemParametersInfoW( SPI_GETWORKAREA, 0, &work_rect, 0 ); SetRect( &primary_rect, 0, 0, GetSystemMetrics( SM_CXSCREEN ), GetSystemMetrics( SM_CYSCREEN ) ); SubtractRect( &taskbar_rect, &primary_rect, &work_rect ); - tray_window = CreateWindowExW( WS_EX_NOACTIVATE, class.lpszClassName, NULL, WS_POPUP, taskbar_rect.left, + tray_window = CreateWindowExW( WS_EX_NOACTIVATE, shell_traywnd_class.lpszClassName, NULL, WS_POPUP, taskbar_rect.left, taskbar_rect.top, taskbar_rect.right - taskbar_rect.left, taskbar_rect.bottom - taskbar_rect.top, 0, 0, 0, 0 ); if (!tray_window)
1
0
0
0
Rémi Bernon : explorer: Split systray add/remove from show/hide_icon.
by Alexandre Julliard
28 Nov '23
28 Nov '23
Module: wine Branch: master Commit: 243433623a087ce79938530d09564cf9b971d2cf URL:
https://gitlab.winehq.org/wine/wine/-/commit/243433623a087ce79938530d09564c…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Jun 22 21:06:18 2023 +0200 explorer: Split systray add/remove from show/hide_icon. --- programs/explorer/systray.c | 54 ++++++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index cf1457eca43..8a1b6a8ea3c 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -320,32 +320,24 @@ static void invalidate_icons( unsigned int start, unsigned int end ) InvalidateRect( tray_window, &rect, TRUE ); } -/* make an icon visible */ -static BOOL show_icon(struct icon *icon) +/* add an icon to the system tray window */ +static void systray_add_icon( struct icon *icon ) { - TRACE( "id=0x%x, hwnd=%p\n", icon->id, icon->owner ); - - if (icon->display != -1) return TRUE; /* already displayed */ + if (icon->display != -1) return; /* already added */ icon->display = nb_displayed++; - update_tooltip_position( icon ); - invalidate_icons( nb_displayed-1, nb_displayed-1 ); + invalidate_icons( icon->display, icon->display ); if (nb_displayed == 1 && !hide_systray) do_show_systray(); - - create_tooltip(icon); - update_balloon( icon ); - return TRUE; + TRACE( "added %u now %d icons\n", icon->id, nb_displayed ); } -/* make an icon invisible */ -static BOOL hide_icon(struct icon *icon) +/* remove an icon from the stand-alone tray */ +static void systray_remove_icon( struct icon *icon ) { struct icon *ptr; - TRACE( "id=0x%x, hwnd=%p\n", icon->id, icon->owner ); - - if (icon->display == -1) return TRUE; /* already hidden */ + if (icon->display == -1) return; /* already removed */ assert( nb_displayed ); LIST_FOR_EACH_ENTRY( ptr, &icon_list, struct icon, entry ) @@ -355,11 +347,37 @@ static BOOL hide_icon(struct icon *icon) ptr->display--; update_tooltip_position( ptr ); } - nb_displayed--; + + if (!--nb_displayed && !enable_shell) do_hide_systray(); + TRACE( "removed %u now %d icons\n", icon->id, nb_displayed ); + invalidate_icons( icon->display, nb_displayed ); icon->display = -1; +} + +/* make an icon visible */ +static BOOL show_icon(struct icon *icon) +{ + TRACE( "id=0x%x, hwnd=%p\n", icon->id, icon->owner ); + + if (icon->display != -1) return TRUE; /* already displayed */ + + systray_add_icon( icon ); + + update_tooltip_position( icon ); + create_tooltip( icon ); + update_balloon( icon ); + return TRUE; +} + +/* make an icon invisible */ +static BOOL hide_icon(struct icon *icon) +{ + TRACE( "id=0x%x, hwnd=%p\n", icon->id, icon->owner ); + + if (icon->display == -1) return TRUE; /* already hidden */ - if (!nb_displayed && !enable_shell) do_hide_systray(); + systray_remove_icon( icon ); update_balloon( icon ); update_tooltip_position( icon );
1
0
0
0
Rémi Bernon : explorer: Remove unnecessary displayed icon array.
by Alexandre Julliard
28 Nov '23
28 Nov '23
Module: wine Branch: master Commit: 2e82d57d75e42b33db1b0cfff3ee3126e455c36a URL:
https://gitlab.winehq.org/wine/wine/-/commit/2e82d57d75e42b33db1b0cfff3ee31…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Jun 22 14:39:07 2023 +0200 explorer: Remove unnecessary displayed icon array. --- programs/explorer/systray.c | 49 ++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index 6253b65cf35..cf1457eca43 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -93,9 +93,7 @@ static struct list taskbar_buttons = LIST_INIT( taskbar_buttons ); static HWND tray_window; -static unsigned int alloc_displayed; static unsigned int nb_displayed; -static struct icon **displayed; /* array of currently displayed icons */ static BOOL hide_systray, enable_shell; static int icon_cx, icon_cy, tray_width, tray_height; @@ -298,10 +296,16 @@ static void update_tooltip_position( struct icon *icon ) /* find the icon located at a certain point in the tray window */ static struct icon *icon_from_point( int x, int y ) { - if (y < 0 || y >= icon_cy) return NULL; - x = tray_width - x; - if (x < 0 || x >= icon_cx * nb_displayed) return NULL; - return displayed[x / icon_cx]; + struct icon *icon; + POINT pt = {x, y}; + + LIST_FOR_EACH_ENTRY(icon, &icon_list, struct icon, entry) + { + RECT rect = get_icon_rect( icon ); + if (PtInRect(&rect, pt)) return icon; + } + + return NULL; } /* invalidate the portion of the tray window that contains the specified icons */ @@ -323,17 +327,7 @@ static BOOL show_icon(struct icon *icon) if (icon->display != -1) return TRUE; /* already displayed */ - if (nb_displayed >= alloc_displayed) - { - unsigned int new_count = max( alloc_displayed * 2, 32 ); - struct icon **ptr; - if (!(ptr = realloc( displayed, new_count * sizeof(*ptr) ))) return FALSE; - displayed = ptr; - alloc_displayed = new_count; - } - - icon->display = nb_displayed; - displayed[nb_displayed++] = icon; + icon->display = nb_displayed++; update_tooltip_position( icon ); invalidate_icons( nb_displayed-1, nb_displayed-1 ); @@ -347,18 +341,19 @@ static BOOL show_icon(struct icon *icon) /* make an icon invisible */ static BOOL hide_icon(struct icon *icon) { - unsigned int i; + struct icon *ptr; TRACE( "id=0x%x, hwnd=%p\n", icon->id, icon->owner ); if (icon->display == -1) return TRUE; /* already hidden */ assert( nb_displayed ); - for (i = icon->display; i < nb_displayed - 1; i++) + LIST_FOR_EACH_ENTRY( ptr, &icon_list, struct icon, entry ) { - displayed[i] = displayed[i + 1]; - displayed[i]->display = i; - update_tooltip_position( displayed[i] ); + if (ptr == icon) continue; + if (ptr->display < icon->display) continue; + ptr->display--; + update_tooltip_position( ptr ); } nb_displayed--; invalidate_icons( icon->display, nb_displayed ); @@ -786,16 +781,16 @@ static LRESULT WINAPI tray_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM l case WM_PAINT: { - unsigned int i; + struct icon *icon; PAINTSTRUCT ps; HDC hdc; hdc = BeginPaint( hwnd, &ps ); - for (i = 0; i < nb_displayed; i++) + LIST_FOR_EACH_ENTRY( icon, &icon_list, struct icon, entry ) { - RECT dummy, rect = get_icon_rect( displayed[i] ); - if (IntersectRect( &dummy, &rect, &ps.rcPaint )) - DrawIconEx( hdc, rect.left + ICON_BORDER, rect.top + ICON_BORDER, displayed[i]->image, + RECT dummy, rect = get_icon_rect( icon ); + if (icon->display != -1 && IntersectRect( &dummy, &rect, &ps.rcPaint )) + DrawIconEx( hdc, rect.left + ICON_BORDER, rect.top + ICON_BORDER, icon->image, icon_cx - 2*ICON_BORDER, icon_cy - 2*ICON_BORDER, 0, 0, DI_DEFAULTSIZE|DI_NORMAL); }
1
0
0
0
Biswapriyo Nath : include: Add ID3D12InfoQueue1 definition in vkd3d_d3d12sdklayers.idl.
by Alexandre Julliard
28 Nov '23
28 Nov '23
Module: vkd3d Branch: master Commit: c64909988f2814203d9dfe22325d8c6d76383c00 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/c64909988f2814203d9dfe22325d8…
Author: Biswapriyo Nath <nathbappai(a)gmail.com> Date: Sat Nov 25 09:30:40 2023 +0000 include: Add ID3D12InfoQueue1 definition in vkd3d_d3d12sdklayers.idl. --- include/vkd3d_d3d12sdklayers.idl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/include/vkd3d_d3d12sdklayers.idl b/include/vkd3d_d3d12sdklayers.idl index c1036572..3c7255a4 100644 --- a/include/vkd3d_d3d12sdklayers.idl +++ b/include/vkd3d_d3d12sdklayers.idl @@ -942,6 +942,13 @@ typedef enum D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS } D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS; cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS)") +typedef enum D3D12_MESSAGE_CALLBACK_FLAGS +{ + D3D12_MESSAGE_CALLBACK_FLAG_NONE = 0x00, + D3D12_MESSAGE_CALLBACK_IGNORE_FILTERS = 0x01, +} D3D12_MESSAGE_CALLBACK_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_MESSAGE_CALLBACK_FLAGS)") + typedef struct D3D12_DEBUG_DEVICE_GPU_BASED_VALIDATION_SETTINGS { UINT MaxMessagesPerCommandList; @@ -1146,3 +1153,19 @@ interface ID3D12InfoQueue : IUnknown void SetMuteDebugOutput([in] BOOL mute); BOOL GetMuteDebugOutput(); } + +typedef void (__stdcall *D3D12MessageFunc)(D3D12_MESSAGE_CATEGORY category, + D3D12_MESSAGE_SEVERITY severity, D3D12_MESSAGE_ID id, const char *description, void *context); + +[ + uuid(2852dd88-b484-4c0c-b6b1-67168500e600), + object, + local, + pointer_default(unique) +] +interface ID3D12InfoQueue1 : ID3D12InfoQueue +{ + HRESULT RegisterMessageCallback([in] D3D12MessageFunc func, + [in] D3D12_MESSAGE_CALLBACK_FLAGS flags, [in] void *context, [in, out] DWORD *cookie); + HRESULT UnregisterMessageCallback([in] DWORD cookie); +}
1
0
0
0
Eric Pouech : dmime: Add Release() on some codepaths.
by Alexandre Julliard
27 Nov '23
27 Nov '23
Module: wine Branch: master Commit: 6343dc6c9571fce20cd00102c5b0bd5c96861cfd URL:
https://gitlab.winehq.org/wine/wine/-/commit/6343dc6c9571fce20cd00102c5b0bd…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Mon Nov 27 18:05:02 2023 +0100 dmime: Add Release() on some codepaths. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- dlls/dmime/segment.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/dmime/segment.c b/dlls/dmime/segment.c index e806a845d37..4708b4c5a6f 100644 --- a/dlls/dmime/segment.c +++ b/dlls/dmime/segment.c @@ -373,7 +373,10 @@ static HRESULT WINAPI segment_GetParam(IDirectMusicSegment8 *iface, REFGUID type for (i = 0, count = 0; i < DMUS_SEG_ANYTRACK && count <= index; i++) { if (FAILED(segment_GetTrack(iface, &GUID_NULL, group, i, &track))) break; if (FAILED(IDirectMusicTrack_IsParamSupported(track, type))) + { + IDirectMusicTrack_Release(track); continue; + } if (index == count || index == DMUS_SEG_ANYTRACK) hr = IDirectMusicTrack_GetParam(track, type, time, next, param); IDirectMusicTrack_Release(track);
1
0
0
0
Torge Matthies : wineandroid.drv: Set PFD_SUPPORT_COMPOSITION for hardware-accelerated pixel formats.
by Alexandre Julliard
27 Nov '23
27 Nov '23
Module: wine Branch: master Commit: b138be092e7130f3b079511eaebf053b97c32462 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b138be092e7130f3b079511eaebf05…
Author: Torge Matthies <tmatthies(a)codeweavers.com> Date: Sat Nov 25 15:13:31 2023 +0100 wineandroid.drv: Set PFD_SUPPORT_COMPOSITION for hardware-accelerated pixel formats. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53500
--- dlls/wineandroid.drv/opengl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wineandroid.drv/opengl.c b/dlls/wineandroid.drv/opengl.c index 5146fdf4df9..99d2e3cebe1 100644 --- a/dlls/wineandroid.drv/opengl.c +++ b/dlls/wineandroid.drv/opengl.c @@ -466,7 +466,7 @@ static int android_wglDescribePixelFormat( HDC hdc, int fmt, UINT size, PIXELFOR memset( pfd, 0, sizeof(*pfd) ); pfd->nSize = sizeof(*pfd); pfd->nVersion = 1; - pfd->dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER; + pfd->dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER | PFD_SUPPORT_COMPOSITION; pfd->iPixelType = PFD_TYPE_RGBA; pfd->iLayerType = PFD_MAIN_PLANE;
1
0
0
0
Torge Matthies : winemac.drv: Set PFD_SUPPORT_COMPOSITION for hardware-accelerated pixel formats.
by Alexandre Julliard
27 Nov '23
27 Nov '23
Module: wine Branch: master Commit: 7eb0c463faf683968da840a2e6d627d3f018f7aa URL:
https://gitlab.winehq.org/wine/wine/-/commit/7eb0c463faf683968da840a2e6d627…
Author: Torge Matthies <tmatthies(a)codeweavers.com> Date: Sat Nov 25 15:13:31 2023 +0100 winemac.drv: Set PFD_SUPPORT_COMPOSITION for hardware-accelerated pixel formats. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53500
--- dlls/winemac.drv/opengl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c index 55e5704724b..f78454ed149 100644 --- a/dlls/winemac.drv/opengl.c +++ b/dlls/winemac.drv/opengl.c @@ -4326,6 +4326,7 @@ static int macdrv_wglDescribePixelFormat(HDC hdc, int fmt, UINT size, PIXELFORMA descr->dwFlags = PFD_SUPPORT_OPENGL; if (pf->window) descr->dwFlags |= PFD_DRAW_TO_WINDOW; if (!pf->accelerated) descr->dwFlags |= PFD_GENERIC_FORMAT; + else descr->dwFlags |= PFD_SUPPORT_COMPOSITION; if (pf->double_buffer) descr->dwFlags |= PFD_DOUBLEBUFFER; if (pf->stereo) descr->dwFlags |= PFD_STEREO; if (pf->backing_store) descr->dwFlags |= PFD_SWAP_COPY;
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
99
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Results per page:
10
25
50
100
200