Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-76147

window state always is minimized

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Fixed
    • Affects Version/s: 5.7.0, 5.12.0
    • Fix Version/s: 5.12, 5.14
    • Component/s: QPA: X11/XCB
    • Labels:
      None
    • Environment:
      KWin/X11
    • Platform/s:
      Linux/X11
    • Commits:
      4f370d36ec5caa02f78545ceee5704d94edf0530(5.14) 283d9b01dc3ab6c95c688b0e5f5c98c41ca22d30(5.12)

      Description

      Window Manager Environment:

      • KWin 5.15.5、KWin 5.8.6
      • Enable Always hidden previews, or manually add configuration items:
      cat ~/.config/kwinrc:

      [Compositing]
      ...
      HiddenPreviews=6
      ...

      After that, when WinWindow requests are minimized, KWin does not change the WM_STATE property.

      Yes, KWin maybe is wrong. But I see X11 document from https://specifications.freedesktop.org/wm-spec/1.3/ar01s05.html

      _NET_WM_STATE_HIDDEN

      _NET_WM_STATE_HIDDEN should be set by the Window Manager to indicate that a window would not be visible on the screen if its desktop/viewport were active and its coordinates were within the screen bounds. The canonical example is that minimized windows should be in the _NET_WM_STATE_HIDDEN state. Pagers and similar applications should use _NET_WM_STATE_HIDDEN instead of WM_STATE to decide whether to display a window in miniature representations of the windows on a desktop.

      Implementation note: if an Application asks to toggle _NET_WM_STATE_HIDDEN the Window Manager should probably just ignore the request, since _NET_WM_STATE_HIDDEN is a function of some other aspect of the window such as minimization, rather than an independent state.

      Whether the meaning of this paragraph can be understood as: when the _NET_WM_STATE attribute does not contain _NET_WM_STATE_HIDDEN, the window is not considered to be minimized?

      KWin does not change the WM_STATE property of the window, but the _NET_WM_STATE property of the window is indeed changed. _NET_WM_STATE_HIDDEN is added when the window is minimized, otherwise it will be removed.

      Please refer to the attached code, execute in KWin will get the following output:

      begin show minimize
      QFlags<Qt::WindowState>(WindowMinimized)
      WM_STATE(WM_STATE):
      		window state: Normal
      		icon window: 0x0
      _NET_WM_STATE(ATOM) = _NET_WM_STATE_HIDDEN
      end show minimize
      
      
      
      
      begin active window
      WM_STATE(WM_STATE):
      		window state: Normal
      		icon window: 0x0
      _NET_WM_STATE(ATOM) = 
      end active window
      
      
      
      
      QFlags<Qt::WindowState>(WindowMinimized) 
      

        Attachments

        1. HiddenPreviews=5.png
          HiddenPreviews=5.png
          98 kB
        2. HiddenPreviews=6.png
          HiddenPreviews=6.png
          97 kB
        3. test_window_state.zip
          3 kB

          Issue Links

          For Gerrit Dashboard: QTBUG-76147
          # Subject Branch Project Status CR V

            Activity

              People

              • Assignee:
                liaqi Liang Qi
                Reporter:
                zccrs chen zhang
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes