Project

General

Profile

Actions

Bug #5103

closed

GNOME session loses window-switching with mouse and keyboard

Added by Jim Klimov over 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Desktop (JDS)
Target version:
-
Start date:
2014-08-18
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

Every once in a while I lose the ability to switch X11 windows, including the use of X11 desktop (context menus) and GNOME panels. There is no real pattern to this - might happen in the middle of my work, or after some delay (initially I thought it might be an issue with xscreensaver kicking in, but the problem happens even with the screensaver daemon killed).

Issue was discovered and remains annoying with OI/Hipster running as a VirtualBox VM with seamless windows under a Windows 7 host system. This also happens with non-seamless window mode.

I can't test on a baremetal OI system at the moment, but research has shown that similar problems exist in bare-metal Linux systems as well, and are possibly a bug in metacity window manager and/or DBus. Given the virtualization in my case and timestamp issues reported below, some flakiness in the clock readings (which itself may be a hypervisor issue or an illumos issue) may also be a root cause.

Sometimes it helps to kill (from shell) some random window, which is what I did initially to "solve" the issue without restarting all of X. It is not a foolproof solution since sometimes I do need those windows, and sometimes the session does not unfreeze even with no more terminals/firefoxes/netbeans left alive.

A better workaround is to press Win+R while switched to the OI window (of the host system) to run an OI program-starter popup. This allows me to invoke a script that restarts metacity, which usually helps (may take 2-3 attempts though), although sometimes it stays dead and the X-windows remain unswitchable, so I have to "svcadm restart gdm" from an SSH prompt.

Invokation from Win+R is:
xterm -e "/bin/metacity-restart; sleep 15"

The script is thus:
$ cat /bin/metacity-restart

########################
#!/bin/bash

[ x"$DISPLAY" = x ] && echo "No DISPLAY set" >&2 && exit 1
MCPID="`ps -ef | grep -v grep | grep metacity | grep -v metacity-restart | awk '{print $2}'`"
echo "=== Metacity PID: $MCPID"
[ x"$MCPID" = x ] && exit 1
kill $MCPID
( cd /tmp && nohup metacity ) &
sleep 3 ########################

It also leaves a trace conveniently to see what was botched in metacity's lifetime. In the next post I'll add such an excerpt...

My original plan of using X applications "natively" and in a convenient manner becomes compromised with the need to restart the X server every so often ;(

Actions #1

Updated by Jim Klimov over 7 years ago

The metacity trace with possible pointers to the issue causes is below:

Window manager warning: Invalid WM_TRANSIENT_FOR window 0x3e00028 specified for 0x3e0d413 ( ).
Window manager warning: Received request to set _NET_FRAME_EXTENTS on 0x3e03e51 which is on a screen we are not managing
Window manager warning: CurrentTime used to choose focus window; focus window may not be correct.
Window manager warning: Got a request to focus the no_focus_window with a timestamp of 0. This shouldn't happen!
Window manager error: Unable to open X display 0:0
Window manager warning: CurrentTime used to choose focus window; focus window may not be correct.
Window manager warning: Got a request to focus 0x1000103 (Terminal) with a timestamp of 0. This shouldn't happen!
Window manager warning: CurrentTime used to choose focus window; focus window may not be correct.
Window manager warning: Got a request to focus the no_focus_window with a timestamp of 0. This shouldn't happen!
Window manager warning: Log level 8: gdk_window_get_events: assertion `GDK_IS_WINDOW (window)' failed
Window manager warning: Log level 8: g_object_ref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: g_object_unref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: gdk_window_get_events: assertion `GDK_IS_WINDOW (window)' failed
Window manager warning: Log level 8: g_object_ref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: g_object_unref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: gdk_window_get_events: assertion `GDK_IS_WINDOW (window)' failed
Window manager warning: Log level 8: g_object_ref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: g_object_unref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: gdk_window_get_events: assertion `GDK_IS_WINDOW (window)' failed
Window manager warning: Log level 8: g_object_ref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: g_object_unref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: gdk_window_get_events: assertion `GDK_IS_WINDOW (window)' failed
Window manager warning: Log level 8: g_object_ref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: g_object_unref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: gdk_window_get_events: assertion `GDK_IS_WINDOW (window)' failed
Window manager warning: Log level 8: g_object_ref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: g_object_unref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: gdk_window_get_events: assertion `GDK_IS_WINDOW (window)' failed
Window manager warning: Log level 8: g_object_ref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: g_object_unref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: CurrentTime used to choose focus window; focus window may not be correct.
Window manager warning: CurrentTime used to choose focus window; focus window may not be correct.
Window manager warning: Got a request to focus the no_focus_window with a timestamp of 0. This shouldn't happen!

In some lifetimes only the last line or two are present in the log file, so probably they are the issue (if at all related):

  1. cat /tmp/nohup.out
    Window manager warning: CurrentTime used to choose focus window; focus window may not be correct.
    Window manager warning: Got a request to focus the no_focus_window with a timestamp of 0. This shouldn't happen!
Actions #2

Updated by Jim Klimov over 7 years ago

I should also note that I saw no reliable way to reproduce the problem - sometimes I have it every few minutes, sometimes a whole day passes trouble-free. While this may have to do with CPU and/or graphics workload, I can't ascertain anything on that yet. Generally the system is not overly occupied, and there is ample RAM (16GB physical on the host laptop, 8GB for the VM) as well as quick SSD storage. Host CPU is also not overwhelmed (most of the time).

For those who have a similar issue and want to set up a quick test, to avoid the "complexity" of my workaround before you are sure that you too need it, you might just fire up an xterm, kill and start metacity as the current desktop user as a pre-emptive strike, and leave that terminal running in the (bottom) corner to watch the window manager's logs. In my case, the WM "freezes" usually correlate with the last message above.
If this issue is yours too, please make a note about your environment here. In the meanwhile, set up the Win+R solution (the program launcher conveniently remembers its history, so restarting metacity becomes a breeze ;) )

Actions #3

Updated by Ken Mays about 7 years ago

  • Status changed from New to Closed
  • Assignee changed from Milan Jurik to Ken Mays
  • % Done changed from 0 to 100

Commited updates to resolve issues with metacity and GTK.

Actions

Also available in: Atom PDF