@ -2204,16 +2204,20 @@ bool KApplication::x11EventFilter( XEvent *_event )
void KApplication : : updateUserTimestamp ( unsigned long time )
void KApplication : : updateUserTimestamp ( unsigned long time )
{
{
# if defined Q_WS_X11
# if defined Q_WS_X11
Display * display = qt_xdisplay ( ) ;
if ( ! display ) {
return ;
}
if ( time = = 0 )
if ( time = = 0 )
{ // get current X timestamp
{ // get current X timestamp
Window w = XCreateSimpleWindow ( qt_xdisplay ( ) , qt_xrootwin ( ) , 0 , 0 , 1 , 1 , 0 , 0 , 0 ) ;
Window w = XCreateSimpleWindow ( display, qt_xrootwin ( ) , 0 , 0 , 1 , 1 , 0 , 0 , 0 ) ;
XSelectInput ( qt_xdisplay ( ) , w , PropertyChangeMask ) ;
XSelectInput ( qt_xdisplay ( ) , w , PropertyChangeMask ) ;
unsigned char data [ 1 ] ;
unsigned char data [ 1 ] ;
XChangeProperty ( qt_x display( ) , w , XA_ATOM , XA_ATOM , 8 , PropModeAppend , data , 1 ) ;
XChangeProperty ( display, w , XA_ATOM , XA_ATOM , 8 , PropModeAppend , data , 1 ) ;
XEvent ev ;
XEvent ev ;
XWindowEvent ( qt_x display( ) , w , PropertyChangeMask , & ev ) ;
XWindowEvent ( display, w , PropertyChangeMask , & ev ) ;
time = ev . xproperty . time ;
time = ev . xproperty . time ;
XDestroyWindow ( qt_x display( ) , w ) ;
XDestroyWindow ( display, w ) ;
}
}
if ( GET_QT_X_USER_TIME ( ) = = 0
if ( GET_QT_X_USER_TIME ( ) = = 0
| | NET : : timestampCompare ( time , GET_QT_X_USER_TIME ( ) ) > 0 ) // check time > qt_x_user_time
| | NET : : timestampCompare ( time , GET_QT_X_USER_TIME ( ) ) > 0 ) // check time > qt_x_user_time