[mutter] wayland: Small code cleanup in meta_wayland_drag_grab_set_focus()



commit f8c70491b968baa9cdf0c6b5b233ffb2ad250e7b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Mar 9 16:44:25 2016 +0100

    wayland: Small code cleanup in meta_wayland_drag_grab_set_focus()
    
    There's enough instances of drag_grab->drag_data_source to make it
    nicer getting a "source" variable first.

 src/wayland/meta-wayland-data-device.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c
index 5b0a7c4..8e9ae94 100644
--- a/src/wayland/meta-wayland-data-device.c
+++ b/src/wayland/meta-wayland-data-device.c
@@ -729,6 +729,7 @@ meta_wayland_drag_grab_set_focus (MetaWaylandDragGrab *drag_grab,
                                   MetaWaylandSurface  *surface)
 {
   MetaWaylandSeat *seat = drag_grab->seat;
+  MetaWaylandDataSource *source = drag_grab->drag_data_source;
   struct wl_client *client;
   struct wl_resource *data_device_resource, *offer = NULL;
 
@@ -741,13 +742,13 @@ meta_wayland_drag_grab_set_focus (MetaWaylandDragGrab *drag_grab,
       drag_grab->drag_focus = NULL;
     }
 
-  if (drag_grab->drag_data_source)
-    meta_wayland_data_source_set_current_offer (drag_grab->drag_data_source, NULL);
+  if (source)
+    meta_wayland_data_source_set_current_offer (source, NULL);
 
   if (!surface)
     return;
 
-  if (!drag_grab->drag_data_source &&
+  if (!source &&
       wl_resource_get_client (surface->resource) != drag_grab->drag_client)
     return;
 
@@ -755,9 +756,8 @@ meta_wayland_drag_grab_set_focus (MetaWaylandDragGrab *drag_grab,
 
   data_device_resource = wl_resource_find_for_client (&seat->data_device.resource_list, client);
 
-  if (drag_grab->drag_data_source && data_device_resource)
-    offer = meta_wayland_data_source_send_offer (drag_grab->drag_data_source,
-                                                 data_device_resource);
+  if (source && data_device_resource)
+    offer = meta_wayland_data_source_send_offer (source, data_device_resource);
 
   drag_grab->drag_focus = surface;
   drag_grab->drag_focus_data_device = data_device_resource;


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