GNOME Bugzilla – Bug 757689
Application switcher stopped working
Last modified: 2016-01-12 15:58:37 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.
Created attachment 314998 [details] Application start This is the system log when the application starts
Created attachment 314999 [details] ALT+TAB This is the system log when the ALT+TAB keys are pressed
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.
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.
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 ?
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.
(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?
(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() ?
(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 ]
$ xprop | grep WM_CLASS WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "org-tn5250j-My5250"
$ 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
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
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?
Can you test if the patches fix the issue for you?
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.
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.
Ended up confirming this myself *** This bug has been marked as a duplicate of bug 759658 ***