[mutter] wayland: Don't send proximity_in for new resources



commit 433b59f74a18b33eac4ccfdd65b4de425fa2bf9f
Author: Julius Lehmann <julius devpi de>
Date:   Thu Sep 3 21:16:54 2020 +0200

    wayland: Don't send proximity_in for new resources
    
    Mutter sends a proximity-in event before the required tablet tool
    resource is properly allocated on the client. This is violating the
    Wayland protocol. Because libwayland ignores events for objects it
    doesn't know yet, this is not noticeable in most applications. However,
    if https://gitlab.freedesktop.org/wayland/wayland/-/issues/176 gets
    fixed, these applications would likely crash immediately. Therefore this
    PR removes the responsible code which, again, shouldn't have any effect
    on client applications as they ignore this event anyway.
    
    Relevant part of the spec:
    
        This event can be received when the tool has moved from one surface to
        another, or when the tool has come back into proximity above the
        surface.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1427

 src/wayland/meta-wayland-tablet-tool.c | 19 -------------------
 1 file changed, 19 deletions(-)
---
diff --git a/src/wayland/meta-wayland-tablet-tool.c b/src/wayland/meta-wayland-tablet-tool.c
index 677ccdd301..b26ad40164 100644
--- a/src/wayland/meta-wayland-tablet-tool.c
+++ b/src/wayland/meta-wayland-tablet-tool.c
@@ -531,24 +531,6 @@ static const struct zwp_tablet_tool_v2_interface tool_interface = {
   tool_destroy
 };
 
-static void
-emit_proximity_in (MetaWaylandTabletTool *tool,
-                   struct wl_resource    *resource)
-{
-  struct wl_resource *tablet_resource;
-  struct wl_client *client;
-
-  if (!tool->focus_surface)
-    return;
-
-  client = wl_resource_get_client (resource);
-  tablet_resource = meta_wayland_tablet_lookup_resource (tool->current_tablet,
-                                                         client);
-
-  zwp_tablet_tool_v2_send_proximity_in (resource, tool->proximity_serial,
-                                        tablet_resource, tool->focus_surface->resource);
-}
-
 struct wl_resource *
 meta_wayland_tablet_tool_create_new_resource (MetaWaylandTabletTool *tool,
                                               struct wl_client      *client,
@@ -567,7 +549,6 @@ meta_wayland_tablet_tool_create_new_resource (MetaWaylandTabletTool *tool,
       wl_resource_get_client (tool->focus_surface->resource) == client)
     {
       wl_list_insert (&tool->focus_resource_list, wl_resource_get_link (resource));
-      emit_proximity_in (tool, resource);
     }
   else
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]