You are not logged in.

#1 2017-03-30 17:15:07

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 355

Can't get keyboard focus when running remote X client w/ Mate Desktop

This has been a problem for a while.  I occasionally have need to remote into another linux machine in order to run graphical clients.  A good example is when I have to install Matlab on a headless server parked at the data center.  So, for example:

[cnsit@lizard ~]$ ssh -X pgoetz@lab69
lab69:~~$ matlab

The matlab screen appears on my local desktop and I can use the mouse with the application, but keyboard focus stays with the terminal I executed matlab from.

Any ideas?  I'm wondering if this is Wayland or XWayland related.  I don't have this problem when the desktop I'm executing commands from is one of the older Ubuntu 14.04 installs.

Googling proved futile; I think there are just too few people running remote X apps these days.

Offline

#2 2017-03-30 18:23:02

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,496

Re: Can't get keyboard focus when running remote X client w/ Mate Desktop

I'm wondering if this is Wayland or XWayland related.

Are you on gnome on wayland and does the problem exist on gnome on xorg?

Offline

#3 2017-03-30 19:39:49

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 355

Re: Can't get keyboard focus when running remote X client w/ Mate Desktop

seth wrote:

Are you on gnome on wayland and does the problem exist on gnome on xorg?

I'm running Mate 1.18.  However, should have checked this earlier.  I assumed that because wayland is installed on my system it's using xwayland, but a quick check of available packages indicates that xorg-server-xwayland is it's own thing while I'm still on xorg-server.

Offline

#4 2017-03-30 19:59:19

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,496

Re: Can't get keyboard focus when running remote X client w/ Mate Desktop

"loginctl session-status", but it will be xorg.
What's the output of "xprop" and "xwininfo" for the matlab window?

Offline

#5 2017-03-30 20:27:15

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 355

Re: Can't get keyboard focus when running remote X client w/ Mate Desktop

loginctl doesn't actually mention xorg:

[cnsit@lizard ~]$ loginctl session-status
c2 - cnsit (1000)
           Since: Wed 2017-03-29 14:57:23 CDT; 24h ago
          Leader: 856 (lightdm)
            Seat: seat0; vc7
         Display: :0
         Service: lightdm; type x11; class user
         Desktop: mate
           State: active
            Unit: session-c2.scope
                  ├─  856 lightdm --session-child 14 23
                  ├─  878 mate-session
                  ├─  906 /usr/lib/mate-settings-daemon/mate-settings-daemon
                  ├─  910 marco
                  ├─  914 mate-panel
                  ├─  930 caja
                  ├─  956 /usr/bin/python3 /usr/share/system-config-printer/applet.py
                  ├─  957 mate-volume-control-applet
                  ├─  958 /usr/lib/mate-polkit/polkit-mate-authentication-agent-1
                  ├─  959 mate-power-manager
                  ├─  961 mate-screensaver
                  ├─ 1048 mate-terminal
                  ├─ 1055 bash
                  ├─ 1062 bash
                  ├─ 1221 ssh pgoetz@lab37
                  ├─ 1224 /usr/lib/firefox/firefox
                  ├─ 1303 /usr/lib/firefox/plugin-container -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefo
                  ├─ 1427 bash
                  ├─ 1434 bash
                  ├─ 1441 bash
                  ├─ 1448 bash
                  ├─20389 /usr/lib/thunderbird/thunderbird
                  ├─20572 bash
                  ├─20579 bash
                  ├─20586 bash
                  ├─20609 /usr/lib/virtualbox/VirtualBox
                  ├─20629 /usr/lib/virtualbox/VBoxXPCOMIPCD
                  ├─20634 /usr/lib/virtualbox/VBoxSVC --auto-shutdown
                  ├─20670 /usr/lib/virtualbox/VirtualBox --comment Windows 8.1 cns-vm-pgoetz1 --startvm 8bb7be01-a8c4-4894-828a-07e422972c79 --no-startvm-error
                  ├─20721 bash
                  ├─20819 bash
                  ├─20822 ssh pgoetz@lab37
                  ├─20997 bash
                  ├─21602 ssh pgoetz@lab37
                  ├─21920 /usr/lib/libreoffice/program/oosplash --writer file:///tmp/mozilla_cnsit0/java.lua
                  ├─21947 /usr/lib/libreoffice/program/soffice.bin --writer file:///tmp/mozilla_cnsit0/java.lua
                  ├─21963 /usr/lib/libreoffice/program/oosplash --writer file:///tmp/mozilla_cnsit0/cuda.lua
                  ├─22269 ssh pgoetz@lakers.cm.utexas.edu
                  ├─22495 ssh pgoetz@lab37
                  ├─22576 loginctl session-status
                  └─22577 less

Mar 29 14:57:23 lizard systemd[1]: Started Session c2 of user cnsit.
Mar 29 14:57:24 lizard mate-session[878]: WARNING: Unable to find provider '' of required component 'dock'
Mar 29 15:01:37 lizard sudo[1875]: pam_unix(sudo:auth): authentication failure; logname= uid=1000 euid=0 tty=/dev/pts/3 ruser=cnsit rhost=  user=cnsit
Mar 29 15:01:41 lizard sudo[1875]:    cnsit : TTY=pts/3 ; PWD=/home/cnsit ; USER=root ; COMMAND=/bin/bash
Mar 29 15:01:41 lizard sudo[1875]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mar 30 10:05:49 lizard mate-screensaver-dialog[20368]: PAM unable to dlopen(/usr/lib/security/pam_gnome_keyring.so): /usr/lib/security/pam_gnome_keyring.so: ca
Mar 30 10:05:49 lizard mate-screensaver-dialog[20368]: PAM adding faulty module: /usr/lib/security/pam_gnome_keyring.so
Mar 30 14:42:40 lizard sudo[1875]: pam_unix(sudo:session): session closed for user root

I've never used xporop or xwininfo, but in any case here is the output:

[cnsit@lizard matlab]$ xprop
_NET_WM_ICON_GEOMETRY(CARDINAL) = 1238, 1176, 202, 24
XKLAVIER_STATE(INTEGER) = 0, -1589226240
WM_STATE(WM_STATE):
		window state: Normal
		icon window: 0x0
_NET_FRAME_EXTENTS(CARDINAL) = 6, 6, 27, 6
_NET_WM_DESKTOP(CARDINAL) = 1
_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_WM_VISIBLE_ICON_NAME(UTF8_STRING) = "MATLAB R2016a - academic use (on lab69)"
_NET_WM_VISIBLE_NAME(UTF8_STRING) = "MATLAB R2016a - academic use (on lab69)"
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x1, 0x1, 0x0, 0x0
_MOTIF_DRAG_RECEIVER_INFO(_MOTIF_DRAG_RECEIVER_INFO) = 0x6c, 0x0, 0x5, 0x0, 0x22, 0x0, 0xe0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0
XdndAware(ATOM) = BITMAP
_NET_WM_STATE(ATOM) = 
WM_HINTS(WM_HINTS):
		Client accepts input or input focus: False
		Initial state is Normal State.
_NET_WM_ICON(CARDINAL) = 	Icon (32 x 32):
	                                
	                     ░          
	                    ▒▒▒         
	                   ░▓▒░░        
	                   ▒▓░░▒        
	                  ░▓▓░ ▒░       
	                 ░▒▓▒░ ▒▒       
	                 ▒▒▓▒  ░▒░      
	                ▒▒▓▓▒░ ░▒▒      
	               ▒▒▒▓▓▒░ ░▒▒      
	            ░▒▒▒▒▓▓▒▒░ ░▒▒░     
	           ░▒▒▒▒▒▓▓▒▒░░░▒▒░     
	          ░▒▒▒▓▒▓▓▓▒▒░░░░▒▒     
	         ░▓▓▓▓▓▒▓▓▒▒░░░░░▒▒░    
	        ░▒▓▓▓▓▓▓▓▓▒▒░░░░░▒▒▒    
	      ░░░░▒▓▓▓▓▓▓▓▒▒░░░░░▒▒▒    
	   ░░░░░░░▒▒▒▓▓▓▓▒▒▒░░░░░▒▒▒░   
	 ░░░░░░░░░▒▒▒▓▓▓▓▒▒▒░░░░░░▒▒▒   
	 ░░░░░░░░░▒▒▒▓▓▓▒▒▒▒░░░░░░▒▒▒   
	  ░░░░░░░░▒▒▓▓▓▓▒▒▒▒░░░░░░▒▒▒░  
	    ░░░░░▒▒▓▓▓▓▒▒▒▒▒░░░░░░▒▒▒▒  
	     ░░░▒▒▓▓▓▓▒▒▒▒▒░░░░░░░░▒▒▒░ 
	       ░ ░▓▓▓▒▒▒▒▒▒░░░░     ░▒▒ 
	          ░▓▒▒▒▒▒▒░░░░       ░▒ 
	           ▒▒▒▒▒░░░░░         ░░
	            ▒░░░░░░░░           
	            ░░░░░░░░            
	             ░░░░░░             
	              ░░░░              
	              ░                 
	                                
	                                

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


_NET_WM_PID(CARDINAL) = 2745
WM_CLIENT_MACHINE(STRING) = "lab69"
WM_PROTOCOLS(ATOM): protocols  WM_TAKE_FOCUS, WM_DELETE_WINDOW
WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "MATLAB R2016a - academic use"
WM_CLIENT_LEADER(WINDOW): window id # 0x3e00021
_NET_WM_ICON_NAME(UTF8_STRING) = "MATLAB R2016a - academic use"
WM_ICON_NAME(STRING) = "MATLAB R2016a - academic use"
_NET_WM_NAME(UTF8_STRING) = "MATLAB R2016a - academic use"
WM_NAME(STRING) = "MATLAB R2016a - academic use"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		user specified location: 2075, 50
		program specified location: 2075, 50
		program specified size: 1524 by 966
		window gravity: NorthWest
[cnsit@lizard matlab]$ 
[cnsit@lizard matlab]$ xwininfo

xwininfo: Please select the window about which you
          would like information by clicking the
          mouse in that window.

xwininfo: Window id: 0x3e00022 "MATLAB R2016a - academic use"

  Absolute upper-left X:  2197
  Absolute upper-left Y:  69
  Relative upper-left X:  6
  Relative upper-left Y:  27
  Width: 1524
  Height: 966
  Depth: 24
  Visual: 0x21
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x20 (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:  +2197+69  -119+69  -119-165  +2197-165
  -geometry 1524x966+2191+42

[cnsit@lizard matlab]$ 

Offline

#6 2017-03-30 20:36:59

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,496

Re: Can't get keyboard focus when running remote X client w/ Mate Desktop

Client accepts input or input focus: False
...
WM_PROTOCOLS(ATOM): protocols  WM_TAKE_FOCUS ...

You probably don't have problems w/ a remote xterm, do you?

I'm not sure wheter the mate WM actually supports this ridiculous protocol and even if, either it or the client may be broken enough to "expect" a local (and more or less synchronous) connection.
Try some other WM (icewm/openbox/ ...) to see  whether it works there - maybe you can override the focus acceptance state with some rules in the mate WM (I've never used that desktop)

Offline

#7 2017-03-30 21:07:02

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 355

Re: Can't get keyboard focus when running remote X client w/ Mate Desktop

seth wrote:

You probably don't have problems w/ a remote xterm, do you?

Another oddity is that after I've tried a few X clients the ssh forwarding stops working:

lab69:~~$ xterm
xterm: Xt error: Can't open display: localhost:10.0

However, after logging out and back in with ssh -X, you are correct:  xterm does correctly grab the keyboard focus.  The window for the graphical form of emacs opens, but then core dumps as soon as I click with the mouse or type anything, and remote Mathematica gives a fairly descriptive reason for failing, likely fixed by installing the appropriate package:

Xlib:  extension "SHAPE" missing on display "localhost:10.0".
Xlib:  extension "SYNC" missing on display "localhost:10.0".
Xlib:  extension "MIT-SHM" missing on display "localhost:10.0".
Xlib:  extension "MIT-SHM" missing on display "localhost:10.0".
Xlib:  extension "MIT-SHM" missing on display "localhost:10.0".
Xlib:  extension "MIT-SHM" missing on display "localhost:10.0".
Xlib:  extension "MIT-SHM" missing on display "localhost:10.0".
Xlib:  extension "MIT-SHM" missing on display "localhost:10.0".
Xlib:  extension "MIT-SHM" missing on display "localhost:10.0".
Xlib:  extension "MIT-SHM" missing on display "localhost:10.0".
Xlib:  extension "MIT-SHM" missing on display "localhost:10.0".
Xlib:  extension "MIT-SHM" missing on display "localhost:10.0".
Xlib:  extension "SYNC" missing on display "localhost:10.0".

The weird thing is this all worked in gnome2, and Mate is ultimately an updated fork of gnome2.

Anyway, thanks for your help with this issue!  I learned something even if there wasn't a succinct solution allowing me to keep using my current WM.  Not sure if I should mark this as solved, as it appears to be unresolvable.

Last edited by pgoetz (2017-03-30 21:12:25)

Offline

#8 2017-03-31 06:44:37

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,496

Re: Can't get keyboard focus when running remote X client w/ Mate Desktop

SHM doesn't work on remote connections for principle reasons, not sure why SYNC and SHAPE are missing - is that a "real" xorg server or some nested server, virtual machine or something dated?
The (usage of the) broken WM_TAKE_FOCUS protocol is not "unresolvable" but simply a bug on some side - if you can determine which that is, you can file a bug report upstream.

Offline

#9 2017-03-31 13:33:49

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 355

Re: Can't get keyboard focus when running remote X client w/ Mate Desktop

seth wrote:

is that a "real" xorg server or some nested server, virtual machine or something dated?

I'm running this:

[cnsit@lizard matlab]$ pacman -Q | grep xorg
xorg-bdftopcf 1.0.5-1
xorg-font-util 1.3.1-1
xorg-font-utils 7.6-4
xorg-fonts-alias 1.0.3-1
xorg-fonts-encodings 1.0.4-4
xorg-fonts-misc 1.0.3-5
xorg-mkfontdir 1.0.7-8
xorg-mkfontscale 1.1.2-1
xorg-server 1.19.3-1
xorg-server-common 1.19.3-1
xorg-setxkbmap 1.3.1-1
xorg-xauth 1.0.10-1
xorg-xinit 1.3.4-4
xorg-xkbcomp 1.3.1-1
xorg-xmodmap 1.0.9-1
xorg-xprop 1.2.2-1
xorg-xrdb 1.1.0-2
xorg-xset 1.2.3-1
xorg-xwininfo 1.1.3-1
[cnsit@lizard matlab]$ 

on bare metal, so I think the answer is yes; it's a real xorg server.  Sadly, the problem with the WM_TAKE_FOCUS protocol problem is that -- with Wayland this close -- it's seems increasingly likely people are not going to be very interested in fixing X windows bugs.

Offline

Board footer

Powered by FluxBB