mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 00:19:26 +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}
|
{$ENDIF}
|
||||||
end;
|
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}
|
{$IFDEF HasX}
|
||||||
function FormToX11Window(const AForm: TCustomForm): X.TWindow;
|
function FormToX11Window(const AForm: TCustomForm): X.TWindow;
|
||||||
var
|
var
|
||||||
|
@ -358,6 +358,7 @@ procedure GrabKeyBoardToForm(AForm: TCustomForm);
|
|||||||
procedure ReleaseKeyBoardFromForm(AForm: TCustomForm);
|
procedure ReleaseKeyBoardFromForm(AForm: TCustomForm);
|
||||||
procedure GrabMouseToForm(AForm: TCustomForm);
|
procedure GrabMouseToForm(AForm: TCustomForm);
|
||||||
procedure ReleaseMouseFromForm(AForm: TCustomForm);
|
procedure ReleaseMouseFromForm(AForm: TCustomForm);
|
||||||
|
procedure GtkWindowShowModal(AForm: TCustomForm; GtkWindow: PGtkWindow);
|
||||||
|
|
||||||
// label
|
// label
|
||||||
procedure SetLabelAlignment(LabelWidget: PGtkLabel;
|
procedure SetLabelAlignment(LabelWidget: PGtkLabel;
|
||||||
|
@ -144,7 +144,6 @@ type
|
|||||||
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): HWND; override;
|
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): HWND; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure GtkWindowShowModal(GtkWindow: PGtkWindow);
|
|
||||||
function GetWidgetHAdjustment(AWidget: PGTKWidget): PGTKAdjustment;
|
function GetWidgetHAdjustment(AWidget: PGTKWidget): PGTKAdjustment;
|
||||||
function GetWidgetVAdjustment(AWidget: PGTKWidget): PGTKAdjustment;
|
function GetWidgetVAdjustment(AWidget: PGTKWidget): PGTKAdjustment;
|
||||||
|
|
||||||
@ -359,27 +358,6 @@ begin
|
|||||||
Gtk1SetBorderStyle(AWinControl, ABorderStyle);
|
Gtk1SetBorderStyle(AWinControl, ABorderStyle);
|
||||||
end;
|
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;
|
function GetWidgetHAdjustment(AWidget: PGTKWidget): PGTKAdjustment;
|
||||||
begin
|
begin
|
||||||
if GtkWidgetIsA(AWidget,GTK_TYPE_SCROLLED_WINDOW) then
|
if GtkWidgetIsA(AWidget,GTK_TYPE_SCROLLED_WINDOW) then
|
||||||
|
@ -1203,7 +1203,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
gtk_window_set_position(GtkWindow, GTK_WIN_POS_CENTER);
|
gtk_window_set_position(GtkWindow, GTK_WIN_POS_CENTER);
|
||||||
GtkWindowShowModal(GtkWindow);
|
GtkWindowShowModal(nil, GtkWindow);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TGtk2WSCommonDialog.DestroyHandle(
|
class procedure TGtk2WSCommonDialog.DestroyHandle(
|
||||||
|
@ -616,7 +616,7 @@ begin
|
|||||||
GtkWindow := PGtkWindow(AForm.Handle);
|
GtkWindow := PGtkWindow(AForm.Handle);
|
||||||
gtk_window_set_default_size(GtkWindow, Max(1,AForm.Width), Max(1,AForm.Height));
|
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_widget_set_uposition(PGtkWidget(GtkWindow), AForm.Left, AForm.Top);
|
||||||
GtkWindowShowModal(GtkWindow);
|
GtkWindowShowModal(AForm, GtkWindow);
|
||||||
end else
|
end else
|
||||||
Gtk2WidgetSet.SetVisible(AWinControl, AForm.HandleObjectShouldBeVisible);
|
Gtk2WidgetSet.SetVisible(AWinControl, AForm.HandleObjectShouldBeVisible);
|
||||||
InvalidateLastWFPResult(AWinControl, AWinControl.BoundsRect);
|
InvalidateLastWFPResult(AWinControl, AWinControl.BoundsRect);
|
||||||
|
Loading…
Reference in New Issue
Block a user