]> www.fi.muni.cz Git - evince.git/commitdiff
[libview] Fix position of window annotations when moved by the user
authorCarlos Garcia Campos <carlosgc@gnome.org>
Sun, 25 Jul 2010 16:51:29 +0000 (18:51 +0200)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Sun, 25 Jul 2010 16:51:29 +0000 (18:51 +0200)
libview/ev-annotation-window.c

index 749d1a012ad53d7132bca109a2769ea10660bfd3..6539fd4ff7f707b0a591b577706fe1341375e224 100644 (file)
@@ -489,8 +489,12 @@ ev_annotation_window_focus_in_event (GtkWidget     *widget,
        EvAnnotationWindow *window = EV_ANNOTATION_WINDOW (widget);
 
        if (window->in_move) {
-               window->orig_x = window->x;
-               window->orig_y = window->y;
+               if (window->orig_x != window->x || window->orig_y != window->y) {
+                       window->orig_x = window->x;
+                       window->orig_y = window->y;
+                       g_signal_emit (window, signals[MOVED], 0, window->x, window->y);
+               }
+               window->in_move = FALSE;
        }
 
        return FALSE;
@@ -502,12 +506,6 @@ ev_annotation_window_focus_out_event (GtkWidget     *widget,
 {
        EvAnnotationWindow *window = EV_ANNOTATION_WINDOW (widget);
 
-       if (window->in_move &&
-           (window->orig_x != window->x || window->orig_y != window->y)) {
-               window->in_move = FALSE;
-               g_signal_emit (window, signals[MOVED], 0, window->x, window->y);
-       }
-
        ev_annotation_window_sync_contents (window);
 
        return FALSE;