Compare commits

...

2 Commits

Author SHA1 Message Date
Andri Yngvason 121f473fd6 pointer: Remove output position from coordinates
This is no longer required as the input is mapped to the output in the
compositor.
2020-02-05 22:37:40 +00:00
Andri Yngvason 5dc5c700f8 Map input to the selected output 2020-02-05 22:37:40 +00:00
3 changed files with 17 additions and 7 deletions

View File

@ -118,7 +118,7 @@
</request>
</interface>
<interface name="zwlr_virtual_pointer_manager_v1" version="1">
<interface name="zwlr_virtual_pointer_manager_v1" version="2">
<description summary="virtual pointer manager">
This object allows clients to create individual virtual pointer objects.
</description>
@ -131,9 +131,19 @@
<arg name="seat" type="object" interface="wl_seat" allow-null="true"/>
<arg name="id" type="new_id" interface="zwlr_virtual_pointer_v1"/>
</request>
<request name="destroy" type="destructor" since="1">
<description summary="destroy the virtual pointer manager"/>
</request>
<request name="create_virtual_pointer2" since="2">
<description summary="Create a new virtual pointer">
Creates a new virtual pointer. The seat and the output arguments are
optional. If they are set, the compositor must bind the pointer
accordingly.
</description>
<arg name="seat" type="object" interface="wl_seat" allow-null="true"/>
<arg name="output" type="object" interface="wl_output" allow-null="true"/>
<arg name="id" type="new_id" interface="zwlr_virtual_pointer_v1"/>
</request>
</interface>
</protocol>

View File

@ -163,7 +163,7 @@ static void registry_add(void* data, struct wl_registry* registry,
self->pointer_manager =
wl_registry_bind(registry, id,
&zwlr_virtual_pointer_manager_v1_interface,
1);
2);
return;
}
@ -760,8 +760,9 @@ int main(int argc, char* argv[])
self.pointer_backend.output = self.selected_output;
self.pointer_backend.pointer =
zwlr_virtual_pointer_manager_v1_create_virtual_pointer(
self.pointer_manager, self.selected_seat->wl_seat);
zwlr_virtual_pointer_manager_v1_create_virtual_pointer2(
self.pointer_manager, self.selected_seat->wl_seat,
out->wl_output);
pointer_init(&self.pointer_backend);

View File

@ -76,8 +76,7 @@ void pointer_set(struct pointer* self, uint32_t x, uint32_t y,
if (x != self->current_x || y != self->current_y)
zwlr_virtual_pointer_v1_motion_absolute(self->pointer, t,
self->output->x + x,
self->output->y + y,
x, y,
self->output->width,
self->output->height);