Bug 553355 - [Wayland] Can't get proper display relative coordinates
Summary: [Wayland] Can't get proper display relative coordinates
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.14   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2019-11-22 06:49 EST by Martin Coufal CLA
Modified: 2020-11-19 10:28 EST (History)
6 users (show)

See Also:


Attachments
TestCoordinates.java (1.16 KB, text/x-java)
2019-11-22 06:49 EST, Martin Coufal CLA
no flags Details
x11.png (166.54 KB, image/png)
2019-11-22 06:50 EST, Martin Coufal CLA
no flags Details
wayland.png (170.32 KB, image/png)
2019-11-22 06:50 EST, Martin Coufal CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.