Nominate our 2022 Qt Champions!

Qt 5.3.0 vs Qt 5.2.1 - Entire screen "always on top window" behavior changed on MacOSX !?

  • Hi all,

    Before upgrading to new Qt 5.3.0 framework, one of my apps, which has a full screen overlaying QWidget with the size of the entire desktop main screen, had the entire screen covered, this is, even the MacOSX top menu bar was covered by it. The window was frameless and also set to always stay on top. This worked just fine in Qt 5.2.1. When I upgraded and recompiled using Qt 5.3.0, the window is now rendered exactly with the same size as before but the top menu bar is no longer beneath it, ruining the entire full screen overlay effect I had before. Has the "always on top" behavior changed in any way on MacOSX? I've noticed that on Windows it remains consistent, so it must be a MacOSX specific issue. Is there a new flag I need to set on to accomplish this same effect? It seems no matter what flags I fiddle with or how many times I call raise() on that widget, the top menu MacOSX bar will always be on top of my widget.

    Thank you in advance for your patience and any kind of hints or workarounds are welcome.


  • Looks like it has change.

    The 2 workarounds I can think of are:

    1- make your window a tooltip

    2- get the NSWindow and change the level yourself:

    @NSView *view = (NSView *)mywidget->window()->winId();
    NSWindow *wnd = [view window];
    [wnd setLevel:NSScreenSaverWindowLevel];

    both untested :-)

    The code in QCocoaWindow::windowLevel() decide of the level for a window, NSPopUpMenuWindowLevel has change to NSModalPanelWindowLevel for Qt::WindowStaysOnTopHint.

  • Thanks. Yes, I'm using kCGOverlayWindowLevel. I'm just wondering why it changed though....

Log in to reply