Recent

Author Topic: My form always stays on top  (Read 7018 times)

MarcoTC

  • Newbie
  • Posts: 3
My form always stays on top
« on: May 20, 2015, 09:31:54 pm »
Hello,

I ran into Lazarus a while ago but finally installed the latest stables from the website yesterday. I love it! It brings back good memories when programming in Delphi 1-7.

Anyways, I'm on a Mac and switched on the Cocoa Widgetset (Projects>Project Options...>Additions and Overrides).

Not everything works good but I can handle or avoid most of it. However, one thing I cannot figure out.
With Cocoa, my form always stays on top. When I click outside the form, it looses focus but it stays on top. I have no idea why or how to let it behave normally. With switching back to Carbon, all works fine.

To duplicate; Open a new project, switch on Cocoa, Build and run. Then click somewhere outside of the running project and you'll see what I mean.

I assume this is a bug but is there a workaround or an easy way to fix this?


skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: My form always stays on top
« Reply #1 on: May 20, 2015, 09:57:51 pm »
You might want to try (svn) trunk version.

Cocoa is in development, thus the trunk version might have the issue fixed. Also, some of the other issues you encountered might be fixed as well.

Besides the stable release won't be fixed until... the next release. While using trunk you'll always get the latest fixed as soon as they're available.
« Last Edit: May 20, 2015, 09:59:54 pm by skalogryz »

MarcoTC

  • Newbie
  • Posts: 3
Re: My form always stays on top
« Reply #2 on: May 20, 2015, 11:37:08 pm »
Many thanks but no luck.  :(
I just installed the latest Lazarus SVN using 'svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus'.
The about now says Lazarus 1.5. SVN 49123
I'm not sure if that's enough though. Do I also need trunks from fpcsrc and fpc?

If not, where do I report this bug to the team working on it?
Thank you

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: My form always stays on top
« Reply #3 on: May 21, 2015, 04:27:17 am »
I'm not sure if that's enough though. Do I also need trunks from fpcsrc and fpc?
Typically not. Are yo unable to compile Lazarus or is trunk Lazarus showing the same problem with the form?

If not, where do I report this bug to the team working on it?
Please read this page. It will guide you to the bug tracker.

MarcoTC

  • Newbie
  • Posts: 3
Re: My form always stays on top
« Reply #4 on: May 21, 2015, 08:15:04 am »
Thank you!

tom.tom

  • New Member
  • *
  • Posts: 43
Re: My form always stays on top
« Reply #5 on: August 03, 2015, 06:52:11 pm »
hi, we are just porting our Carbon app to cocoa. The Form always on top is the first problem we faced. I do not have an account on Bugtracker or SVN so please somebody who has it - check in the fix and mark the bug as resolved:

in CocoaWSForms

change this:
Code: [Select]
const
  FormStyleToWindowLevel: array[TFormStyle] of NSInteger = (
 { fsNormal          } 4, // NSNormalWindowLevel
 { fsMDIChild        } 4, // NSNormalWindowLevel
 { fsMDIForm         } 4, // NSNormalWindowLevel
 { fsStayOnTop       } 9, // NSStatusWindowLevel
 { fsSplash          } 9, // NSStatusWindowLevel
 { fsSystemStayOnTop } 10  // NSModalPanelWindowLevel
  );   

into this (NSNormalWindowLevel value fixed):

Code: [Select]
const
  FormStyleToWindowLevel: array[TFormStyle] of NSInteger = (
 { fsNormal          } 0, // NSNormalWindowLevel
 { fsMDIChild        } 0, // NSNormalWindowLevel
 { fsMDIForm         } 0, // NSNormalWindowLevel
 { fsStayOnTop       } 9, // NSStatusWindowLevel
 { fsSplash          } 9, // NSStatusWindowLevel
 { fsSystemStayOnTop } 10  // NSModalPanelWindowLevel
  );   

...then recompile Lazarus

Cheers,
Tomasz

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: My form always stays on top
« Reply #6 on: August 03, 2015, 09:36:21 pm »
The Form always on top is the first problem we faced. I do not have an account on Bugtracker or SVN ...

You can easily create an account for Bugtracker. You can get the trunk development version from SVN as MarcoTC mentioned earlier.
A patch format is very handy and useful. Let's use it. You will need the development version in any case with Cocoa, so creating a patch will not be a big effort.

http://wiki.freepascal.org/Creating_A_Patch
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

 

TinyPortal © 2005-2018