Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaFx-Applications starts with wrong size with jdk>=8 #846

Closed
totaam opened this issue Apr 29, 2015 · 11 comments
Closed

JavaFx-Applications starts with wrong size with jdk>=8 #846

totaam opened this issue Apr 29, 2015 · 11 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Apr 29, 2015

Issue migrated from trac ticket # 846

component: core | priority: major | resolution: fixed

2015-04-29 07:29:27: mptei created the issue


When I start a JavaFx application, the application starts with size 0,0. I can then enlarge it (when I find it).

This happens with all JavaFx applications.

To see that behavior download the samples from: [http://www.oracle.com/technetwork/java/javase/overview/javafx-samples-2158687.html]

I've tested it with Ensemble:

java -jar Ensemble.jar 

My Xpra is compiled from trunk r9187.

@totaam
Copy link
Collaborator Author

totaam commented Apr 30, 2015

I cannot reproduce this with 0.14 or with trunk so I am lowering the priority, my desktop environment is cinnamon on Fedora 20.

Please include more details so we can investigate this issue you are having, see ReportingBugs for guidelines.
It may be worth including the client and server logs with -d window.

@totaam
Copy link
Collaborator Author

totaam commented Apr 30, 2015

2015-04-30 05:45:50: mptei uploaded file logs.zip (7.4 KiB)

Logs with -d window

@totaam
Copy link
Collaborator Author

totaam commented Apr 30, 2015

2015-04-30 05:47:29: mptei commented


Please find the -d window logs attached.

I'm using a gentoo system.

@totaam
Copy link
Collaborator Author

totaam commented Apr 30, 2015

Please see ReportingBugs, comment 3 is nowhere near enough information for me to do anything with it.

@totaam
Copy link
Collaborator Author

totaam commented May 4, 2015

2015-05-04 09:30:26: mptei commented


Sorry for not providing enough information. The client log was missing due to an error of me.

In the mean time I found out, that the problem is related to the version of the JVM (java virtual machine).

Oracle JDK 1.8.0.45 (also tried 1.8.0.40) has the problem.
Oracle JDK 1.7.0.80 is OK.

Running Ensemble.jar against a "real" X11 server is OK with both JVM versions.

I my tests I saw no dependency to xpra version (tried back to r5826).
I saw no dependency on the client (linux/osx).

Can you try again please by using a java 1.8 jvm?

@totaam
Copy link
Collaborator Author

totaam commented May 4, 2015

Confirmed with jdk8.
This sounds similar to #705, but sadly, using the wm-name=Sawfish does not help here.

@totaam
Copy link
Collaborator Author

totaam commented May 23, 2015

Here comes the server -d window debug log extract for this:

do_child_configure_request_event(<X11:ConfigureRequest \
    {'delivered_to': '0x44', 'send_event': 0, 'type': 23, 'detail': 0, 'height': 1, 'width': 1, 'window': '0xa00003', 'above': 0L, 'y': 0, 'x': 0, 'serial': '0x13f0', 'border_width': 0, 'value_mask': 15L, 'display': ':10'}>)
Reconfigure on withdrawn window
do_child_configure_request_event(<X11:ConfigureRequest \
    {'delivered_to': '0x44', 'send_event': 0, 'type': 23, 'detail': 0, 'height': 1, 'width': 1, 'window': '0xa00003', 'above': 0L, 'y': 0, 'x': 0, 'serial': '0x13f8', 'border_width': 0, 'value_mask': 64L, 'display': ':10'}>)
Reconfigure on withdrawn window
Found a potential client
new window 0xa00003
setup() corral_window=0x40007c
...
XGetClassHint(0xa00003) classhints: ensemble.Ensemble2, ensemble.Ensemble2
wm_hints.input = 1
_update_client_geometry: using initial size=(1, 1) and position=(0, 0)
...
setup() adding to save set
setup() reparenting
setup() geometry
setup() resizing windows to 1x1
adding window WindowModel(0xa00003 - "Ensemble")
Discovered new ordinary window: WindowModel(0xa00003 - "Ensemble") (geometry=(0, 0, 1, 1))
...
client configured window 4 - WindowModel(0xa00003 - "Ensemble"), at: (0, 0, 1, 1)
_process_configure_window([4, 0, 0, 1, 1, \
    {... }
     old window geometry: (0, 0, 1, 1)
_handle_iconic_update: set_state(1)
updating metadata on WindowModel(0xa00003 - "Ensemble"): <GParamBoolean 'iconic'>
_update_client_geometry: owner()=DesktopManager(2)
_do_update_client_geometry: 1x1
_do_update_client_geometry: hints={'minimum-size': (0, 0), 'maximum-size': (32767, 32767), 'gravity': 1}
_do_update_client_geometry: size=(1, 1, 1, 1)
_do_update_client_geometry: position=(0, 0)
...

So we create a 1x1 window as we're told... Not sure where we're supposed to be getting the "correct" size from.

Could be related to #881.

@totaam
Copy link
Collaborator Author

totaam commented May 23, 2015

Got it, not sure how I missed it earlier.
Using:

XPRA_X11_DEBUG_EVENTS=ConfigureRequest xpra start ...

We see:

ConfigureRequest event 0x6db : <X11:ConfigureRequest \
    {'delivered_to': '0x44', 'send_event': 0, 'type': 23, 'detail': 0, 'height': 700, 'width': 1020, 'window': '0xa00003', 'above': 0L, \
     'y': 0, 'x': 0, 'serial': '0x6db', 'border_width': 0, 'value_mask': 12L, 'display': ':10'}>
  delivering event to parent window: 0x44 (signal=child-configure-request-event)
  not forwarding to XpraServer handler, it has no child-configure-request-event signal (it has: ('xpra-cursor-event', 'xpra-child-map-event'))
  forwarding event to a Wm handler's child-configure-request-event signal
do_child_configure_request_event(<X11:ConfigureRequest {...}>) value_mask=Width|Height, should be handled by the window model
  forwarded
ConfigureRequest event 0x6db : <X11:ConfigureRequest \
    {'delivered_to': '0x44', 'send_event': 0, 'type': 23, 'detail': 0, 'height': 1, 'width': 1, 'window': '0xa00003', 'above': 0L, \
     'y': 291, 'x': 770, 'serial': '0x6db', 'border_width': 0, 'value_mask': 3L, 'display': ':10'}>
  delivering event to parent window: 0x44 (signal=child-configure-request-event)
  not forwarding to XpraServer handler, it has no child-configure-request-event signal (it has: ('xpra-cursor-event', 'xpra-child-map-event'))
  forwarding event to a Wm handler's child-configure-request-event signal
do_child_configure_request_event(<X11:ConfigureRequest {...}>) value_mask=X|Y, should be handled by the window model
2015-05-23 22:29:06,579   forwarded

So we get two configure request events: one for (Width|Height) and one for (X|Y), but they are delivered to the root window (0x44) instead of the window model.
And so we then decide to not act on it in Wm (which listens on the root window) because the window model's handler should be dealing with it.

And now we go down the rabbit hole:

  • if we forward the event, we still have the problem that _update_client_geometry will only honour the update before setup_done and this happens after...
  • if we disable the setup_done check (not sure that is safe or wise - but heh..), then the geometry change still doesn't get sent to the client because the windows aren't visible yet.
  • if we force a "geometry" notification when setup_done when we don't have an "owner" yet
  • we find that the position is incorrect: window.get_position() still returns 0x0 after we've moved the window to its requested location - looks like a bug, the size is correct as we get the value from the actual-size property
  • to prevent resizing loops, the server sends the geometry change via the size_notify_clients timer... and by the time it fires, the client has configured the window in its initial size + location (which is 0x0 at 0,0..), so we don't send it

What a mess!

@totaam
Copy link
Collaborator Author

totaam commented May 23, 2015

2015-05-23 17:54:54: antoine uploaded file force-forward-configure-request.patch (2.7 KiB)

with this hack of a patch, the window shows up with the right size and position

@totaam
Copy link
Collaborator Author

totaam commented Nov 20, 2015

r11301 + r11302 + r11304 fix this issue and I am able to run the examples with JDK8

@mptei: please close if this works for you.

(applied to v0.15.x in 11309)

@totaam
Copy link
Collaborator Author

totaam commented Dec 1, 2015

2015-12-01 15:26:34: mptei commented


I can confirm that it works. I've testet with 11347.

Thanks for fixing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant