From 37a024507a377140bd304c41c05a7242263cc80c Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 11 Mar 2010 16:10:01 +0000 Subject: [PATCH] gtk2 intf: implemented fsStayOnTop for other BorderStyles than bsNone, bug #8988 git-svn-id: trunk@23946 - --- lcl/interfaces/gtk2/gtk2wsforms.pp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lcl/interfaces/gtk2/gtk2wsforms.pp b/lcl/interfaces/gtk2/gtk2wsforms.pp index a9218c50be..36e333cade 100644 --- a/lcl/interfaces/gtk2/gtk2wsforms.pp +++ b/lcl/interfaces/gtk2/gtk2wsforms.pp @@ -166,8 +166,6 @@ begin // Maps the border style WindowType := FormStyleMap[ABorderStyle]; - if (ABorderStyle = bsNone) and (ACustomForm.FormStyle in fsAllStayOnTop) then - WindowType := GTK_WINDOW_POPUP; if (csDesigning in ACustomForm.ComponentState) then WindowType := GTK_WINDOW_TOPLEVEL; @@ -176,6 +174,9 @@ begin // create a floating form P := gtk_window_new(WindowType); + if (ABorderStyle = bsNone) and (ACustomForm.FormStyle in fsAllStayOnTop) then + gtk_window_set_decorated(PGtkWindow(P), False); + // Sets the window as resizable or not // Depends on the WM supporting this if (csDesigning in ACustomForm.ComponentState) then @@ -189,8 +190,13 @@ begin // Sets the title gtk_window_set_title(PGtkWindow(P), AParams.Caption); - if PopupParent <> nil then - gtk_window_set_transient_for(PGtkWindow(P), PGtkWindow(PopupParent.Handle)); + if (PopupParent <> nil) then + gtk_window_set_transient_for(PGtkWindow(P), PGtkWindow(PopupParent.Handle)) + else + if not (csDesigning in ACustomForm.ComponentState) + and (ACustomForm.FormStyle = fsStayOnTop) + and not (ACustomForm.BorderStyle in [bsNone]) then + gtk_window_set_keep_above(PGtkWindow(P), gboolean(True)); // the clipboard needs a widget if (ClipboardWidget = nil) then