mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-03 05:58:14 +02:00
LCL, fix message dialogs hidding behind modal dialogs issue #32249
git-svn-id: trunk@55848 -
This commit is contained in:
parent
57e8304b23
commit
d34180dc08
@ -73,6 +73,19 @@ 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
|
||||
|
@ -1276,12 +1276,13 @@ begin
|
||||
gtk_window_set_title(PGtkWindow(Dialog), PGChar(Title));
|
||||
end;
|
||||
|
||||
if (gtk_major_version = 2) and (gtk_minor_version <= 12) then
|
||||
begin
|
||||
ActiveWindow := GetActiveWindow;
|
||||
if ActiveWindow <> 0 then
|
||||
gtk_window_set_transient_for(PGtkWindow(Dialog), {%H-}PGtkWindow(ActiveWindow));
|
||||
end;
|
||||
ActiveWindow := GetActiveWindow;
|
||||
if ActiveWindow <> 0 then
|
||||
gtk_window_set_transient_for(PGtkWindow(Dialog), {%H-}PGtkWindow(ActiveWindow));
|
||||
// the following line keeps the old behaviour making the dialog appear
|
||||
// at screen center instead of at ActiveWindow center
|
||||
gtk_window_set_position(PGtkWindow(Dialog), GTK_WIN_POS_CENTER);
|
||||
|
||||
gtk_dialog_run(PGtkDialog(Dialog));
|
||||
gtk_widget_destroy(Dialog);
|
||||
Result := ADialogResult;
|
||||
|
@ -725,6 +725,8 @@ 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
|
||||
@ -739,7 +741,6 @@ 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
|
||||
|
Loading…
Reference in New Issue
Block a user