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:
zeljko 2011-04-07 13:07:57 +00:00
parent b2602124fe
commit 6b1b1b22d1
5 changed files with 25 additions and 24 deletions

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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(

View File

@ -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);