X11 windows don't get keyboard focus

Discussion in 'macOS' started by mnorth, Oct 28, 2008.

  1. mnorth macrumors newbie

    Joined:
    Jul 25, 2008
    #1
    When I SSH to a linux server, and try to open up an xterm, for example, I can't type anything in the xterm window. I've tried clicking on the window, keeping the cursor over the window while typing, trying to alt-tab to the xterm (it doesn't show up in the alt-tab application list), and nothing seems to work.

    Anyone have an idea of what's going on?
     
  2. ScoobyMcDoo macrumors 65816

    Joined:
    Nov 26, 2007
    Location:
    Austin, TX
    #2
    What is the complete ssh command-line you are using?

    I use:

    ssh -X -C <username@hostname>

    and all works fine. You probably will want to eliminate the -C if you are doing this over a lan - that's the command I use to ssh from my house to my office.
     
  3. mnorth thread starter macrumors newbie

    Joined:
    Jul 25, 2008
    #3

    Code:
    ssh -X user@host
    ....log in.....
    xterm &
    
    I'm connecting to my server via SSH correctly, because I am able to get an xterm window to pop up on my mac. This also indicates that the DISPLAY variable is being set up correctly. The problem is, I can't type anything in the window.

    The strange thing is, mouse input seems to be working fine (i.e., if I open up an emacs, I can use the file menu).
     
  4. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #4
    Sounds more like a problem with Linux side than the Mac side.
    What is your default shell on the Linux side?
    What is the DISPLAY variable set to?
    What are the default args when one uses xterm?
    What SSH Protocol are you using?
     
  5. mnorth thread starter macrumors newbie

    Joined:
    Jul 25, 2008
    #5
    tcsh
    <the IP of my powerbook>:1
    Like I said, the window pops up, I just can't type in it. This makes me think that X11 tunneling through SSH is working.
    it's not just xterm, it's any X11 program I use on my mac. I have tried xclock, emacs, xemacs, gnome-terminal and xterm.
    I'm not sure what you're asking. I'm using SSH, which is a protocol.

    I just tried something else:

    I ran
    Code:
    /Applications/Utilities/X11.app/Contents/MacOS/X11
    from my mac's command line, which creates an xterm LOCALLY (i.e., the program /usr/X11/bin/xterm on my mac).

    I see the same behavior. I can't type anything in the X11 window. Therefore, it must be something in OS X, not on my linux machine.
     
  6. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #6
    Just to be sure, "X11Forwarding" is set to 'yes' on the Linux box, right?

    Hmm.. is this Linux box slow to respond? A lot of router hops between you and it?

    And what happens with xclock? Nothing is displayed in the window?

    Actually, it's just a program. There are 2 protocol versions. You should see what version your Linux box is using. You can try forcing it to use protocol version 2 from your Mac with:

    ssh -X2 username@whatever

    You could also use some v flags to kick in verbose mode to see if it helps lead you to a cure.

    Ah, no.. xterm is in /usr/X11/bin/xterm (or, if pre-Leopard, /usr/X11R6/bin/xterm)
     
  7. mnorth thread starter macrumors newbie

    Joined:
    Jul 25, 2008
    #7
    Well I bought this computer in Jan of 2006 (1.67ghz powerbook g4), and I think OS 10.4.3 was the most recent OS at that time. I installed X11 at that time from my 10.4.3 install cd.

    Since then I have bought leopard, and have installed the optional X11 tools included on the 10.5 install CD.
    Code:
    Ah, no.. xterm is in [b]/usr/X11/bin/xterm[/b] (or, if pre-Leopard, /usr/X11R6/bin/xterm)
    
    Seems to agree with what I wrote above. Maybe I'm missing something.


    Here's what I get when I try to run my LOCAL xclock (/usr/X11/bin/xclock)
    Code:
    Macintosh:~ mnorth$ /Applications/Utilities/X11.app/Contents/MacOS/X11 /usr/X11/bin/xclock 
    X11.app: main(): argc=2
    	argv[0] = /Applications/Utilities/X11.app/Contents/MacOS/X11
    	argv[1] = /usr/X11/bin/xclock
    X11.app: Could not connect to server (DISPLAY="/tmp/launch-IKdWWz/:0", unsetting).  Starting X server.
    X11.app: Launching /usr/X11/bin/startx:
    	argv[0] = /usr/bin/login
    	argv[1] = -fp
    	argv[2] = mnorth
    	argv[3] = /bin/sh
    	argv[4] = -c
    	argv[5] = /usr/X11/bin/startx
    Last login: Tue Oct 28 13:06:15 on ttys000
    font_cache: Scanning user font directories to generate X11 font caches
    font_cache: Updating FC cache
    xauth:  creating new authority file /Users/mnorth/.serverauth.506
    xinit: Detected Xquartz startup, setting CFProcessPath=/Applications/Utilities/X11.app/Contents/MacOS/X11
    
    X11.app starting:
    Xquartz server based on X.org Release 7.2, built on 2007924
    Check-in failed: Permission denied
    font_cache: Done
    
     
  8. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #8
    Looks like you're doing this from inside Terminal.app?

    Just open the X11 app and then type in xclock. Does it open properly?
     
  9. mnorth thread starter macrumors newbie

    Joined:
    Jul 25, 2008
    #9
    When I execute X11.app via double click, it doesn't open properly.

    I'm downloading a new XQuartz package, to see if that fixes my problem.
     
  10. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
  11. mnorth thread starter macrumors newbie

    Joined:
    Jul 25, 2008
    #11
  12. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #12
    Weeeellll... my X11 runs fine and I haven't updated it. Dunno what to say there. So, it's sorted for you now, or still downloading?
     

    Attached Files:

    • X11.jpg
      X11.jpg
      File size:
      47.4 KB
      Views:
      74
  13. mnorth thread starter macrumors newbie

    Joined:
    Jul 25, 2008
    #13
    My Xquartz was built on 9-24-2007, so it looks like mine is a little older than yours. Anywho, still downloading, and I appreciate the help.

    EDIT:

    It worked, and it's a documented issue (via the discussions.apple.com link I posted above). Thanks again.
     
  14. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #14
    Ah, unless you specifically selected X11 as an optional install in the Leopard installation process, that's probably the old version from Tiger, which (IIRC) doesn't work worth a **** with Leopard.

    Glad you've got it working!
     

Share This Page