mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 10:40:20 +02:00
Qt: workaround for MDI children segfault introduced by new focus changing code.
git-svn-id: trunk@14363 -
This commit is contained in:
parent
46146e7fb2
commit
35e5c5db54
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user