Bug 553355

Summary: [Wayland] Can't get proper display relative coordinates
Product: [Eclipse Project] Platform Reporter: Martin Coufal <mcoufal>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: akurtakov, ericwill, jan.public, mat.booth, richard.stangl, vkadlcik
Version: 4.14Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
TestCoordinates.java
none
x11.png
none
wayland.png none

Description Martin Coufal CLA 2019-11-22 06:49:42 EST
Created attachment 280759 [details]
TestCoordinates.java

Hi, I'm trying to get display relative coordinates of a widget in Wayland. It seems to work fine in X11, but in Wayland parent.toDisplay() returns coordinates that just don't match real coordinates.

Let's have an example of finding 'Preferences' shell (TestCoordinates.java). Then, when run in X11 (see x11.png), I get:
Parent relative coordinates: [647,161]
Display relative coordinates: [647,253]

When I run same code in Wayland (see wayland.png), I get coordinates way to small to be referencing Preferences shell widget:
Parent relative coordinates: [26,23]
Display relative coordinates: [26,95]
At least, Y coordinate should be the same/very close to the x11 value (I used same display and display settings)...

My Configuration:
Fedora 30 + Wayland
Eclipse Platform 4.14 (same result in previous versions)
Comment 1 Martin Coufal CLA 2019-11-22 06:50:15 EST
Created attachment 280760 [details]
x11.png
Comment 2 Martin Coufal CLA 2019-11-22 06:50:46 EST
Created attachment 280761 [details]
wayland.png
Comment 3 Alexander Kurtakov CLA 2019-11-22 07:29:52 EST
Most probbaly because wayland doesn't support global coordinates (https://blog.gtk.org/2016/07/15/future-of-relative-window-positioning/ ) but I'll let Eric confirm.
Comment 4 Eric Williams CLA 2019-11-22 09:36:47 EST
(In reply to Alexander Kurtakov from comment #3)
> Most probbaly because wayland doesn't support global coordinates
> (https://blog.gtk.org/2016/07/15/future-of-relative-window-positioning/ )
> but I'll let Eric confirm.

Most likely yes, but we may be able to workaround it. I'll take a look sometime next week to check.
Comment 5 Richard Stangl CLA 2020-11-19 10:06:26 EST
(In reply to Eric Williams from comment #4)
> (In reply to Alexander Kurtakov from comment #3)
> > Most probbaly because wayland doesn't support global coordinates
> > (https://blog.gtk.org/2016/07/15/future-of-relative-window-positioning/ )
> > but I'll let Eric confirm.
> 
> Most likely yes, but we may be able to workaround it. I'll take a look
> sometime next week to check.

What's the status of this?
Comment 6 Alexander Kurtakov CLA 2020-11-19 10:28:37 EST
(In reply to Richard Stangl from comment #5)
> (In reply to Eric Williams from comment #4)
> > (In reply to Alexander Kurtakov from comment #3)
> > > Most probbaly because wayland doesn't support global coordinates
> > > (https://blog.gtk.org/2016/07/15/future-of-relative-window-positioning/ )
> > > but I'll let Eric confirm.
> > 
> > Most likely yes, but we may be able to workaround it. I'll take a look
> > sometime next week to check.
> 
> What's the status of this?

Eric has moved on and we haven't found anyone else to look into this one.