qtubuntudebianqt-creatorflags

Frameless window flag in QT creator program is ignored in debian, but accepted in ubuntu and wsl


I am working from Ubuntu, and my friend has a minimal Debian system. His system uses x11 and openbox, and the login manager is lightdm.

On my system, I compiled a QT-Creator application in which the window is supposed to be set as undecorated. It works flawlessly on my system, but on his it remains decorated.

I don't know if this is a problem with my code or the configurations and packages in his system, or both. The relevant code from main.cpp:

int main(int argc, char *argv[]){
    QApplication a(argc, argv);
    MainWindow w;
    w.setWindowFlags(Qt::FramelessWindowHint);
    w.show();
}

Solution

  • From the WindowType/WindowFlags documentation:

    Some of these flags depend on whether the underlying window manager supports them.

    The Qt6 docs also add a further note specific to the FramelessWindowHint flag:

    On X11, the result of the flag is dependent on the window manager and its ability to understand Motif and/or NETWM hints. Most existing modern window managers can handle this.

    Specifically, on Linux the window manager may not support such flags or it may be configured to simply ignore them.

    You may try adding further flags and combinations, such as Tool, SplashScreen or BypassWindowManagerHint, or check the widget attributes starting with "WA_X11", but keep in mind that:

    Remember that the great extensibility and configurability of Linux systems has its own downsides: for windows it means that the WM always has ultimate control over the appearance (geometry and decorations) of windows, no matter what the program may "ask".