Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8153971

Desktop app started by ssh cannot use new Desktop API on Linux

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4
    • tbd
    • 9
    • client-libs
    • Ubuntu 15.10 Unity

    • b114
    • 9

    Description

      In JDK9 there is new desktop API such as java.awt.Taskbar. On Linux, its use is restricted at the moment by the Unity desktop only.

      Note that running a desktop-aware application over ssh doesn't allow it to use this new API properly.

      As an example compile and run the attached application on e.g. Ubuntu 15.10.
      It would be necessary perhaps to provide a .desktop file in $HOME/.local/share/applications/ and then run it using the same JDK as
      $JAVA_HOME/bin/java -Djava.desktop.appName=name-of-desktop-file UserAttentionTest
      For example, I have this .desktop file:

      [Desktop Entry]
      Name=UserAttentionTest
      Path=/export/Experim/AWT/Desktop
      Exec=/export/jdk9.ws/9.client/build/linux-x86_64-normal-server-fastdebug/images/jdk/bin/java -Djava.desktop.appName=UserAttentionTest.desktop UserAttentionTest
      Terminal=false
      Type=Application

      Starting and waiting a second, you would see a wobbling of an icon in a Launcher bar. Later, you may restore the application to the normal state from iconified and toggle that user attention state at will.

      Now issue 'xhost +' from a terminal and connect "ssh localhost". Set DISPLAY to :0.0 and run the application again.
      It would start, detect exactly the same set of supported features but won't work. Neither after a second nor on button push there will be user attention animation.

      This behavior is not restricted to java: a native application using Launcher API doesn't work just the same (tell me where I'm wrong)(an example UnityTest.cpp attached).

      People say it may be because Unix domain sockets are not available to the application running over ssh. OpenSSH v6.7 was reported (https://lwn.net/Articles/609321) to support socket forwarding but how to use it properly? Ubuntu 15.10 has v6.9.

      Attachments

        Activity

          People

            Unassigned Unassigned
            yan Yuri Nesterenko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: