]> git.0d.be Git - empathy.git/blobdiff - src/empathy-call-window.c
Factor out empathy_call_window_get_preview_position()
[empathy.git] / 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);