After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 757689 - Application switcher stopped working
Application switcher stopped working
Status: RESOLVED DUPLICATE of bug 759658
Product: gnome-shell
Classification: Core
Component: app-switcher
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2015-11-06 15:15 UTC by Muflone
Modified: 2016-01-12 15:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Application start (4.22 KB, text/plain)
2015-11-06 15:16 UTC, Muflone
  Details
ALT+TAB (2.57 KB, text/plain)
2015-11-06 15:16 UTC, Muflone
  Details
shell-app: Ensure name is a valid utf8 string (851 bytes, patch)
2015-11-11 15:45 UTC, Rui Matos
none Details | Review
lookingGlass: Ensure the wm_class string is valid (1.40 KB, patch)
2015-11-11 15:45 UTC, Rui Matos
none Details | Review
Screenshot with the application icon (40.10 KB, image/png)
2015-11-16 09:42 UTC, Muflone
  Details

Description Muflone 2015-11-06 15:15:12 UTC
When using some applications, it happens mostly with Java applications like tn5250j, some keyboard shortcuts like ALT+TAB, ALT+SHIFT+TAB and some custom keybindings stop working.

In my installation (Arch Linux x86_64, kernel 4.2.5, gnome-shell 3.18.1-2) it's easy reproducible on the 50% of the times using tn5250j 0.7.6-1.
After closing the application the issue disappears.
Comment 1 Muflone 2015-11-06 15:16:04 UTC
Created attachment 314998 [details]
Application start

This is the system log when the application starts
Comment 2 Muflone 2015-11-06 15:16:51 UTC
Created attachment 314999 [details]
ALT+TAB

This is the system log when the ALT+TAB keys are pressed
Comment 3 Rui Matos 2015-11-11 15:45:23 UTC
Created attachment 315279 [details] [review]
shell-app: Ensure name is a valid utf8 string

Some clients put non-utf8 data on their WM_CLASS which makes gjs error
out. This handles that case a bit better.
Comment 4 Rui Matos 2015-11-11 15:45:30 UTC
Created attachment 315280 [details] [review]
lookingGlass: Ensure the wm_class string is valid

Some clients put non-utf8 data on their WM_CLASS which makes gjs error
out. This handles that case a bit better.
Comment 5 Rui Matos 2015-11-11 15:47:11 UTC
I think those handle all the cases where this might happen.

Muflone, just to be sure, can you post the output of 'xprop | grep WM_CLASS' on that window ?
Comment 6 Owen Taylor 2015-11-11 15:53:13 UTC
Review of attachment 315279 [details] [review]:

Mmm, example? It looks like shell_app_get_name() gets used in a fair number of places, and maybe it's worth trying a bit harder? WM_CLASS is defined to be STRING hence Latin-1.
Comment 7 Florian Müllner 2015-11-11 15:59:09 UTC
(In reply to Rui Matos from comment #5)
> I think those handle all the cases where this might happen.

Or maybe move UTF8 conversion into meta_window_get_wm_class() itself?
Comment 8 Rui Matos 2015-11-12 17:59:44 UTC
(In reply to Owen Taylor from comment #6)
> Review of attachment 315279 [details] [review] [review]:
> 
> Mmm, example?

I don't have an example, I just looked at the provided logs, that's why I asked the reporter to get us the xprop output.

> It looks like shell_app_get_name() gets used in a fair number
> of places, and maybe it's worth trying a bit harder? WM_CLASS is defined to
> be STRING hence Latin-1.

We could g_convert() the string. Do you prefer any of the alternatives below?

(In reply to Florian Müllner from comment #7)
> Or maybe move UTF8 conversion into meta_window_get_wm_class() itself?

Doesn't feel right to me to do it at that level since the limiting factor here is gjs, for mutter it doesn't really matter. But if you prefer that we can do it, sure, or perhaps add a meta_window_get_wm_class_utf8() ?
Comment 9 Owen Taylor 2015-11-12 19:21:05 UTC
(In reply to Rui Matos from comment #8)
> (In reply to Owen Taylor from comment #6)
> > Review of attachment 315279 [details] [review] [review] [review]:
> > 
> > Mmm, example?
> 
> I don't have an example, I just looked at the provided logs, that's why I
> asked the reporter to get us the xprop output.

Yeah - knowing what it is that is breaking things would be useful in figuring out what to do. Adding a bunch of g_convert() logic if Java is sticking random garbage into there (say) wouldn't be that useful.

> > It looks like shell_app_get_name() gets used in a fair number
> > of places, and maybe it's worth trying a bit harder? WM_CLASS is defined to
> > be STRING hence Latin-1.
> 
> We could g_convert() the string. Do you prefer any of the alternatives below?

If the contents are really non-ascii latin-1, g_convert() makes sense to me, since these strings can appear in the UI, and we shouldn't just say unknown ap.

> (In reply to Florian Müllner from comment #7)
> > Or maybe move UTF8 conversion into meta_window_get_wm_class() itself?
> 
> Doesn't feel right to me to do it at that level since the limiting factor
> here is gjs, for mutter it doesn't really matter. But if you prefer that we
> can do it, sure, or perhaps add a meta_window_get_wm_class_utf8() ?

I'd change meta_window_get_wm_class() (and get_wm_class_instance) - the fact that WM_CLASS is LATIN-1 should remain an internal detail of Mutter. Non-ascii WM_CLASS is so rare that there should be no compatibility concerns - especially since the only potentials users of this api we don't control are JS extensions.

[ More precisely, I'd change window->res_class and window->res_name, checking that that doesn't break anything ]
Comment 10 Muflone 2015-11-16 09:22:42 UTC
$ xprop | grep WM_CLASS
WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "org-tn5250j-My5250"
Comment 11 Muflone 2015-11-16 09:23:31 UTC
$ xprop
WM_STATE(WM_STATE):
		window state: Normal
		icon window: 0x0
_NET_WM_DESKTOP(CARDINAL) = 2
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MOVE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_CLOSE, _NET_WM_ACTION_ABOVE, _NET_WM_ACTION_BELOW
_NET_FRAME_EXTENTS(CARDINAL) = 0, 0, 37, 0
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x1, 0x0, 0x0
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT
WM_HINTS(WM_HINTS):
		Client accepts input or input focus: False
		Initial state is Normal State.
_NET_WM_ICON(CARDINAL) = 	Icon (16 x 16):
	          ░░▒▒▒ 
	      ░▒▒▒▒▒▒▒░▒
	 ░▒▒▒▓▒▒▒░░▒▒▒▒░
	▒▒▒▒░░░▒▒░░░▒▒▒░
	▒▒░▒▒▒    ░▒▒▒▒░
	▒░▒▒▒▒░▒▒▒▒░░░▒░
	▓░▓▒▒░░░░▒▒▓▓▓▒░
	▓░▒░░▒▒▒▒▒▓▓▓▒▒░
	▓░▓▒▒▒▒▓▒▒▒▒▒▒▓▒
	▓░▓▒▒▒▒▒▒▓▓▒▒▒▓▒
	▓░▓▒▒▓▒▒▒▒▒▒▓▓▓▒
	▓▒▓▒▒▒▒▒▓▓▒▒▒▒▓▒
	▓▒▓▓▓▒▒▒▒▓▓▓▓▓▒▒
	▓▒▓▒▒▓▓▓▓▒▒▒▒▒▒ 
	▒▒▓▓▓▒▒▒▒▒▒░    
	 ▒▒▒▒▒░░░       

	Icon (32 x 32):
	                         ░▒▓▓▒  
	                    ░▒▓▓▓▓▒▒▒▓░ 
	               ░▒▓▓▓▓▒▒▒▓▓▓▓▒▒▒▒
	          ░▒▒▓▓▓▓▒▒▓▓▓▓▒▒░     ▒
	      ░▒▓▓▓▓▒▒▒▓▓▓▒▒░░  ░░▒▒▒░ ▒
	  ▒▓▓▓▓▒▒▒▓▓▓▒▒░░  ░░▒▒▒▒▒▒▒▒▒░▒
	░▓▓▒▒▓▓▓▓▒░░  ░░▒▒▒▒▒▒░▒▒▒▒▒▒▒░▒
	▓▒▒▓▒▒░  ░░░▒▒▒▒▒░░    ░▒▒▒▒▒▒░▒
	▓▒▓░ ░░▒▒▒▒▒░░         ▒▒▒▒▒▓▒░▒
	▓▓▒ ░▒▓▒▒▒▒░       ░░▒▒▓▓▓▒▒▓▒░▒
	▓▓▒ ▒▒▒▒▒▒▒░  ░░▒▒▓▓▓▒▒░░   ▓▒░▒
	▓▓▒ ▓▒▒▒▒▓▓▒▒▓▓▓▓▒▒▒░   ░░▒▒▓▒░▒
	▓▓▒░▓▓▓▓▓▓▓▓▒▒░    ▒▒▒▒▓▓▓▓▓▓▒░▒
	▓▓▒░▓▓▓▒▒░░    ░▒▒▓▓▓▓▓▓▓▓▓▓▓▒░▒
	▓▓▒░▓▒    ░▒▒▓▒▒▒▒░▓▓▓▓▓▓▓▓▓▓▒░▒
	▓▓▒░▓▒▒▒▓▒▒▒▒░░▒▒▒▒▓▓▓▓▓▓▒▒▒▓▒░▒
	▓▓▒░▓▒▒▒░░░▒▒▒▒▓▓▓▓▓▓▒▒░░▒▒▒▓▒░▒
	▓▓▒░▓▒░▒▒▒▒▓▓▓▓▒▒▒▒▓▒░▒▒▒▒▓▓▓▒░▒
	▓▓▒░▓▓▓▓▓▓▒▒▒▒░░░▒▒▓▓▓▓▓▓▓▒▒▓▓░▒
	▓▓▒░▓▓▒▒▒░░░▒▒▒▒▓▓▓▓▓▒▒▒▒░▒▒▓▓░▒
	▓▓▒░▓▒░▒▒▒▒▓▓▓▓▓▓▒▒▓▒░░▒▒▒▓▓▓▓░▒
	▓▓▒░▓▓▓▓▓▓▓▓▒▒▒░░▒▒▓▓▒▓▓▓▓▓▓▓▓░▒
	▓▓▒░▓▓▓▒▒▒░░░▒▒▒▒▓▓▓▓▓▒▒▒▒▒▒▓▓░▒
	▓▓▒░▓▒░░░▒▒▒▓▓▓▓▓▓▒▓▒░░░▒▒▒▓▓▒░▒
	▓▓▒░▓▓▒▓▓▓▓▓▓▒▒▒▒▒▒▓▒▒▓▓▓▓▓▓▓▒░▒
	▓▓▒░▓▓▓▓▒▒▒░░▒▒▒▒▓▓▓▓▓▓▓▓▓▒▒▒░▒▒
	▓▓▒░▓▓░░░░▒▒▒▓▓▓▓▓▓▓▓▒▒░░░▒▒▒▒░ 
	▓▓▒░▓▓▒▒▓▓▓▓▓▓▓▓▒▒░░░▒▒▒▓▒▒░    
	▓▓▒░▓▓▓▓▓▓▓▓▒░░░▒▒▒▓▒▒░░░       
	░▓▒░▒▓▓▒▒░░▒▒▒▓▓▒▒░░░░░         
	  ▓░░░▒▒▒▒▒▒▒░░░░░░             
	  ░▒▒▒▒░░                       

	Icon (48 x 48):
	                                       ░▒▓▓▓    
	                                  ░▒▓▓▓▓▓▓▓▓▓   
	                             ░▒▓▓▓▓▓▓▒▒▒▒▒▒▓▓▒  
	                        ░░▒▓▓▓▓▓▓▒▒▒▒▒▓▓▓▓▓▒▒▒▓░
	                    ░▒▓▓▓▓▓▓▒▒▒▒▒▓▓▓▓▓▓▒░░    ░▓
	               ░▒▓▓▓▓▓▓▒▒▒▒▒▒▓▓▓▓▓▒▒░         ░▓
	          ░░▒▓▓▓▓▓▒▒▒▒▒▒▓▓▓▓▓▒▒░░    ░░░▒▒▒░  ░▓
	      ░▒▓▓▓▓▓▓▒▒▒▒▒▓▓▓▓▓▒▒░░     ░░▒▒▓▓▓▓▓▓▓░ ░▓
	   ▒▓▓▓▓▓▒▒▒▒▒▒▓▓▓▓▓▒░░     ░░▒▒▒▓▓▓▓▒▒▒▒▒▒▓▒░░▓
	 ▒▓▓▒▒▒▒▒▒▓▓▓▓▓▒▒░     ░░░▒▒▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▒░░▓
	▒▓▓▒▒▒▓▓▓▓▒▒░░     ░░▒▒▓▓▓▓▒▒▒░░   ▒▒▒▒▒▒▒▒▓▒░░▓
	▓▓▒▒▓▓▒░░     ░░▒▒▒▓▓▓▓▒▒░░        ▒▒▒▒▒▒▒▒▓▒░░▓
	▓▓▒▓▓░   ░░░▒▒▓▓▓▓▒▒▒░             ▒▒▒▒▒▒▒▒▓▒░░▓
	▓▓▓▓   ░▒▓▓▓▓▒▒▒▒░              ░░▒▒▒▒▒▒▓▓▓▓▒░░▓
	▓▓▓▒  ░▒▓▒▒▒▒▒▒▒▒░         ░░▒▒▒▒▒▓▓▓▓▓▓▒▒▓▓▒░░▓
	▓▓▓▒ ░▓▓▒▒▒▒▒▒▒▒▒░     ░░▒▒▓▓▓▓▓▓▓▓▒▒░    ▓▓▒░░▓
	▓▓▓▒ ░▓▓▒▒▒▒▒▒▒▒▒░░░▒▒▓▓▓▓▓▓▓▓▒▒░░      ░░▓▓▒░░▓
	▓▓▓▒ ░▓▓▒▒▒▒▓▓▒▓▓▓▓▓▓▓▓▓▓▒▒░░▓▒     ░▒▒▓▓▓▓▓▒░░▓
	▓▓▓▓ ░▓▓▒▓▓▓▓▓▓▓▓▓▓▓▒▒░░     ▓▒░▒▒▓▓▓▓▓▓▓▓▓▓▒░░▓
	▓▓▓▓ ░▓▓▓▓▓▓▓▓▓▓▒░░       ░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░▓
	▓▓▓▓ ░▓▓▓▓▓▒▒░       ░░▒▓▓▓▓▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░▓
	▓▓▓▓ ░▓▓▒       ░░▒▓▓▓▓▒▒▒▒░▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░▓
	▓▓▓▓░░▓▓░  ░░▒▓▓▓▓▒▒▒▒░░░░▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░▓
	▓▓▓▓░░▓▓▒▓▓▓▓▒▒▒▒░░░░░▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▒▒▒▒▒▓▓▒░░▓
	▓▓▓▓░░▓▓▓▒▒▒░░░░░░▒▒▒▒▒▒▓▓▓▓▓▓▓▓▒▒▒░░░░▒▒▒▓▓▒░░▓
	▓▓▓▓░░▓▓▒░░░░░▒▒▒▒▒▓▓▓▓▓▓▓▓▒▒▓▒░░░░░░▒▒▒▒▒▓▓▒░░▓
	▓▓▓▓░░▓▓▒░▒▒▒▒▓▓▓▓▓▓▓▓▒▒▒▒░░▒▓▒░░░▒▒▒▓▓▓▓▓▓▓▒░░▓
	▓▓▓▓░░▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒░░░░░▒▒▒▓▓▒▓▓▓▓▓▓▓▓▓▓▓▓▒░░▓
	▓▓▓▓░░▓▓▓▓▓▓▓▒▒▒░░░░░░▒▒▒▒▒▓▓▓▓▓▓▓▓▓▒▒▒▒░▒▓▓▒░░▓
	▓▓▓▓░░▓▓▓▒▒░░░░░░▒▒▒▒▒▓▓▓▓▓▓▓▓▓▒▒▒░░░░▒▒▒▒▓▓▒░░▓
	▓▓▓▓░░▓▓▒░░░░▒▒▒▒▓▓▓▓▓▓▓▓▓▓▒▒▓▒░░░░░▒▒▒▒▓▓▓▓▒░░▓
	▓▓▓▓░░▓▓▒▒▒▒▒▓▓▓▓▓▓▓▓▓▒▒▒░░░▒▓▒░░▒▒▒▓▓▓▓▓▓▓▓▒░░▓
	▓▓▓▓░░▓▓▓▓▓▓▓▓▓▓▓▒▒▒░░░░▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▒▒▓▓▒░░▓
	▓▓▓▓░░▓▓▓▓▓▓▒▒▒░░░░░▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▒▒▒░▒▒▓▓▒░▒▓
	▓▓▓▓░░▓▓▒▒░░░░░░░▒▒▒▒▓▓▓▓▓▓▓▓▓▓▒▒░░░░░▒▒▒▒▓▓▒░▒▓
	▓▓▓▓░░▓▓▒░░░░▒▒▒▓▓▓▓▓▓▓▓▓▓▒▒▒▓▒░░░░░▒▒▒▓▓▓▓▓▒░▒▓
	▓▓▓▓░░▓▓▒▒▒▓▓▓▓▓▓▓▓▓▓▒▒▒░░▒▒▒▓▒░▒▒▒▓▓▓▓▓▓▓▓▓░░▒▓
	▓▓▓▓░░▓▓▓▓▓▓▓▓▓▓▒▒▒░░░░▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░▒▒
	▓▓▓▓░░▓▓▓▓▓▒▒▒░░░░░▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░▒▓░
	▓▓▓▓░░▓▓▒░░░░░░░▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒░░░░░░▒▒▒▓▒░ 
	▓▓▓▓░░▓▓▒░░░▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░▒▒▓▓▓▒▒░    
	▓▓▓▓░░▓▓▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░▒▒▒▓▓▓▒░░        
	▓▓▓▓░░▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░░▒▒▓▓▓▒▒░░░░          
	▒▓▓▓░░▓▓▓▓▓▓▓▓▒▒░░░░░░▒▒▓▓▓▓▒▒░░░░░             
	 ▓▓▓░░░▒▒▒▒░░░░░░▒▒▒▓▓▓▒▒░░░░░░░                
	  ░▓░░░░░░░░▒▒▒▓▓▓▒▒░░░░░░░░                    
	   ▒▓▒░▒▒▒▓▓▓▒▒░░░░░░                           
	    ░▓▓▒▒░░                                     


_NET_WM_PID(CARDINAL) = 22072
WM_CLIENT_MACHINE(STRING) = "fabioedp"
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS
WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "org-tn5250j-My5250"
WM_CLIENT_LEADER(WINDOW): window id # 0x1c00008
_NET_WM_ICON_NAME(UTF8_STRING) = "tn5250j"
WM_ICON_NAME(STRING) = "tn5250j"
_NET_WM_NAME(UTF8_STRING) = "tn5250j"
WM_NAME(STRING) = "tn5250j"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		user specified location: 0, 27
		program specified location: 0, 27
		program specified size: 1680 by 986
		window gravity: NorthWest
Comment 12 Muflone 2015-11-16 09:25:24 UTC
The WM_CLASS seems clean to me:

$ xprop | grep WM_CLASS | hexdump -C
00000000  57 4d 5f 43 4c 41 53 53  28 53 54 52 49 4e 47 29  |WM_CLASS(STRING)|
00000010  20 3d 20 22 73 75 6e 2d  61 77 74 2d 58 31 31 2d  | = "sun-awt-X11-|
00000020  58 46 72 61 6d 65 50 65  65 72 22 2c 20 22 6f 72  |XFramePeer", "or|
00000030  67 2d 74 6e 35 32 35 30  6a 2d 4d 79 35 32 35 30  |g-tn5250j-My5250|
00000040  22 0a                                             |".|
00000042
Comment 13 Muflone 2015-11-16 09:42:43 UTC
Created attachment 315656 [details]
Screenshot with the application icon

In the application icon I can see (sometimes, 30% of the times I have the defect) a strange character, sometimes I can see garbage text, while xprop continues to show a clean WM_CLASS.

Could the application change its WM_CLASS after the startup?
Comment 14 Rui Matos 2015-11-20 14:53:37 UTC
Can you test if the patches fix the issue for you?
Comment 15 Muflone 2015-11-23 16:33:09 UTC
With the two patches the issue seems handled.

Now these weird windows appear with the "unknown" title but they are properly handled by the app switcher.
Comment 16 Rui Matos 2016-01-11 17:29:13 UTC
I think the patch in bug 759658 fixes the root issue. Can you confirm? Please remove the patches from this bug before applying the patch from the other one.
Comment 17 Rui Matos 2016-01-12 15:58:37 UTC
Ended up confirming this myself

*** This bug has been marked as a duplicate of bug 759658 ***