Qt: workaround for MDI children segfault introduced by new focus changing code.

git-svn-id: trunk@14363 -
This commit is contained in:
zeljko 2008-03-02 10:42:45 +00:00
parent 46146e7fb2
commit 35e5c5db54

View File

@ -114,10 +114,12 @@ begin
QObject_hook_hook_events(FAppEvenFilterHook, Method);
// install focus change slot
FAppFocusChangedHook := QApplication_hook_create(App);
QApplication_focusChanged_Event(Method) := @FocusChanged;
QApplication_hook_hook_focusChanged(FAppFocusChangedHook, Method);
ScreenDC := GetDC(0);
try
ScreenInfo.PixelsPerInchX := GetDeviceCaps(ScreenDC, LOGPIXELSX);
@ -310,11 +312,30 @@ var
OldWidget, NewWidget: TQtWidget;
Msg: TLMessage;
begin
OldWidget := GetFirstQtObjectFromWidgetH(old);
NewWidget := GetFirstQtObjectFromWidgetH(now);
if OldWidget = NewWidget then
Exit;
if Assigned(OldWidget) then
begin
if OldWidget.LCLObject is TCustomForm then
begin
if TCustomForm(OldWidget.LCLObject).FormStyle = fsMDIChild then
exit;
end;
end;
if Assigned(NewWidget) then
begin
if NewWidget.LCLObject is TCustomForm then
begin
if TCustomForm(NewWidget.LCLObject).FormStyle = fsMDIChild then
exit;
end;
end;
FillChar(Msg, SizeOf(Msg), 0);
if OldWidget <> nil then