Merged revisions 48692 #328668b5b6,48693 #890bf2475b from /trunk

------------------------------------------------------------------------
r48692 | zeljko | 2015-04-10 10:21:07 +0200 (Pet, 10 Tra 2015) | 2 lines

Qt: fixed popupParent behaviour when mode is pmExplicit. issue #25589

------------------------------------------------------------------------
r48693 | zeljko | 2015-04-10 10:21:38 +0200 (Pet, 10 Tra 2015) | 2 lines

Gtk2: fixed popupparent when mode is pmExplicit. issue #25589

------------------------------------------------------------------------

git-svn-id: branches/fixes_1_4@48717 -
This commit is contained in:
zeljko 2015-04-11 07:12:26 +00:00
parent b1af73434f
commit 09c8f915db
2 changed files with 30 additions and 4 deletions

View File

@ -775,6 +775,16 @@ begin
gtk_window_set_keep_above(GtkWindow, True);
end;
end;
if AWinControl.HandleObjectShouldBeVisible and
not (csDesigning in AForm.ComponentState) and
not (AForm.FormStyle in fsAllStayOnTop) and
not (fsModal in AForm.FormState) and
(AForm.PopupMode = pmExplicit) and
(AForm.PopupParent = nil) then
begin
SetPopupParent(AForm, AForm.PopupMode, AForm.PopupParent);
end;
{$ENDIF}
Gtk2WidgetSet.SetVisible(AWinControl, AForm.HandleObjectShouldBeVisible);
@ -846,7 +856,11 @@ begin
pmAuto:
PopupParent := Screen.ActiveForm;
pmExplicit:
begin
PopupParent := APopupParent;
if PopupParent = nil then
PopupParent := Application.MainForm;
end;
end;
if PopupParent <> nil then
gtk_window_set_transient_for({%H-}PGtkWindow(ACustomForm.Handle), {%H-}PGtkWindow(PopupParent.Handle))

View File

@ -6696,13 +6696,25 @@ begin
if Screen.ActiveForm <> nil then
NewParent := TQtWidget(Screen.ActiveForm.Handle).Widget;
pmExplicit:
begin
// parent is FPopupParent
if FPopupParent <> nil then
NewParent := FPopupParent;
NewParent := FPopupParent
{$IFDEF HASX11}
else
begin
if not IsMainForm then
begin
NewParent := TQtMainWindow(Application.MainForm.Handle).Widget;
setWindowFlags(windowFlags or QtSheet);
end;
end;
{$ENDIF}
end;
end;
if (NewParent = nil) and not FShowOnTaskBar and not IsMainForm then
NewParent := TQtMainWindow(Application.MainForm.Handle).Widget;
if (NewParent = nil) and (FPopupMode <> pmNone) and
not FShowOnTaskBar and not IsMainForm then
NewParent := TQtMainWindow(Application.MainForm.Handle).Widget;
ChangeParent(NewParent);
end;