<AWT Dev> Review-request for 8143227: Platform-Specific Desktop Features

Yuri Nesterenko yuri.nesterenko at oracle.com
Mon Nov 23 16:01:44 UTC 2015


Hi Alexander!

On 11/20/2015 07:34 PM, Alexander Zvegintsev wrote:
> Hello Yuri,
>
> Thanks for you testing!
>> If I start the application from dash, I have  progress reported and the
>> menu on the right click. I _don't have_, however, application menu
>> ("File" etc.).
> By etc.  menu did you mean a global menu[0] (which may be implemented by
> Desktop.setMenuBar() later)
> or a Taskbar.setMenu()[1]?

Oops, sorry, I see that APP_MENU_BAR is not supported.
What's plans about it, by the way?

>> Note that if I start it from a command line, the behavior is different:
>> the list of reported actions/features is the same but
>> progress doesn't work at all.
> For Taskbar we are reporting progress as supported If we successfully
> load libunity and all its required functions.
> When some of these supported features doesn't work it means that unity
> does not bind .desktop  and your
> app for some reason (or you have libunity.so and running KDE :))
In this case it wouldn't work from dash, would it:-)?
Sure I start it on the same Unity desktop from
gnome terminal by
java -Djava.desktop.appName=JavaTestApp.desktop Snip
(I call it JavaTestApp).

>
>> Also, try to start the application twice:
>> the taskbar menu will be distorted (there always will be
>> 2 garbage lines),
>> I guess it should be fixed someway.
> I'll take a look at this at your machine later, since I cannot reproduce
> it.
Yes, please, drop by: I cannot make a screenshot since the menu
is modal and PrtScreen doesn't work.

Thanks,
-yan
>
>
> [0]
> http://cloud.addictivetips.com/wp-content/uploads/2011/10/Global-Menu.jpg
> [1]
> https://wiki.ubuntu.com/Unity/LauncherAPI?action=AttachFile&do=get&target=quicklilst-static-entry.png
>
>
> --
> Thanks,
> Alexander.
>
> On 11/20/2015 05:36 PM, Yuri Nesterenko wrote:
>> Hi Alexander,
>>
>> On 11/19/2015 06:23 PM, Alexander Zvegintsev wrote:
>>> Hi Yuri,
>>>
>>> Nice catch! Just tested on Ubuntu 14.04.3, it does not have libunity.so
>>> symlink to libuity.so.9.
>>> so we should try to load version 9 instead of 0 in awt_Taskbar.c:
>>> -#define UNITY_LIB_VERSIONED VERSIONED_JNI_LIB_NAME("unity", "0")
>>> +#define UNITY_LIB_VERSIONED VERSIONED_JNI_LIB_NAME("unity", "9")
>>
>> Rebuilt and tried.
>> If you are interested, look at the screenshot of the Snip
>> application in http://cr.openjdk.java.net/~yan/8143227/Snip1.png
>> It was started from dash.
>>
>> If I start the application from dash, I have  progress reported and the
>> menu on the right click. I _don't have_, however, application menu
>> ("File" etc.).
>>
>> Note that if I start it from a command line, the behavior is different:
>> the list of reported actions/features is the same but
>> progress doesn't work at all.
>>
>> Also, try to start the application twice:
>> the taskbar menu will be distorted (there always will be
>> 2 garbage lines),
>> I guess it should be fixed someway.
>>
>> If I start the application from a command line in a remote session,
>> the list of taskbar options will be the same but
>> neither taskbar menu nor progress will work.
>>
>>>
>>> Updated in place.
>>>
>>> Browse action works fine for me on mine Ubuntu 14.04.3. Supported
>>> actions fills dynamically
>>> in gtk2_interface.c  update_supported_actions()[0]. So probably you are
>>> running 32 bit JDK on 64 bit
>>> Ubuntu and there are some missing libraries.
>> Well, I build it on another 14.04 machine but both of them are x64,
>> and the build is default, x64 too.
>> Actually I have mail and browse actions available if the session is
>> local which sure is right.
>>
>> Thank you!
>> -yan
>>>
>>> [0]
>>> http://hg.openjdk.java.net/jdk9/client/jdk/file/e8e7a00c1bff/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c#l478
>>>
>>>
>>>
>>> Thanks,
>>>
>>> Alexander.
>>>
>>> On 11/19/2015 05:41 PM, Yuri Nesterenko wrote:
>>>> Hi Alexander,
>>>>
>>>> I tried it with Ubuntu 14.04.3, and it started indeed
>>>> from dash or a command line as a gray rectangle. Once I added
>>>> isSupported() for every Action and separately for the Taskbar,
>>>> it reported, just like jdk9b91, that only OPEN was supported
>>>> and nothing else.
>>>> Is it OK?
>>>>
>>>> dconf editor in com/canonical/unity/launcher reports
>>>> firefox as, I presume, a default browser, but I don't see
>>>> BROWSE supported.
>>>>
>>>>
>>>> Thanks,
>>>> -yan
>>>>
>>>> On 11/18/2015 05:01 PM, Alexander Zvegintsev wrote:
>>>>> Hi Alexander,
>>>>>
>>>>> resending the same webrev under the new ID
>>>>> https://bugs.openjdk.java.net/browse/JDK-8143227
>>>>> http://cr.openjdk.java.net/~azvegint/jdk/9/8143227/00/
>>>>>
>>>>> The approach is pretty the same as it was in Desktop before:
>>>>> Check feature with isSupported() call.
>>>>> http://cr.openjdk.java.net/~azvegint/jdk/9/8143227/Snip.java
>>>>>
>>>>> For testing it on Ubuntu you should create a .desktop file e.g.:
>>>>> ~/.local/share/applications/SomeApp.desktop
>>>>>
>>>>> [Desktop Entry]
>>>>> Name=SomeApp
>>>>> Path=/path/to/your/directory/with/Snip
>>>>> Exec=/path/to/jdk9/java -Djava.desktop.appName=SomeApp.desktop -jar
>>>>> Snip.jar
>>>>> #or Exec=/path/to/jdk9/java -Djava.desktop.appName=SomeApp.desktop
>>>>> Snip
>>>>> Terminal=false
>>>>> Type=Application
>>>>>
>>>>> After that you can run it from dash with specified name.
>>>>>
>>>>> --
>>>>> Thanks,
>>>>> Alexander.
>>>>>
>>>>> On 11/18/2015 02:52 PM, Alexander Scherbatiy wrote:
>>>>>> On 11/18/2015 10:12 AM, Alexander Zvegintsev wrote:
>>>>>>> Hello
>>>>>>>
>>>>>>> please review the fix
>>>>>>> http://cr.openjdk.java.net/~azvegint/jdk/9/8048731/
>>>>>>> for
>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8048731
>>>>>>>
>>>>>>> This fix provides public support Mac OS X
>>>>>>> features(com.apple.{eawt,eio}), adds support for various desktop
>>>>>>> features such as progress indication, dock overlays, dock menus,
>>>>>>> etc.
>>>>>>> This is done by extending java.awt.Desktop and adding
>>>>>>> java.awt.Taskbar classes
>>>>>>
>>>>>>    Could you provide some code snippets which illustrate how the
>>>>>> introduced API should be used?
>>>>>>
>>>>>>   Thanks,
>>>>>>   Alexandr.
>>>>>>>
>>>>>>> Linux support is limited by Unity, however this is not the only
>>>>>>> limitation :) An app should be run via
>>>>>>> AppName.desktop file [0] with specified system property
>>>>>>> -Djava.desktop.appName=AppName.desktop
>>>>>>>
>>>>>>> [0] https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>



More information about the awt-dev mailing list