Re: Support for GTK 2 & 3 now in JFX

2016-05-18 Thread Erik De Rijcke
Hi,

I tried using the gtk3 broadway backend. This results in a segfault.

Current thread (0x7fe8cc0c2000):  JavaThread "GtkNativeMainLoopThread"
[_thread_in_native, id=21171, stack(0x7fe8abcad000,0x7fe8abdae000)]

Stack: [0x7fe8abcad000,0x7fe8abdae000],  sp=0x7fe8abdac1c0,
 free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native
code)
C  [libX11.so.6+0x2d32a]  XInternAtom+0x2a

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j
 
com.sun.glass.ui.gtk.GtkApplication.staticScreen_getScreens()[Lcom/sun/glass/ui/Screen;+0
j  com.sun.glass.ui.Screen.initScreens()V+6
j  com.sun.glass.ui.Application.lambda$run$1(Ljava/lang/Runnable;)V+0
j  com.sun.glass.ui.Application$$Lambda$44.run()V+4
v  ~StubRoutines::call_stub
j  com.sun.glass.ui.gtk.GtkApplication._runLoop(Ljava/lang/Runnable;Z)V+0
j
 com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$8(Ljava/lang/Runnable;Z)V+7
j  com.sun.glass.ui.gtk.GtkApplication$$Lambda$48.run()V+12
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

It looks like there are still some hard dependencies on X which will
obviously not work using a non X gtk back-end. (I verified the broadway
backend works by running the gtk3-demo app in my browser first).

On Wed, May 18, 2016 at 3:06 AM, Jim Graham  wrote:

> Hi Erik,
>
> I tried testing our build under a Gentoo LiveCD.  Even the minimal
> environment of the LiveCD has the org.gnome.desktop.interface schema
> defined so I'm not sure how minimal your environment was.  I did discover
> that, although the schema was there, it had a value of "0" for the
> scaling-factor which caused us to create bogus logical screen sizes that
> probably caused the exception you saw, so simply finding that schema and
> key is not enough for us to trust the value.  I'll add some protection for
> bad data from the key, but I'm curious to find out how minimal your install
> was and whether we should simply state our dependency, or if your
> configuration is likely to be common enough that we should protect against
> it in our code...?
>
> Also, what does:
>
> % gsettings get org.gnome.desktop.interface scaling-factor
>
> return for your system?  If you set it to "1", does FX come up fine?
>
> ...jim
>
>
> On 05/16/2016 01:01 PM, Jim Graham wrote:
>
>> These may both be related to the HiDPI fix instead.  I added a usage of
>> g_settings in that fix that went in on Friday.  It looks like I'll have
>> to check for the schema existing before I access it.
>>
>> Can you file a bug report?
>>
>> (On a side note, the call that grabs the schema does not have a "schema
>> not known" return value - if you ask for a schema that doesn't exist
>> they abort your application.  Seems kind of drastic, but the bug reports
>> that request that they simply return null were met with push back
>> because the developers couldn't imagine why anyone would want such a
>> thing (huh?) and later an attempt to return NULL on unrecognized schemas
>> and keys had to be backed out because of the huge disaster the NULL
>> values caused (and somehow ABORT'ing on behalf of the application is
>> better in that case?).  Unfortunately I don't see much sanity in those
>> APIs or any support for a case like this of "I'd like to get that value,
>> but if you haven't heard of it, that's fine as I have a backup plan".
>> The only way around this will be to enumerate all schemas and all keys
>> and see if the ones we want are found in the list - a rather extreme
>> workaround for bad error handling behavior in their APIs...)
>>
>>  ...jim
>>
>> On 05/16/2016 05:15 AM, Erik De Rijcke wrote:
>>
>>> I ran into several issues, however I'm not sure they are related to gtk3
>>>
>>> first of all it seems there is a dependency on:
>>> gsettings-desktop-schemas.
>>> I'm not sure how desirable this is (I did not have it installed,
>>> installing
>>> it fixed the error but I can image people not wanting to install it?)
>>>
>>> Second, and this seems unrelated to gtk(3?), the screen initialization
>>> fails (test was done using gentoo linux on virtualbox with windows 7 as
>>> host):
>>>
>>> Exception in thread "JavaFX Application Thread"
>>> java.lang.IllegalArgumentException: Both width and height must be >= 0
>>>
>>> at javafx.geometry.Rectangle2D.(Rectangle2D.java:104)
>>> at javafx.stage.Screen.nativeToScreen(Screen.java:152)
>>> at javafx.stage.Screen.updateConfiguration(Screen.java:88)
>>> at javafx.stage.Screen.checkDirty(Screen.java:82)
>>> at javafx.stage.Screen.getPrimary(Screen.java:185)
>>> at
>>>
>>> com.sun.javafx.tk.quantum.QuantumToolkit.initSceneGraph(QuantumToolkit.java:298)
>>>
>>> at
>>>
>>> com.sun.javafx.tk.quantum.QuantumToolkit.runToolkit(QuantumToolkit.java:340)
>>>
>>> at
>>>
>>> com.sun.javafx.tk.quantum.QuantumToolkit.lambda$startup$10(QuantumToolkit.java:257)
>>>
>>> at com.sun.glass.ui.Application.lambda$run$1(Application.java:155)
>>> at 

Re: Support for GTK 2 & 3 now in JFX

2016-05-17 Thread Jim Graham

Hi Erik,

I tried testing our build under a Gentoo LiveCD.  Even the minimal 
environment of the LiveCD has the org.gnome.desktop.interface schema 
defined so I'm not sure how minimal your environment was.  I did 
discover that, although the schema was there, it had a value of "0" for 
the scaling-factor which caused us to create bogus logical screen sizes 
that probably caused the exception you saw, so simply finding that 
schema and key is not enough for us to trust the value.  I'll add some 
protection for bad data from the key, but I'm curious to find out how 
minimal your install was and whether we should simply state our 
dependency, or if your configuration is likely to be common enough that 
we should protect against it in our code...?


Also, what does:

% gsettings get org.gnome.desktop.interface scaling-factor

return for your system?  If you set it to "1", does FX come up fine?

...jim

On 05/16/2016 01:01 PM, Jim Graham wrote:

These may both be related to the HiDPI fix instead.  I added a usage of
g_settings in that fix that went in on Friday.  It looks like I'll have
to check for the schema existing before I access it.

Can you file a bug report?

(On a side note, the call that grabs the schema does not have a "schema
not known" return value - if you ask for a schema that doesn't exist
they abort your application.  Seems kind of drastic, but the bug reports
that request that they simply return null were met with push back
because the developers couldn't imagine why anyone would want such a
thing (huh?) and later an attempt to return NULL on unrecognized schemas
and keys had to be backed out because of the huge disaster the NULL
values caused (and somehow ABORT'ing on behalf of the application is
better in that case?).  Unfortunately I don't see much sanity in those
APIs or any support for a case like this of "I'd like to get that value,
but if you haven't heard of it, that's fine as I have a backup plan".
The only way around this will be to enumerate all schemas and all keys
and see if the ones we want are found in the list - a rather extreme
workaround for bad error handling behavior in their APIs...)

 ...jim

On 05/16/2016 05:15 AM, Erik De Rijcke wrote:

I ran into several issues, however I'm not sure they are related to gtk3

first of all it seems there is a dependency on:
gsettings-desktop-schemas.
I'm not sure how desirable this is (I did not have it installed,
installing
it fixed the error but I can image people not wanting to install it?)

Second, and this seems unrelated to gtk(3?), the screen initialization
fails (test was done using gentoo linux on virtualbox with windows 7 as
host):

Exception in thread "JavaFX Application Thread"
java.lang.IllegalArgumentException: Both width and height must be >= 0

at javafx.geometry.Rectangle2D.(Rectangle2D.java:104)
at javafx.stage.Screen.nativeToScreen(Screen.java:152)
at javafx.stage.Screen.updateConfiguration(Screen.java:88)
at javafx.stage.Screen.checkDirty(Screen.java:82)
at javafx.stage.Screen.getPrimary(Screen.java:185)
at
com.sun.javafx.tk.quantum.QuantumToolkit.initSceneGraph(QuantumToolkit.java:298)

at
com.sun.javafx.tk.quantum.QuantumToolkit.runToolkit(QuantumToolkit.java:340)

at
com.sun.javafx.tk.quantum.QuantumToolkit.lambda$startup$10(QuantumToolkit.java:257)

at com.sun.glass.ui.Application.lambda$run$1(Application.java:155)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at
com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$7(GtkApplication.java:194)

at java.lang.Thread.run(Thread.java:804)


Nearly all values seem to be -2147483648


I used openjdk9 109 as per instructions of the wiki, and the latest
javafx
dev.


On Mon, May 9, 2016 at 8:56 PM, Jim Graham 
wrote:


Should we integrate that into prism.verbose output?

 ...jim


On 5/9/16 6:18 AM, David Hill wrote:



I added a new feature Friday and would like some help testing it.

This new feature (8087516: Conditional support for GTK 3 on Linux)
allows
us to use either GTK v2 or 3 with JavaFX.

The default has not changed - we will use gtk 2 by preference.

The help I need is for anyone doing testing on Linux with the current
tree - like todays sanity testing. Adding

-Djdk.gtk.verbose=true

should output the version detected and used. I would appreciate a paste
of that along with the OS version.

-Djdk.gtk.version=3

toggles the preferred version to GTK 3. Testing using that toggled
would
also be appreciated, along with a note to me
with the OS version.

thanks!




Re: Support for GTK 2 & 3 now in JFX

2016-05-16 Thread Jim Graham
These may both be related to the HiDPI fix instead.  I added a usage of 
g_settings in that fix that went in on Friday.  It looks like I'll have 
to check for the schema existing before I access it.


Can you file a bug report?

(On a side note, the call that grabs the schema does not have a "schema 
not known" return value - if you ask for a schema that doesn't exist 
they abort your application.  Seems kind of drastic, but the bug reports 
that request that they simply return null were met with push back 
because the developers couldn't imagine why anyone would want such a 
thing (huh?) and later an attempt to return NULL on unrecognized schemas 
and keys had to be backed out because of the huge disaster the NULL 
values caused (and somehow ABORT'ing on behalf of the application is 
better in that case?).  Unfortunately I don't see much sanity in those 
APIs or any support for a case like this of "I'd like to get that value, 
but if you haven't heard of it, that's fine as I have a backup plan". 
The only way around this will be to enumerate all schemas and all keys 
and see if the ones we want are found in the list - a rather extreme 
workaround for bad error handling behavior in their APIs...)


...jim

On 05/16/2016 05:15 AM, Erik De Rijcke wrote:

I ran into several issues, however I'm not sure they are related to gtk3

first of all it seems there is a dependency on: gsettings-desktop-schemas.
I'm not sure how desirable this is (I did not have it installed, installing
it fixed the error but I can image people not wanting to install it?)

Second, and this seems unrelated to gtk(3?), the screen initialization
fails (test was done using gentoo linux on virtualbox with windows 7 as
host):

Exception in thread "JavaFX Application Thread"
java.lang.IllegalArgumentException: Both width and height must be >= 0

at javafx.geometry.Rectangle2D.(Rectangle2D.java:104)
at javafx.stage.Screen.nativeToScreen(Screen.java:152)
at javafx.stage.Screen.updateConfiguration(Screen.java:88)
at javafx.stage.Screen.checkDirty(Screen.java:82)
at javafx.stage.Screen.getPrimary(Screen.java:185)
at
com.sun.javafx.tk.quantum.QuantumToolkit.initSceneGraph(QuantumToolkit.java:298)
at
com.sun.javafx.tk.quantum.QuantumToolkit.runToolkit(QuantumToolkit.java:340)
at
com.sun.javafx.tk.quantum.QuantumToolkit.lambda$startup$10(QuantumToolkit.java:257)
at com.sun.glass.ui.Application.lambda$run$1(Application.java:155)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at
com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$7(GtkApplication.java:194)
at java.lang.Thread.run(Thread.java:804)


Nearly all values seem to be -2147483648


I used openjdk9 109 as per instructions of the wiki, and the latest javafx
dev.


On Mon, May 9, 2016 at 8:56 PM, Jim Graham  wrote:


Should we integrate that into prism.verbose output?

 ...jim


On 5/9/16 6:18 AM, David Hill wrote:



I added a new feature Friday and would like some help testing it.

This new feature (8087516: Conditional support for GTK 3 on Linux) allows
us to use either GTK v2 or 3 with JavaFX.

The default has not changed - we will use gtk 2 by preference.

The help I need is for anyone doing testing on Linux with the current
tree - like todays sanity testing. Adding

-Djdk.gtk.verbose=true

should output the version detected and used. I would appreciate a paste
of that along with the OS version.

-Djdk.gtk.version=3

toggles the preferred version to GTK 3. Testing using that toggled would
also be appreciated, along with a note to me
with the OS version.

thanks!




Re: Support for GTK 2 & 3 now in JFX

2016-05-16 Thread Erik De Rijcke
I ran into several issues, however I'm not sure they are related to gtk3

first of all it seems there is a dependency on: gsettings-desktop-schemas.
I'm not sure how desirable this is (I did not have it installed, installing
it fixed the error but I can image people not wanting to install it?)

Second, and this seems unrelated to gtk(3?), the screen initialization
fails (test was done using gentoo linux on virtualbox with windows 7 as
host):

Exception in thread "JavaFX Application Thread"
java.lang.IllegalArgumentException: Both width and height must be >= 0

at javafx.geometry.Rectangle2D.(Rectangle2D.java:104)
at javafx.stage.Screen.nativeToScreen(Screen.java:152)
at javafx.stage.Screen.updateConfiguration(Screen.java:88)
at javafx.stage.Screen.checkDirty(Screen.java:82)
at javafx.stage.Screen.getPrimary(Screen.java:185)
at
com.sun.javafx.tk.quantum.QuantumToolkit.initSceneGraph(QuantumToolkit.java:298)
at
com.sun.javafx.tk.quantum.QuantumToolkit.runToolkit(QuantumToolkit.java:340)
at
com.sun.javafx.tk.quantum.QuantumToolkit.lambda$startup$10(QuantumToolkit.java:257)
at com.sun.glass.ui.Application.lambda$run$1(Application.java:155)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at
com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$7(GtkApplication.java:194)
at java.lang.Thread.run(Thread.java:804)


Nearly all values seem to be -2147483648


I used openjdk9 109 as per instructions of the wiki, and the latest javafx
dev.


On Mon, May 9, 2016 at 8:56 PM, Jim Graham  wrote:

> Should we integrate that into prism.verbose output?
>
> ...jim
>
>
> On 5/9/16 6:18 AM, David Hill wrote:
>
>>
>> I added a new feature Friday and would like some help testing it.
>>
>> This new feature (8087516: Conditional support for GTK 3 on Linux) allows
>> us to use either GTK v2 or 3 with JavaFX.
>>
>> The default has not changed - we will use gtk 2 by preference.
>>
>> The help I need is for anyone doing testing on Linux with the current
>> tree - like todays sanity testing. Adding
>>
>> -Djdk.gtk.verbose=true
>>
>> should output the version detected and used. I would appreciate a paste
>> of that along with the OS version.
>>
>> -Djdk.gtk.version=3
>>
>> toggles the preferred version to GTK 3. Testing using that toggled would
>> also be appreciated, along with a note to me
>> with the OS version.
>>
>> thanks!
>>
>>


Re: Support for GTK 2 & 3 now in JFX

2016-05-09 Thread Jim Graham

Should we integrate that into prism.verbose output?

...jim

On 5/9/16 6:18 AM, David Hill wrote:


I added a new feature Friday and would like some help testing it.

This new feature (8087516: Conditional support for GTK 3 on Linux) allows us to 
use either GTK v2 or 3 with JavaFX.

The default has not changed - we will use gtk 2 by preference.

The help I need is for anyone doing testing on Linux with the current tree - 
like todays sanity testing. Adding

-Djdk.gtk.verbose=true

should output the version detected and used. I would appreciate a paste of that 
along with the OS version.

-Djdk.gtk.version=3

toggles the preferred version to GTK 3. Testing using that toggled would also 
be appreciated, along with a note to me
with the OS version.

thanks!



Re: Support for GTK 2 & 3 now in JFX

2016-05-09 Thread David Hill

On 5/9/16, 9:39 AM, Erik De Rijcke wrote:

Hi,

Are there any known limitations on the gtk3 backends (html5, wayland, ...) that 
could be used?

In short - no, but do tell if you find some :-)

The problem before was that you can't mix GTK2 & 3 in the same application, so SWT 
for example that is using GTK3 would crash and burn. With the addition of dynamic loading 
of GTK we can at least avoid that issue - at least as long as you tell the app which 
version to use. I have a task to investigate detecting if a version is already in use 
, but that has some portability 
issues and might not make the final product. I am not aware of any reason why there would 
be an issue - unless there is something with the GTK event loop.

Let me know if you give it a try.

Dave


regards,

Erik

On Mon, May 9, 2016 at 3:18 PM, David Hill > wrote:


I added a new feature Friday and would like some help testing it.

This new feature (8087516: Conditional support for GTK 3 on Linux) allows 
us to use either GTK v2 or 3 with JavaFX.

The default has not changed - we will use gtk 2 by preference.

The help I need is for anyone doing testing on Linux with the current tree 
- like todays sanity testing. Adding

-Djdk.gtk.verbose=true

should output the version detected and used. I would appreciate a paste of 
that along with the OS version.

-Djdk.gtk.version=3

toggles the preferred version to GTK 3. Testing using that toggled would 
also be appreciated, along with a note to me with the OS version.

thanks!

-- 
David Hill

Java Embedded Development

"A man's feet should be planted in his country, but his eyes should survey the 
world."
-- George Santayana (1863 - 1952)





--
David Hill
Java Embedded Development

"A man's feet should be planted in his country, but his eyes should survey the 
world."
-- George Santayana (1863 - 1952)



Re: Support for GTK 2 & 3 now in JFX

2016-05-09 Thread Erik De Rijcke
Hi,

Are there any known limitations on the gtk3 backends (html5, wayland, ...)
that could be used?

regards,

Erik

On Mon, May 9, 2016 at 3:18 PM, David Hill  wrote:

>
> I added a new feature Friday and would like some help testing it.
>
> This new feature (8087516: Conditional support for GTK 3 on Linux) allows
> us to use either GTK v2 or 3 with JavaFX.
>
> The default has not changed - we will use gtk 2 by preference.
>
> The help I need is for anyone doing testing on Linux with the current tree
> - like todays sanity testing. Adding
>
> -Djdk.gtk.verbose=true
>
> should output the version detected and used. I would appreciate a paste of
> that along with the OS version.
>
> -Djdk.gtk.version=3
>
> toggles the preferred version to GTK 3. Testing using that toggled would
> also be appreciated, along with a note to me with the OS version.
>
> thanks!
>
> --
> David Hill
> Java Embedded Development
>
> "A man's feet should be planted in his country, but his eyes should survey
> the world."
> -- George Santayana (1863 - 1952)
>
>