gtk2: fix window type hints for modal/nonmodal forms. Issue #13051

git-svn-id: trunk@54197 -
This commit is contained in:
ondrej 2017-02-19 17:37:44 +00:00
parent 11563b2959
commit 6eae03e479
2 changed files with 1 additions and 15 deletions

View File

@ -73,19 +73,6 @@ var
var
Styles : TStrings;
const
//(bsNone, bsSingle, bsSizeable, bsDialog, bsToolWindow, bsSizeToolWin);
GtkWindowTypeHints: array[TFormBorderStyle] of TGdkWindowTypeHint = (
GDK_WINDOW_TYPE_HINT_NOTIFICATION,
GDK_WINDOW_TYPE_HINT_NORMAL,
GDK_WINDOW_TYPE_HINT_NORMAL,
GDK_WINDOW_TYPE_HINT_DIALOG,
GDK_WINDOW_TYPE_HINT_UTILITY,
GDK_WINDOW_TYPE_HINT_UTILITY
);
var
DefaultPangoLayout: PPangoLayout = nil;
const

View File

@ -725,8 +725,6 @@ begin
if AForm.HandleObjectShouldBeVisible and
GTK_IS_WINDOW({%H-}PGtkWindow(AForm.Handle)) then
begin
gtk_window_set_type_hint({%H-}PGtkWindow(AForm.Handle),
GtkWindowTypeHints[AForm.BorderStyle]);
gtk_window_set_keep_above({%H-}PGtkWindow(AForm.Handle),
GBoolean(AForm.FormStyle in fsAllStayOnTop))
end
@ -741,6 +739,7 @@ begin
begin
gtk_window_set_default_size(GtkWindow, Max(1,AForm.Width), Max(1,AForm.Height));
gtk_widget_set_uposition(PGtkWidget(GtkWindow), AForm.Left, AForm.Top);
gtk_window_set_type_hint(GtkWindow, GDK_WINDOW_TYPE_HINT_DIALOG);
GtkWindowShowModal(AForm, GtkWindow);
end else
begin