Important: Please read the Qt Code of Conduct -

Qt::X11BypassWindowManagerHint causing issues on QT5.X

  • We have QMainWindow that we require to be ONTOP at all times on Linux. Following the QT doc we have setup the window flags as follows:

    QMainWindow(parent, Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint| Qt::FramelessWindowHint )

    While this does put the window ontop, the data inside the window does not update it stays frozen on the info put there at startup. Removal of the Qt::X11BypassWindowManagerHint allows the window to operate normally, it just does not stay ontop of all other Qt/X windows. On QT versions prior to QT5 this was working as expected.

    In the case of this window the window contains an OpenSceneGraph viewerWidget setup.

    MainWindow::MainWindow(QWidget *parent) :
    // QMainWindow(parent, Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint| Qt::FramelessWindowHint ),
    QMainWindow(parent, Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint ),
    ui(new Ui::MainWindow)

    run_app = 0;
    init_count = false;
    pod_on = false;
    QShortcut *shortcut = new QShortcut(QKeySequence("F4"), this);
    connect(shortcut, SIGNAL(activated()), this, SLOT(close()));
    _view = ui->graphic_view->add("POD HD");
    if( QFileInfo( ConvertPath("POD_HD_Config")+"pod_hd_config.ini" ).exists() )
    connect(&_timer, SIGNAL(timeout()), this, SLOT(update()));


    int main(int argc, char *argv[])

    QApplication a(argc, argv);
    MainWindow w;;
    return a.exec();


    Any hints would be appreciated...I can post more code if needed, but the code is property of our
    customer so I can only post snippets until I get a small selfcontained app created.

    Thank you,

    Curtis Rubel

Log in to reply