From b0a065afd645cefa1d5129f3bd051be0252159b5 Mon Sep 17 00:00:00 2001 From: Garux Date: Sun, 31 Mar 2024 11:33:58 +0500 Subject: [PATCH] make a99892751b869186743fc4d2734db67e9dd70b41 work in Linux #184 --- radiant/surfacedialog.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index db044e20..9e7356c6 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -617,7 +617,12 @@ protected: } } // clear focus widget while showing to keep global shortcuts working +#ifdef WIN32 else if( event->type() == QEvent::Show ) { +#else + else if( event->type() == QEvent::WindowActivate ) { // fixme hack hack: events order varies in OSes, QEvent::Show doesn't work in Linux + // QEvent::WindowActivate seems preferable for usability, but allows QLineEdit content selection w/o focusing it in WIN32 +#endif QTimer::singleShot( 0, [obj](){ if( static_cast( obj )->focusWidget() != nullptr ) static_cast( obj )->focusWidget()->clearFocus();