Sync with X server before simulating mouse clicks
Adding a call to XSync() to wxUIActionSimulatorX11Impl seems to fix the problems with the focus snapping back to the control having it previously after simulating a mouse click and changing the focus afterwards using wxWindow::SetFocus(), as the uiaction sample did. Admittedly, it's not really clear why does doing it help, but at the very leasy this XSync() call shouldn't do any harm.
This commit is contained in:
@@ -106,6 +106,10 @@ bool wxUIActionSimulatorX11Impl::SendButtonEvent(int button, bool isDown)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ensure that the event is received by the correct window by processing
|
||||
// all pending events, notably mouse moves.
|
||||
XSync(m_display, False /* don't discard */);
|
||||
|
||||
return DoX11Button(xbutton, isDown);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user