Wrong X Window Map State

Bug #1827738 reported by Thomas
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mutter
New
Unknown
mutter (Ubuntu)
Opinion
Low
Unassigned

Bug Description

Testet on Ubuntu 18.04.02 LTS

Use [xwininfo] and e.g. [emacs] or [terminal] to test for map state.

Call [xwininfo] and click on the open terminal window:

xwininfo: Window id: 0x2c04847 "tombert@bionic: ~"

  Absolute upper-left X: 741
  Absolute upper-left Y: 94
  Relative upper-left X: 10
  Relative upper-left Y: 38
  Width: 734
  Height: 458
  Depth: 32
  Visual: 0x2a0
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x2c00005 (not installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners: +741+94 -261+94 -261-808 +741-808
  -geometry 80x24+731+56

Now iconify the terminal and call: [xwininfo -id 0x2c04847]
The "Map State" is still "IsViewable" when it should be unmapped.

The reference I found:
(http://lesstif.sourceforge.net/doc/super-ux/g1ae04e/chap3-2.html)
"3.4.2.5 Iconify and Deiconify
A top-level window that is not Withdrawn will be in the Normal state if it is mapped and in the Iconic state if it is unmapped. This will be true even if the window has been reparented; the window manager will unmap the window as well as its parent when switching to the Iconic state."

The big problem is that graphical applications cannot distinguish their current state.
If this is not a bug, then please give advice in how to query the iconified state.

Best Regards

Tags: bionic
Revision history for this message
Thomas (teclab-at) wrote :

change package to xorg

Olivier Tilloy (osomon)
affects: chromium-browser (Ubuntu) → xorg (Ubuntu)
affects: xorg (Ubuntu) → mutter (Ubuntu)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

My memory of X window management is a bit hazy, but I think the "Map State" and window state (one of which is "IconicState") are allowed to have different values for the same window.

The window state including "IconicState" is defined in this spec:

  https://www.x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html

I suspect you may be right that the above ICCCM spec requires iconified windows to be unmapped, but I am not sure. Certainly in the past Unity for example would leave them mapped for the purposes of window previews. So there is prior art for window managers to bend the rules...

Please report the bug to the mutter developers here so we can see what they think:

  https://gitlab.gnome.org/GNOME/mutter/issues

Then tell us the new bug ID.

Changed in mutter (Ubuntu):
status: New → Incomplete
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

> The big problem is that graphical applications cannot distinguish their current state.
> If this is not a bug, then please give advice in how to query the iconified state.

Now that you mention it, maybe we don't need to log a mutter bug.

If you want the iconified state of a window you just need to query the value of its WM_STATE atom. For example on the command line:

$ xprop -id 0x3c00007 | grep -A1 '^WM_STATE'
WM_STATE(WM_STATE):
  window state: Iconic

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Changed in mutter (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

But again that will only tell you if the window is iconified.

If the window is both window state Iconic and map state IsViewable then the window is still required to redraw properly. Even in Ubuntu 18.04 this is necessary to support window previews when you right click on an icon in the dock. I'm not sure if there are any other reasons for it...

Revision history for this message
Thomas (teclab-at) wrote :

Also the documentation you point to states:

Once a client's window has left the Withdrawn state, the window will be mapped if it is in the Normal state and the window will be unmapped if it is in the Iconic state.

I requested further clarification:
https://gitlab.gnome.org/GNOME/mutter/issues/589

Some other references:
https://core.tcl.tk/tk/tktview/3131699cb421ec1de2b6fa08ff0835dd34eff3cb
https://groups.google.com/forum/#!topic/comp.lang.tcl/r7tm-swRWpE

thx for your support

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks.

I think you will find IsViewable for iconic windows is an intentional design decision, even if not strictly compliant. But we will also wait and see what upstream says.

Changed in mutter (Ubuntu):
importance: Undecided → Low
status: Invalid → Opinion
Changed in mutter:
status: Unknown → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.