mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-05 10:55:56 +02:00
Gtk2: use gtk_window_set_keep_above() just before show/hide. fixes #16595
git-svn-id: trunk@26764 -
This commit is contained in:
parent
a18bbff0f4
commit
960c3f895a
@ -92,6 +92,7 @@ type
|
|||||||
const ABorderIcons: TBorderIcons); override;}
|
const ABorderIcons: TBorderIcons); override;}
|
||||||
class procedure SetAllowDropFiles(const AForm: TCustomForm; AValue: Boolean); override;
|
class procedure SetAllowDropFiles(const AForm: TCustomForm; AValue: Boolean); override;
|
||||||
class procedure SetShowInTaskbar(const AForm: TCustomForm; const AValue: TShowInTaskbar); override;
|
class procedure SetShowInTaskbar(const AForm: TCustomForm; const AValue: TShowInTaskbar); override;
|
||||||
|
class procedure ShowHide(const AWinControl: TWinControl); override;
|
||||||
class procedure ShowModal(const AForm: TCustomForm); override;
|
class procedure ShowModal(const AForm: TCustomForm); override;
|
||||||
class procedure SetBorderIcons(const AForm: TCustomForm;
|
class procedure SetBorderIcons(const AForm: TCustomForm;
|
||||||
const ABorderIcons: TBorderIcons); override;
|
const ABorderIcons: TBorderIcons); override;
|
||||||
@ -266,7 +267,6 @@ var
|
|||||||
AResizable: gint;
|
AResizable: gint;
|
||||||
begin
|
begin
|
||||||
// Start of old CreateForm method
|
// Start of old CreateForm method
|
||||||
|
|
||||||
ACustomForm := TCustomForm(AWinControl);
|
ACustomForm := TCustomForm(AWinControl);
|
||||||
|
|
||||||
if (AParams.Style and WS_CHILD) = 0 then
|
if (AParams.Style and WS_CHILD) = 0 then
|
||||||
@ -312,7 +312,8 @@ begin
|
|||||||
if (AParams.WndParent <> 0) then
|
if (AParams.WndParent <> 0) then
|
||||||
gtk_window_set_transient_for(PGtkWindow(P), PGtkWindow(AParams.WndParent))
|
gtk_window_set_transient_for(PGtkWindow(P), PGtkWindow(AParams.WndParent))
|
||||||
else
|
else
|
||||||
if not (csDesigning in ACustomForm.ComponentState) and (ACustomForm.FormStyle = fsStayOnTop) then
|
if not (csDesigning in ACustomForm.ComponentState) and
|
||||||
|
(ACustomForm.FormStyle in fsAllStayOnTop) then
|
||||||
gtk_window_set_keep_above(PGtkWindow(P), gboolean(True));
|
gtk_window_set_keep_above(PGtkWindow(P), gboolean(True));
|
||||||
|
|
||||||
// the clipboard needs a widget
|
// the clipboard needs a widget
|
||||||
@ -487,17 +488,13 @@ end;
|
|||||||
|
|
||||||
class procedure TGtk2WSCustomForm.SetFormStyle(const AForm: TCustomform;
|
class procedure TGtk2WSCustomForm.SetFormStyle(const AForm: TCustomform;
|
||||||
const AFormStyle, AOldFormStyle: TFormStyle);
|
const AFormStyle, AOldFormStyle: TFormStyle);
|
||||||
var
|
|
||||||
above : gboolean;
|
|
||||||
Widget : PGtkWidget;
|
|
||||||
begin
|
begin
|
||||||
if not WSCheckHandleAllocated(AForm, 'SetFormStyle') then
|
if not WSCheckHandleAllocated(AForm, 'SetFormStyle') then
|
||||||
exit;
|
exit;
|
||||||
if (csDesigning in AForm.ComponentState) then
|
if (csDesigning in AForm.ComponentState) then
|
||||||
exit;
|
exit;
|
||||||
above := AFormStyle in fsAllStayOnTop;
|
gtk_window_set_keep_above(PGtkWindow(AForm.Handle),
|
||||||
Widget := PGtkWidget(AForm.Handle);
|
GBoolean(AFormStyle in fsAllStayOnTop));
|
||||||
gtk_window_set_keep_above(PGtkWindow(Widget), above);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{class function TGtk2WSCustomForm.GetDefaultClientRect(
|
{class function TGtk2WSCustomForm.GetDefaultClientRect(
|
||||||
@ -541,6 +538,24 @@ begin
|
|||||||
SetFormShowInTaskbar(AForm,AValue);
|
SetFormShowInTaskbar(AForm,AValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class procedure TGtk2WSCustomForm.ShowHide(const AWinControl: TWinControl);
|
||||||
|
var
|
||||||
|
AForm: TCustomForm;
|
||||||
|
begin
|
||||||
|
AForm := TCustomForm(AWinControl);
|
||||||
|
if not (csDesigning in AForm.ComponentState) then
|
||||||
|
begin
|
||||||
|
if AForm.HandleObjectShouldBeVisible then
|
||||||
|
gtk_window_set_keep_above(PGtkWIndow(AForm.Handle),
|
||||||
|
GBoolean(AForm.FormStyle in fsAllStayOnTop))
|
||||||
|
else
|
||||||
|
if (AForm.FormStyle in fsAllStayOnTop) and
|
||||||
|
not (csDestroying in AWinControl.ComponentState) then
|
||||||
|
gtk_window_set_keep_above(PGtkWIndow(AForm.Handle), GBoolean(False));
|
||||||
|
end;
|
||||||
|
Gtk2WidgetSet.SetVisible(AWinControl, AForm.HandleObjectShouldBeVisible);
|
||||||
|
end;
|
||||||
|
|
||||||
class procedure TGtk2WSCustomForm.ShowModal(const AForm: TCustomForm);
|
class procedure TGtk2WSCustomForm.ShowModal(const AForm: TCustomForm);
|
||||||
var
|
var
|
||||||
GtkWindow: PGtkWindow;
|
GtkWindow: PGtkWindow;
|
||||||
|
Loading…
Reference in New Issue
Block a user