commit 7a8cb26

Michael Forney  ·  2014-01-23 00:19:52 +0000 UTC
parent 43dc1b4
pointer: Separate cursor updating to cursor_update
1 files changed,  +9, -6
+9, -6
 1@@ -151,6 +151,13 @@ static void handle_view_event(struct wl_listener * listener, void * data)
 2     }
 3 }
 4 
 5+static inline void update_cursor(struct swc_pointer * pointer)
 6+{
 7+    swc_view_move(&pointer->cursor.view,
 8+                  wl_fixed_to_int(pointer->x) - pointer->cursor.hotspot.x,
 9+                  wl_fixed_to_int(pointer->y) - pointer->cursor.hotspot.y);
10+}
11+
12 bool swc_pointer_initialize(struct swc_pointer * pointer)
13 {
14     struct wld_buffer * buffer;
15@@ -254,9 +261,7 @@ static void set_cursor(struct wl_client * client,
16         swc_surface_set_view(surface, &pointer->cursor.view);
17         wl_resource_add_destroy_listener(surface->resource,
18                                          &pointer->cursor.destroy_listener);
19-        swc_view_move(&pointer->cursor.view,
20-                      wl_fixed_to_int(pointer->x) - hotspot_x,
21-                      wl_fixed_to_int(pointer->y) - hotspot_y);
22+        update_cursor(pointer);
23     }
24 }
25 
26@@ -336,8 +341,6 @@ void swc_pointer_handle_relative_motion
27                                surface_x, surface_y);
28     }
29 
30-    swc_view_move(&pointer->cursor.view,
31-                  wl_fixed_to_int(pointer->x) - pointer->cursor.hotspot.x,
32-                  wl_fixed_to_int(pointer->y) - pointer->cursor.hotspot.y);
33+    update_cursor(pointer);
34 }
35