wayland: Implement -[WaylandServer mouselocation].

This commit is contained in:
Ivan Vučica 2020-04-25 18:04:50 +01:00
parent 67e352b83e
commit f8b8609e70
No known key found for this signature in database
GPG key ID: 6E4D7BA2D93CAC9D

View file

@ -1483,8 +1483,21 @@ int NSToWayland(struct window *window, int ns_y)
- (NSPoint) mouselocation
{
NSDebugLog(@"mouselocation");
int aScreen = -1;
struct output *output;
NSDebugLog(@"mouselocation");
// FIXME: find a cleaner way to get the first element of a wl_list
wl_list_for_each(output, &wlconfig->output_list, link) {
aScreen = output->server_output_id;
break;
}
if (aScreen < 0)
// No outputs in the wl_list.
return NSZeroPoint;
return [self mouseLocationOnScreen: aScreen window: NULL];
}
- (NSPoint) mouseLocationOnScreen: (int)aScreen window: (int *)win