I think it's mathematically pedantic to say the function does not exist. Acknowledging that such a function would theoretically return a set; one, multiple or none coordinates (offscreen or occluded), we can dumb it down to the simple case that's important -- give one or zero results:

// Returns one screen location where the specified surface coordinate
// is visible. Returns false if the coordinate is not visible on
// screen at all.

MirBool mir_surface_coord_to_screen(MirSurface* surf,
                                    int localx, int localy,
                                    int* screenx, int* screeny);

Admittedly that only works for your own surfaces created in your own process.


On 12/08/14 10:56, Christopher James Halse Rogers wrote:
On Tue, Aug 12, 2014 at 12:33 PM, Daniel van Vugt
<daniel.van.v...@canonical.com> wrote:
There is a 5th option which would satisfy more (not all) of the people
mentioned:

5. Shell mediates if a client has permission to ask for surface
coordinates. The API is restricted by default. The API _does_not_
return the top-left corner of the surface. Instead it maps a local
surface coordinate (x,y) to screen coordinates (x',y'). This way we
can still map correct coordinates for arbitrary 3D transformations (if
we want to, but don't need to initially).

Again, this assumes that there exists a function whose domain is surface
coordinates and range is screen coordinates. This function does not
necessarily exist.

There *is* a unique mapping from screen coordinates to {surfaces} × (ℚ ×
ℚ), but (a) I don't think that's what AP is after - although it could
implement it - and (b) it would require us to make all surfaces visible
in some way to all clients.



--
Mir-devel mailing list
Mir-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/mir-devel

Reply via email to