mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	protocol: remove absolute coordinates from pointer
Remove the absolute coordinate fields from the pointer motion and pointer_focus events. Clients are not supposed to see any global coordinates. Fix wayland-server code accordingly. wayland-client code is unaffected. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
		
							parent
							
								
									7243062f93
								
							
						
					
					
						commit
						5536031bfb
					
				
					 3 changed files with 6 additions and 16 deletions
				
			
		| 
						 | 
				
			
			@ -594,14 +594,11 @@
 | 
			
		|||
 | 
			
		||||
    <event name="motion">
 | 
			
		||||
      <description summary="pointer motion event">
 | 
			
		||||
	Notification of pointer location change.  x,y are the absolute
 | 
			
		||||
	location on the screen.  surface_[xy] are the location
 | 
			
		||||
	relative to the focused surface.
 | 
			
		||||
	Notification of pointer location change. The arguments surface_[xy]
 | 
			
		||||
	are the location relative to the focused surface.
 | 
			
		||||
      </description>
 | 
			
		||||
 | 
			
		||||
      <arg name="time" type="uint"/>
 | 
			
		||||
      <arg name="x" type="int"/>
 | 
			
		||||
      <arg name="y" type="int"/>
 | 
			
		||||
      <arg name="surface_x" type="int"/>
 | 
			
		||||
      <arg name="surface_y" type="int"/>
 | 
			
		||||
    </event>
 | 
			
		||||
| 
						 | 
				
			
			@ -637,8 +634,6 @@
 | 
			
		|||
 | 
			
		||||
      <arg name="time" type="uint"/>
 | 
			
		||||
      <arg name="surface" type="object" interface="wl_surface"/>
 | 
			
		||||
      <arg name="x" type="int"/>
 | 
			
		||||
      <arg name="y" type="int"/>
 | 
			
		||||
      <arg name="surface_x" type="int"/>
 | 
			
		||||
      <arg name="surface_y" type="int"/>
 | 
			
		||||
    </event>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -421,21 +421,19 @@ default_grab_focus(struct wl_grab *grab, uint32_t time,
 | 
			
		|||
	if (device->button_count > 0)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	wl_input_device_set_pointer_focus(device, surface, time,
 | 
			
		||||
					  device->x, device->y, x, y);
 | 
			
		||||
	wl_input_device_set_pointer_focus(device, surface, time, x, y);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
default_grab_motion(struct wl_grab *grab,
 | 
			
		||||
		    uint32_t time, int32_t x, int32_t y)
 | 
			
		||||
{
 | 
			
		||||
	struct wl_input_device *device = grab->input_device;
 | 
			
		||||
	struct wl_resource *resource;
 | 
			
		||||
 | 
			
		||||
	resource = grab->input_device->pointer_focus_resource;
 | 
			
		||||
	if (resource)
 | 
			
		||||
		wl_resource_post_event(resource, WL_INPUT_DEVICE_MOTION,
 | 
			
		||||
				       time, device->x, device->y, x, y);
 | 
			
		||||
				       time, x, y);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
| 
						 | 
				
			
			@ -453,7 +451,6 @@ default_grab_button(struct wl_grab *grab,
 | 
			
		|||
	if (device->button_count == 0 && state == 0)
 | 
			
		||||
		wl_input_device_set_pointer_focus(device,
 | 
			
		||||
						  device->current, time,
 | 
			
		||||
						  device->x, device->y,
 | 
			
		||||
						  device->current_x,
 | 
			
		||||
						  device->current_y);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -519,7 +516,6 @@ WL_EXPORT void
 | 
			
		|||
wl_input_device_set_pointer_focus(struct wl_input_device *device,
 | 
			
		||||
				  struct wl_surface *surface,
 | 
			
		||||
				  uint32_t time,
 | 
			
		||||
				  int32_t x, int32_t y,
 | 
			
		||||
				  int32_t sx, int32_t sy)
 | 
			
		||||
{
 | 
			
		||||
	struct wl_resource *resource;
 | 
			
		||||
| 
						 | 
				
			
			@ -532,7 +528,7 @@ wl_input_device_set_pointer_focus(struct wl_input_device *device,
 | 
			
		|||
	     device->pointer_focus->resource.client != surface->resource.client))
 | 
			
		||||
		wl_resource_post_event(device->pointer_focus_resource,
 | 
			
		||||
				       WL_INPUT_DEVICE_POINTER_FOCUS,
 | 
			
		||||
				       time, NULL, 0, 0, 0, 0);
 | 
			
		||||
				       time, NULL, 0, 0);
 | 
			
		||||
	if (device->pointer_focus_resource)
 | 
			
		||||
		wl_list_remove(&device->pointer_focus_listener.link);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -540,7 +536,7 @@ wl_input_device_set_pointer_focus(struct wl_input_device *device,
 | 
			
		|||
	if (resource) {
 | 
			
		||||
		wl_resource_post_event(resource,
 | 
			
		||||
				       WL_INPUT_DEVICE_POINTER_FOCUS,
 | 
			
		||||
				       time, surface, x, y, sx, sy);
 | 
			
		||||
				       time, surface, sx, sy);
 | 
			
		||||
		wl_list_insert(resource->destroy_listener_list.prev,
 | 
			
		||||
			       &device->pointer_focus_listener.link);
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -269,7 +269,6 @@ void
 | 
			
		|||
wl_input_device_set_pointer_focus(struct wl_input_device *device,
 | 
			
		||||
				  struct wl_surface *surface,
 | 
			
		||||
				  uint32_t time,
 | 
			
		||||
				  int32_t x, int32_t y,
 | 
			
		||||
				  int32_t sx, int32_t sy);
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue