Qt: better handling of forms with borderstyle = bsNone. issue #26018, related to issue #28863

git-svn-id: trunk@50139 -
This commit is contained in:
zeljko 2015-10-22 12:55:27 +00:00
parent f771469dfe
commit eb6cd6b9d0

View File

@ -556,21 +556,18 @@ begin
if AWinControl.HandleObjectShouldBeVisible and if AWinControl.HandleObjectShouldBeVisible and
not (TCustomForm(AWinControl).FormStyle in fsAllStayOnTop) and not (TCustomForm(AWinControl).FormStyle in fsAllStayOnTop) and
not (fsModal in TCustomForm(AWinControl).FormState) and not (fsModal in TCustomForm(AWinControl).FormState) and
(TCustomForm(AWinControl).FormStyle <> fsMDIChild) and
(TCustomForm(AWinControl).PopupMode = pmAuto) and (TCustomForm(AWinControl).PopupMode = pmAuto) and
(TCustomForm(AWinControl).BorderStyle = bsNone) and (TCustomForm(AWinControl).BorderStyle = bsNone) and
(TCustomForm(AWinControl).PopupParent = nil) then (TCustomForm(AWinControl).PopupParent = nil) then
begin begin
W := QApplication_activeWindow; W := QApplication_activeWindow;
if (W <> nil) and not QWidget_isModal(W) then
begin
Flags := QWidget_windowFlags(W);
if (Flags and QtWindowStaysOnTopHint <> QtWindowStaysOnTopHint) and
GetAlwaysOnTopX11(W) then
begin
Flags := Widget.windowFlags; Flags := Widget.windowFlags;
Widget.setWindowFlags(Flags or QtWindowStaysOnTopHint); if W <> nil then
end; Widget.setParent(W)
end; else
Widget.setParent(QApplication_desktop);
Widget.setWindowFlags(Flags or QtTool);
end; end;
{$ENDIF} {$ENDIF}
end; end;