mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 23:08:05 +02:00
Gtk2: respect TCustomForm.ShowInTaskbar in case of modal form.Only when value is stAlways modal form will be visible in taskbar.Moved GtkWindowShowModal() to gtk2proc.
git-svn-id: trunk@30236 -
This commit is contained in:
parent
b2602124fe
commit
6b1b1b22d1
@ -808,6 +808,28 @@ begin
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure GtkWindowShowModal(AForm: TCustomForm; GtkWindow: PGtkWindow);
|
||||
begin
|
||||
if (GtkWindow=nil) then exit;
|
||||
UnsetResizeRequest(PgtkWidget(GtkWindow));
|
||||
|
||||
if ModalWindows=nil then ModalWindows:=TFPList.Create;
|
||||
ModalWindows.Add(GtkWindow);
|
||||
{$IFNDEF gtk_no_set_modal}
|
||||
gtk_window_set_modal(GtkWindow, true);
|
||||
{$ENDIF}
|
||||
|
||||
if (AForm <> nil) and (AForm.ShowInTaskBar <> stAlways) and
|
||||
(gtk_window_get_type_hint(GtkWindow) <> GDK_WINDOW_TYPE_HINT_DIALOG) then
|
||||
gtk_window_set_skip_taskbar_hint(GtkWindow, True);
|
||||
gtk_window_present(GtkWindow);
|
||||
{$IFDEF VerboseTransient}
|
||||
DebugLn('TGtkWidgetSet.ShowModal ',Sender.ClassName);
|
||||
{$ENDIF}
|
||||
//TGtk2WidgetSet(WidgetSet).
|
||||
GTK2WidgetSet.UpdateTransientWindows;
|
||||
end;
|
||||
|
||||
{$IFDEF HasX}
|
||||
function FormToX11Window(const AForm: TCustomForm): X.TWindow;
|
||||
var
|
||||
|
@ -358,6 +358,7 @@ procedure GrabKeyBoardToForm(AForm: TCustomForm);
|
||||
procedure ReleaseKeyBoardFromForm(AForm: TCustomForm);
|
||||
procedure GrabMouseToForm(AForm: TCustomForm);
|
||||
procedure ReleaseMouseFromForm(AForm: TCustomForm);
|
||||
procedure GtkWindowShowModal(AForm: TCustomForm; GtkWindow: PGtkWindow);
|
||||
|
||||
// label
|
||||
procedure SetLabelAlignment(LabelWidget: PGtkLabel;
|
||||
|
@ -144,7 +144,6 @@ type
|
||||
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): HWND; override;
|
||||
end;
|
||||
|
||||
procedure GtkWindowShowModal(GtkWindow: PGtkWindow);
|
||||
function GetWidgetHAdjustment(AWidget: PGTKWidget): PGTKAdjustment;
|
||||
function GetWidgetVAdjustment(AWidget: PGTKWidget): PGTKAdjustment;
|
||||
|
||||
@ -359,27 +358,6 @@ begin
|
||||
Gtk1SetBorderStyle(AWinControl, ABorderStyle);
|
||||
end;
|
||||
|
||||
|
||||
procedure GtkWindowShowModal(GtkWindow: PGtkWindow);
|
||||
begin
|
||||
if (GtkWindow=nil) then exit;
|
||||
UnsetResizeRequest(PgtkWidget(GtkWindow));
|
||||
|
||||
if ModalWindows=nil then ModalWindows:=TFPList.Create;
|
||||
ModalWindows.Add(GtkWindow);
|
||||
{$IFNDEF gtk_no_set_modal}
|
||||
gtk_window_set_modal(GtkWindow, true);
|
||||
{$ENDIF}
|
||||
if gtk_window_get_type_hint(GtkWindow) <> GDK_WINDOW_TYPE_HINT_DIALOG then
|
||||
gtk_window_set_skip_taskbar_hint(GtkWindow, True);
|
||||
gtk_window_present(GtkWindow);
|
||||
{$IFDEF VerboseTransient}
|
||||
DebugLn('TGtkWidgetSet.ShowModal ',Sender.ClassName);
|
||||
{$ENDIF}
|
||||
//TGtk2WidgetSet(WidgetSet).
|
||||
GTK2WidgetSet.UpdateTransientWindows;
|
||||
end;
|
||||
|
||||
function GetWidgetHAdjustment(AWidget: PGTKWidget): PGTKAdjustment;
|
||||
begin
|
||||
if GtkWidgetIsA(AWidget,GTK_TYPE_SCROLLED_WINDOW) then
|
||||
|
@ -1203,7 +1203,7 @@ begin
|
||||
end;
|
||||
|
||||
gtk_window_set_position(GtkWindow, GTK_WIN_POS_CENTER);
|
||||
GtkWindowShowModal(GtkWindow);
|
||||
GtkWindowShowModal(nil, GtkWindow);
|
||||
end;
|
||||
|
||||
class procedure TGtk2WSCommonDialog.DestroyHandle(
|
||||
|
@ -616,7 +616,7 @@ begin
|
||||
GtkWindow := PGtkWindow(AForm.Handle);
|
||||
gtk_window_set_default_size(GtkWindow, Max(1,AForm.Width), Max(1,AForm.Height));
|
||||
gtk_widget_set_uposition(PGtkWidget(GtkWindow), AForm.Left, AForm.Top);
|
||||
GtkWindowShowModal(GtkWindow);
|
||||
GtkWindowShowModal(AForm, GtkWindow);
|
||||
end else
|
||||
Gtk2WidgetSet.SetVisible(AWinControl, AForm.HandleObjectShouldBeVisible);
|
||||
InvalidateLastWFPResult(AWinControl, AWinControl.BoundsRect);
|
||||
|
Loading…
Reference in New Issue
Block a user