From a5bf37a4f3958a3f017f28b527a993e368e80f36 Mon Sep 17 00:00:00 2001 From: zeljko Date: Thu, 28 Aug 2008 13:12:15 +0000 Subject: [PATCH] Qt: fix focus patch, qtwin32 doesn'' like it. git-svn-id: trunk@16283 - --- lcl/interfaces/qt/qtwinapi.inc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/qt/qtwinapi.inc b/lcl/interfaces/qt/qtwinapi.inc index 0bbb256eb3..35251c2907 100644 --- a/lcl/interfaces/qt/qtwinapi.inc +++ b/lcl/interfaces/qt/qtwinapi.inc @@ -4168,8 +4168,17 @@ begin WriteLn('********* TQtWidgetSet.SetFocus INIT focusing ', TQtWidget(hwnd).lclobject.name); {$endif} result := GetFocus; - if Result <> 0 then + + {apply clearFocus only to X11 & Mac, + qt win32 doesn't like this} + {$IFDEF UNIX} + if (Result <> 0) and not + ((TQtWidget(Hwnd) is TQtMainWindow) or + (TQtWidget(Result) is TQtMainWindow)) + then QWidget_clearFocus(TQtWidget(Result).Widget); + {$ENDIF} + TQtWidget(hWnd).setFocus; {$ifdef VerboseFocus} DebugLn('********* TQtWidgetSet.SetFocus END was %x now is %x',[result,hwnd]);