From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/event.c | 2 +- dlls/winex11.drv/keyboard.c | 2 +- dlls/winex11.drv/mouse.c | 2 +- dlls/winex11.drv/window.c | 33 ++++----------------------------- dlls/winex11.drv/x11drv.h | 2 +- 5 files changed, 8 insertions(+), 33 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 6df35c7f397..70b09f4315e 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -701,7 +701,7 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event )
if (protocol == x11drv_atom(WM_DELETE_WINDOW)) { - update_user_time( event_time ); + update_user_time( event->display, event->window, event_time );
if (hwnd == NtUserGetDesktopWindow()) { diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index 7b7371ed696..f24313852b5 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1340,7 +1340,7 @@ BOOL X11DRV_KeyEvent( HWND hwnd, XEvent *xev ) TRACE_(key)("type %d, window %lx, state 0x%04x, keycode %u\n", event->type, event->window, event->state, event->keycode);
- if (event->type == KeyPress) update_user_time( event->time ); + if (event->type == KeyPress) update_user_time( event->display, event->window, event->time );
/* Clients should pass only KeyPress events to XmbLookupString */ if (xic && event->type == KeyPress) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 5f6b9f34d2a..f1a3a2ab516 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -1547,7 +1547,7 @@ BOOL X11DRV_ButtonPress( HWND hwnd, XEvent *xev ) input.mi.time = EVENT_x11_time_to_win32_time( event->time ); input.mi.dwExtraInfo = 0;
- update_user_time( event->time ); + update_user_time( event->display, event->window, event->time ); map_event_coords( hwnd, event->window, event->root, event->x_root, event->y_root, &input ); send_mouse_input( hwnd, event->window, event->state, &input ); return TRUE; diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 8d80882deea..f87324549aa 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -99,10 +99,6 @@ XContext winContext = 0; static XContext win_data_context = 0; static XContext host_window_context = 0;
-/* time of last user event and window where it's stored */ -static Time last_user_time; -static Window user_time_window; - static const WCHAR whole_window_prop[] = {'_','_','w','i','n','e','_','x','1','1','_','w','h','o','l','e','_','w','i','n','d','o','w',0}; static const WCHAR clip_window_prop[] = @@ -270,7 +266,7 @@ static void remove_startup_notification(Display *display, Window window)
if (!(id = getenv( "DESKTOP_STARTUP_ID" )) || !id[0]) return;
- if ((src = strstr( id, "_TIME" ))) update_user_time( atol( src + 5 )); + if ((src = strstr( id, "_TIME" ))) update_user_time( display, window, atol( src + 5 ) );
pos = snprintf(message, sizeof(message), "remove: ID="); message[pos++] = '"'; @@ -1076,11 +1072,6 @@ static void set_initial_wm_hints( Display *display, Window window )
XChangeProperty( display, window, x11drv_atom(XdndAware), XA_ATOM, 32, PropModeReplace, (unsigned char*)&dndVersion, 1 ); - - update_user_time( 0 ); /* make sure that the user time window exists */ - if (user_time_window) - XChangeProperty( display, window, x11drv_atom(_NET_WM_USER_TIME_WINDOW), - XA_WINDOW, 32, PropModeReplace, (unsigned char *)&user_time_window, 1 ); }
@@ -1149,26 +1140,10 @@ Window init_clip_window(void) /*********************************************************************** * update_user_time */ -void update_user_time( Time time ) +void update_user_time( Display *display, Window window, Time time ) { - if (!user_time_window) - { - Window win = XCreateWindow( gdi_display, root_window, -1, -1, 1, 1, 0, CopyFromParent, - InputOnly, CopyFromParent, 0, NULL ); - if (InterlockedCompareExchangePointer( (void **)&user_time_window, (void *)win, 0 )) - XDestroyWindow( gdi_display, win ); - TRACE( "user time window %lx\n", user_time_window ); - } - - if (!time) return; - XLockDisplay( gdi_display ); - if (!last_user_time || (long)(time - last_user_time) > 0) - { - last_user_time = time; - XChangeProperty( gdi_display, user_time_window, x11drv_atom(_NET_WM_USER_TIME), - XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&time, 1 ); - } - XUnlockDisplay( gdi_display ); + XChangeProperty( display, window, x11drv_atom(_NET_WM_USER_TIME), XA_CARDINAL, + 32, PropModeReplace, (unsigned char *)&time, 1 ); }
/* Update _NET_WM_FULLSCREEN_MONITORS when _NET_WM_STATE_FULLSCREEN is set to support fullscreen diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 5c5607dfccd..2a71d2c8a81 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -675,7 +675,7 @@ extern BOOL get_window_state_updates( HWND hwnd, UINT *state_cmd, UINT *config_c extern void net_supported_init( struct x11drv_thread_data *data );
extern Window init_clip_window(void); -extern void update_user_time( Time time ); +extern void update_user_time( Display *display, Window window, Time time ); extern UINT get_window_net_wm_state( Display *display, Window window ); extern void make_window_embedded( struct x11drv_win_data *data ); extern Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colormap );