Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Set WM Type for PyQT Application



  • Hello,

    I was wondering if there was a way to set the WM Type (_NET_WM_WINDOW_TYPE(ATOM)) in PyQT to change how XOrg understands the window. Specifically, I'd like to change it from "normal" to "dock."

    I've searched Google far and wide, but it hasn't been of much use. This is the best thing I've found but it doesn't seem plausible in context of PyQT: https://www.tcl.tk/man/tcl8.6/TkCmd/wm.htm

    Does anyone know how to do this?

    Thanks!



  • @PJBeans

    UPDATE: Figured it out:

    It can be set using setAttribute():

    class MainWindow(QWidget):
        def __init__(self, parent = None):
            super(MainWindow,self).__init__(parent)
            self.setAttribute(Qt.WA_X11NetWmWindowTypeDock)
    

Log in to reply