Jacek Caban : winex11: Use Unix environment variable in remove_startup_notification.
Alexandre Julliard
julliard at winehq.org
Wed Apr 20 16:49:49 CDT 2022
Module: wine
Branch: master
Commit: c5e7f1b0e5e34bfdb03c63e3ea07e7fdaa1543be
URL: https://source.winehq.org/git/wine.git/?a=commit;h=c5e7f1b0e5e34bfdb03c63e3ea07e7fdaa1543be
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Apr 20 16:00:34 2022 +0200
winex11: Use Unix environment variable in remove_startup_notification.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/winex11.drv/window.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index bed5081d124..48500284b68 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -110,8 +110,8 @@ static pthread_mutex_t win_data_mutex = PTHREAD_MUTEX_INITIALIZER;
static void remove_startup_notification(Display *display, Window window)
{
static LONG startup_notification_removed = 0;
- char id[1024];
char message[1024];
+ const char *id;
int i;
int pos;
XEvent xevent;
@@ -121,9 +121,7 @@ static void remove_startup_notification(Display *display, Window window)
if (InterlockedCompareExchange(&startup_notification_removed, 1, 0) != 0)
return;
- if (GetEnvironmentVariableA("DESKTOP_STARTUP_ID", id, sizeof(id)) == 0)
- return;
- SetEnvironmentVariableA("DESKTOP_STARTUP_ID", NULL);
+ if (!(id = getenv( "DESKTOP_STARTUP_ID" )) || !id[0]) return;
if ((src = strstr( id, "_TIME" ))) update_user_time( atol( src + 5 ));
@@ -137,6 +135,7 @@ static void remove_startup_notification(Display *display, Window window)
}
message[pos++] = '"';
message[pos++] = '\0';
+ unsetenv( "DESKTOP_STARTUP_ID" );
xevent.xclient.type = ClientMessage;
xevent.xclient.message_type = x11drv_atom(_NET_STARTUP_INFO_BEGIN);
More information about the wine-cvs
mailing list