Commit 5fcbd27a authored by Fabian Vogt's avatar Fabian Vogt Committed by Alexander Lohnau
Browse files

Use xtest also for sending input to the active window

This is possible with xtest as well and necessary to work with applications
which don't accept synthetic events, like those using XInput2 (GTK3, Firefox)
parent ba10e042
...@@ -173,13 +173,14 @@ bool ShortcutsHandler::send_macro_key( const QKeySequence &key, Window window_P ...@@ -173,13 +173,14 @@ bool ShortcutsHandler::send_macro_key( const QKeySequence &key, Window window_P
unsigned int keysym = key[0]; unsigned int keysym = key[0];
int x_keycode; int x_keycode;
KKeyServer::keyQtToCodeX(keysym, &x_keycode); KKeyServer::keyQtToCodeX(keysym, &x_keycode);
if( x_keycode == NoSymbol ) if( x_keycode == NoSymbol )
return false; return false;
unsigned int x_mod; unsigned int x_mod;
KKeyServer::keyQtToModX(keysym, &x_mod ); KKeyServer::keyQtToModX(keysym, &x_mod );
#ifdef HAVE_XTEST #ifdef HAVE_XTEST
if( xtest() && window_P == None ) if( xtest() && (window_P == None || window_P == InputFocus) )
{ {
QVector<int> keycodes_to_press, keycodes_to_release; QVector<int> keycodes_to_press, keycodes_to_release;
get_modifier_change(x_mod, keycodes_to_press, keycodes_to_release); get_modifier_change(x_mod, keycodes_to_press, keycodes_to_release);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment