NSBorderlessWindowMask - shadows not working correctly

  • I have a subclass of NSWindow programmed for my main application window which is using NSBorderlessWindowMask. Everything is working great except for the correct shadow behaviour. By that I mean - a shadow appears (setHasShadow:YES) but it doesn't change when the app is active/inactive (it doesn't get bigger and darker when the app is in focus like a regular NSWindow).

    I have set canBecomeKeyWindow and canBecomeMainWindow to YES - but it doesn't seem to help the matter.

    I've searched through the archives many times and have not found a solution - I've also searched CocoaDev.com - the closest solution I found was someone suggesting to draw the shadow from scratch.

    Another developer I know is also in the same situation - any help would be great!

    Regards,
    Jerry
  • On 2006/10/02, at 5:28, Jerry Brace wrote:

    > I have a subclass of NSWindow programmed for my main application
    > window which is using NSBorderlessWindowMask. Everything is working
    > great except for the correct shadow behaviour. By that I mean - a
    > shadow appears (setHasShadow:YES) but it doesn't change when the
    > app is active/inactive (it doesn't get bigger and darker when the
    > app is in focus like a regular NSWindow).
    >
    > I have set canBecomeKeyWindow and canBecomeMainWindow to YES - but
    > it doesn't seem to help the matter.
    >
    > I've searched through the archives many times and have not found a
    > solution - I've also searched CocoaDev.com - the closest solution I
    > found was someone suggesting to draw the shadow from scratch.
    >
    > Another developer I know is also in the same situation - any help
    > would be great!
    Yes, this is the default behavior. The reason being to discourage
    developers from creating divergent UIs in the same OS.

    If you want to have your own window style, subclass a normal
    NSWindow, and at creation time, have the content view (custom
    subclass) completely erase
    the contents of the window (you'll have to get the full rect of the
    window, not contents) and draw using a clear color. Then draw
    anything you want as normal,
    the shadow will be drawn automatically. You may also want to remove
    the standard buttons (close open minimize, toolbar and title) from
    the window as well.

    Andre
previous month october 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today