]> git.0d.be Git - empathy.git/commitdiff
Factor out empathy_call_window_get_preview_position()
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Tue, 9 Aug 2011 14:34:44 +0000 (15:34 +0100)
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Mon, 15 Aug 2011 11:14:54 +0000 (12:14 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=656268

src/empathy-call-window.c

index 25fa04c3ee328920432e3e056ae6115f8c1a0662..3ea6a3d074033932aee858b9b7386555216cc84f 100644 (file)
@@ -650,13 +650,10 @@ empathy_call_window_preview_on_drag_begin_cb (ClutterDragAction *action,
   empathy_call_window_show_preview_rectangles (self, TRUE);
 }
 
-static void
-empathy_call_window_preview_on_drag_end_cb (ClutterDragAction *action,
-    ClutterActor *actor,
+static PreviewPosition
+empathy_call_window_get_preview_position (EmpathyCallWindow *self,
     gfloat event_x,
-    gfloat event_y,
-    ClutterModifierType modifiers,
-    EmpathyCallWindow *self)
+    gfloat event_y)
 {
   ClutterGeometry box;
   PreviewPosition pos = PREVIEW_POS_NONE;
@@ -692,6 +689,21 @@ empathy_call_window_preview_on_drag_end_cb (ClutterDragAction *action,
       pos = PREVIEW_POS_BOTTOM_RIGHT;
     }
 
+  return pos;
+}
+
+static void
+empathy_call_window_preview_on_drag_end_cb (ClutterDragAction *action,
+    ClutterActor *actor,
+    gfloat event_x,
+    gfloat event_y,
+    ClutterModifierType modifiers,
+    EmpathyCallWindow *self)
+{
+  PreviewPosition pos;
+
+  pos = empathy_call_window_get_preview_position (self, event_x, event_y);
+
   if (pos != PREVIEW_POS_NONE)
     empathy_call_window_move_video_preview (self, pos);