Undecorated windows have host decorations placed on them after maximize/unmaximize cycle

Reported by Jason 'vanRijn' Kasper on 2011-05-24
42
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Chromium Browser
Unknown
Unknown
Unity
Medium
Sam Spilsbury
chromium-browser (Ubuntu)
Medium
Sam Spilsbury
unity (Ubuntu)
Undecided
Unassigned

Bug Description

This problem affects VMware Unity (which uses undecorated host windows to render Virtual Machine guest windows as shown here: http://www.flickr.com/photos/chipx86/2384035553/), Google Chrome (as documented here: http://ubuntuforums.org/showthread.php?t=1742354 and according to the Chromium bug report here: http://code.google.com/p/chromium/issues/detail?id=80856), and other X applications who ask to not be decorated.

This can be easily reproduced with Ubuntu 11.04, running Unity mode (I'm running 3d currently), with Google Chrome:

1) Install Ubuntu 11.04, sign into Ubuntu Unity mode
2) Install and start Google Chrome. By default this comes up undecorated, though it can be set in Google Chrome's preferences
3) Maximize the Google Chrome window
4) Unmaximize the Google Chrome window
5) Observe that now Google Chrome is decorated, even though it was set to undecorated prior to the maximize/unmaximize cycle.

This also happens with our VMware Unity windows. We use gtk_window_set_decorated(false), which I believe uses _MOTIF_WM_HINTS behind the scenes for all of our windows. Here's what xprop -spy shows when our window comes up:

_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x3e, 0x0, 0x0, 0x0
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
WM_NORMAL_HINTS(WM_SIZE_HINTS):
  program specified location: 0, 0
  program specified minimum size: 0 by 0
  window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "Notepad.VMwareUnityWindow", "Notepad"

When the user maximizes the window in the guest, I see these property changes via xprop -spy:

_NET_WM_ICON_GEOMETRY(CARDINAL) = 9, 777, 48, 48
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x3e, 0x0, 0x0, 0x0

(note that we don't actually set _NET_WM_STATE_MAXIMIZED* on our window... that's set by Compiz). And this is what I see when the user unmaximizes the window:

_NET_WM_STATE(ATOM) =
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x3e, 0x1, 0x0, 0x0
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MOVE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_STICK, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_CLOSE, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_ABOVE, _NET_WM_ACTION_BELOW
_NET_FRAME_EXTENTS(CARDINAL) = 1, 1, 22, 1
_COMPIZ_WINDOW_DECOR_INPUT_FRAME(WINDOW): window id # 0x540102f
_COMPIZ_WINDOW_DECOR(INTEGER) = 20110130, 1, 33583828, 1, 1, 22, 1, 1, 1, 22, 1, 0, 0, 22, 1, 0, 0, 22, 1, 26, 0, 589925, -15, -32, -6, 0, 766, 32767, 0, 0, 524389, 751, -32, -6, 0, 32767, 32767, 766, 0, 590182, -6, -32, 17, 0, 23, 32767, 790, 0, 395413, -15, 0, 0, -222, 32767, 223, 1, 34, 264341, -15, 223, 0, -222, 32767, 32767, 224, 34, 395929, -15, -222, 0, 0, 32767, 222, 447, 34, 395430, 0, 0, 17, -222, 32767, 223, 1, 51, 264358, 0, 223, 17, -222, 32767, 32767, 224, 51, 395946, 0, -222, 17, 0, 32767, 222, 447, 51, 589993, -15, 0, -378, 21, 394, 32767, 0, 70, 524457, 379, 0, -378, 21, 32767, 32767, 394, 70, 590250, -378, 0, 17, 21, 395, 32767, 790, 70
_COMPIZ_WM_WINDOW_BLUR_DECOR(INTEGER) = 4, 0, 5, 4, -22, 6, -4, -21, 5, 2, -21, 6, -2, -20, 5, 1, -20, 6, -1, -19, 5, 0, -19, 6, 0, -17, 5, -1, -17, 6, 1, 0, 9, -1, 0, 10, 1, 1, 5, -1, 0, 9, 0, 0, 6, 0, 0, 10, 1, 0

So Ubuntu Unity seems to be changing _MOTIF_WM_HINTS on us and it shouldn't.

Related branches

lp:~unity-team/unity/unity.fix_787277
Rejected for merging into lp:unity
Alex Launi (community): Needs Fixing on 2011-06-06

Actually, http://code.google.com/p/chromium/issues/detail?id=75485 is the right bug that Google Chrome is trying to deal with for the same problem.

Bilal Akhtar (bilalakhtar) wrote :

As said on the upstream bug which you linked, its a Chromium bug and is being worked upon. Closing Unity bug task.

Changed in unity:
status: New → Invalid

Sorry, but I disagree, this isn't invalid and I'll explain why.

I talked with Sam Spilsbury a bunch the other day in #compiz-dev and he agreed that this is a bug in Ubuntu's Unity. There is a separate Chrome bug that they've fixed, but the underlying problem, which is the same problem that 's affecting VMware Workstation and Player (which is why I'm filing this bug) is that Ubuntu Unity does not honor gtk_window_set_decorated(false), which sets _MOTIF_WM_HINTS to 0, when it goes through a maximize/unmaximize cycle.

http://code.google.com/p/chromium/issues/detail?id=75485#c11 : "Only half of this bug is a problem in chrome. r83173 should take care of the display of our custom window buttons in fullscreen unity, and should opportunistically use some other unity features.

The double titlebar reported by fta in @4 appears to be a unity bug and is tracked here: https://bugs.launchpad.net/ubuntu/+source/unity/+bug/711567"

Also https://bugs.launchpad.net/ubuntu/+source/unity/+bug/711567/comments/5 : "The second part (unity "forgets" when a window has set gtk_window_set_decorated()) looks like a problem in unity and attempts at working around it in chromium haven't been successful. (I tried calling gtk_window_set_decorated(FALSE) when in the confused state and unity didn't respond.)"

So if you want to mark this a dupe of https://bugs.launchpad.net/ubuntu/+source/unity/+bug/711567 I guess that might make sense, but I think you're misunderstanding my bug to think it's invalid.

Changed in unity:
status: Invalid → New
Sam Spilsbury (smspillaz) wrote :

As discussed with Jason, this is a valid bug, I'll assign it to me for the next SRU. However, I'll be on study leave quite soon so I might not get to it on time

Changed in unity:
assignee: nobody → Sam "SmSpillaz" Spilsbury (smspillaz)
Changed in chromium-browser (Ubuntu):
assignee: nobody → Sam "SmSpillaz" Spilsbury (smspillaz)
Changed in unity:
milestone: none → 3.8.16
status: New → Confirmed
Changed in chromium-browser (Ubuntu):
status: New → Confirmed
Changed in unity:
importance: Undecided → Medium
Changed in chromium-browser (Ubuntu):
importance: Undecided → Medium
Didier Roche (didrocks) on 2011-05-30
Changed in unity (Ubuntu):
status: New → Confirmed
Changed in unity:
status: Confirmed → Fix Committed
status: Fix Committed → Confirmed
Sam Spilsbury (smspillaz) wrote :

SRU Test Case:

1) Open Chromium
2) Right click in the chrome area and uncheck "use system titlebar and borders"
3) Maximize it
4) Unmaximize it
5) Chromium should not have two decorations

ALSO

1) Open Chromium
2) Maximize it
3) Right click in the chrome area and uncheck "use system titlebar and borders" - there should be a window offset bug here, that's a separate issue which will be looked into. BUT
4) Unmaximize it
5) Chromium should have a system decoration

Jeroen Hoek (mail-jeroenhoek) wrote :

I ran into this bug as well, but didn't find this bug report upon filing it. I added a simply Python GTK (PyGTK) script to the duplicate bug which can be used to reproduce the issue for GTK applications:

https://bugs.launchpad.net/unity/+bug/796630

To reproduce:

1) Maximize
2) Unmaximize

David Barth (dbarth) wrote :

Hmm, actually there is a test script, so there is a good chance for the fix to be simple to make.

Changed in unity:
milestone: 3.8.16 → alpha2
milestone: alpha2 → 3.8.18
Changed in unity:
status: Confirmed → Fix Released
Changed in unity (Ubuntu):
status: Confirmed → Fix Released
Changed in chromium-browser (Ubuntu):
status: Confirmed → Fix Released

I think I'm still getting this issue with Google Chrome on Ubuntu 11.10...see attached screenshot. Chrome was maximized, then dragged down and to the side to fill half the screen.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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