On 10/16/2015 01:33 PM, Gabor Boros wrote:
2015.10.16. 13:14 keltezéssel, Zeljko írta:

You can set FormStyle := fsStayOnTop for that popup form so you'll
achieve that effect.

zeljko

I tried this before wrote to the list but have a side effect. The green
form showed above all other opened windows (not just form's of current
application) in the OS with KDE4 and Windows too.

Please try with attached patch. In this case you can test without FormStyle := fsStayOnTop. FYI, in this patch I'm setting stayontop for X11 so that could make a problem. Test with this patch and let me know if this is what you want. If not I have (maybe) another solution.

zeljko
Index: lcl/interfaces/qt/qtwsforms.pp
===================================================================
--- lcl/interfaces/qt/qtwsforms.pp	(revision 50082)
+++ lcl/interfaces/qt/qtwsforms.pp	(working copy)
@@ -556,19 +556,32 @@
       if AWinControl.HandleObjectShouldBeVisible and
         not (TCustomForm(AWinControl).FormStyle in fsAllStayOnTop) and
         not (fsModal in TCustomForm(AWinControl).FormState) and
+        (TCustomForm(AWinControl).FormStyle <> fsMDIChild) and
         (TCustomForm(AWinControl).PopupMode = pmAuto) and
         (TCustomForm(AWinControl).BorderStyle = bsNone) and
         (TCustomForm(AWinControl).PopupParent = nil) then
       begin
         W := QApplication_activeWindow;
-        if (W <> nil) and not QWidget_isModal(W) then
+        if (W <> nil) then
         begin
-          Flags := QWidget_windowFlags(W);
-          if (Flags and QtWindowStaysOnTopHint <> QtWindowStaysOnTopHint) and
-            GetAlwaysOnTopX11(W) then
+          if not QWidget_isModal(W) then
           begin
-            Flags := Widget.windowFlags;
-            Widget.setWindowFlags(Flags or QtWindowStaysOnTopHint);
+            Flags := QWidget_windowFlags(W);
+            if (Flags and QtWindowStaysOnTopHint <> QtWindowStaysOnTopHint) and
+              GetAlwaysOnTopX11(W) then
+            begin
+              Flags := Widget.windowFlags;
+              Widget.setWindowFlags(Flags or QtWindowStaysOnTopHint);
+            end;
+          end else
+          begin
+            Flags := QWidget_windowFlags(W);
+            if (Flags and QtWindowStaysOnTopHint <> QtWindowStaysOnTopHint) and
+              not GetAlwaysOnTopX11(W) then
+            begin
+              Flags := Widget.windowFlags;
+              Widget.setWindowFlags(Flags or QtWindowStaysOnTopHint);
+            end;
           end;
         end;
       end;
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to