[Lazarus] Always on top: Object Inspector and Message Window

Kapibara Pas kapibara.pas at aol.com
Sat Feb 18 03:17:31 CET 2017


Bart, rev. 53831 introduced the bug. http://bugs.freepascal.org/view.php?id=13051

I uploaded a patch for each affected file and added a note.


lcl/interfaces/gtk2/gtk2wsforms.pp
lcl/interfaces/gtk2/gtk2globals.pp



Index: gtk2wsforms.pp
===================================================================
--- gtk2wsforms.pp    (revision 53831)
+++ gtk2wsforms.pp    (revision 53830)
@@ -724,12 +724,8 @@
   begin
     if AForm.HandleObjectShouldBeVisible and
       GTK_IS_WINDOW({%H-}PGtkWindow(AForm.Handle)) then
-      begin
-        gtk_window_set_type_hint({%H-}PGtkWindow(AForm.Handle),
-          GtkWindowTypeHints[AForm.BorderStyle]);
         gtk_window_set_keep_above({%H-}PGtkWindow(AForm.Handle),
           GBoolean(AForm.FormStyle in fsAllStayOnTop))
-      end
     else
     if (AForm.FormStyle in fsAllStayOnTop) and
       not (csDestroying in AWinControl.ComponentState) then
@@ -1041,16 +1037,10 @@
 end;
 
 class procedure TGtk2WSHintWindow.ShowHide(const AWinControl: TWinControl);
-var
-  bVisible: boolean;
 begin
   if not WSCheckHandleAllocated(AWinControl, 'SetColor') then
     exit;
-
-  bVisible := AWinControl.HandleObjectShouldBeVisible;
-  if bVisible then
-    gtk_window_set_type_hint(PGtkWindow(AWinControl.Handle), GDK_WINDOW_TYPE_HINT_TOOLTIP);
-  Gtk2WidgetSet.SetVisible(AWinControl, bVisible);
+  Gtk2WidgetSet.SetVisible(AWinControl, AWinControl.HandleObjectShouldBeVisible);
   InvalidateLastWFPResult(AWinControl, AWinControl.BoundsRect);
 end;
 


Index: gtk2globals.pp
===================================================================
--- gtk2globals.pp    (revision 53831)
+++ gtk2globals.pp    (revision 53830)
@@ -73,18 +73,7 @@
 
 var
   Styles : TStrings;
-
-const
-  //(bsNone, bsSingle, bsSizeable, bsDialog, bsToolWindow, bsSizeToolWin);
-  GtkWindowTypeHints: array[TFormBorderStyle] of TGdkWindowTypeHint = (
-    GDK_WINDOW_TYPE_HINT_NOTIFICATION,
-    GDK_WINDOW_TYPE_HINT_DIALOG,
-    GDK_WINDOW_TYPE_HINT_NORMAL,
-    GDK_WINDOW_TYPE_HINT_DIALOG,
-    GDK_WINDOW_TYPE_HINT_UTILITY,
-    GDK_WINDOW_TYPE_HINT_UTILITY
-    );
-
+  
 var
   DefaultPangoLayout: PPangoLayout = nil;
 


 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170217/23feb7e7/attachment.html>


More information about the Lazarus mailing list