]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Ignore "RX panadapter motion notify" events that have a zero move.
authorChef <chwu@eduroam-ipv4-5-0023.triple-a.uni-kl.de>
Wed, 3 Mar 2021 19:04:27 +0000 (20:04 +0100)
committerChef <chwu@eduroam-ipv4-5-0023.triple-a.uni-kl.de>
Wed, 3 Mar 2021 19:04:27 +0000 (20:04 +0100)
receiver.c

index bc5a464113d2ee0288a58df3343194c6c86ce785..ef880a8ab782eb66fad486830b5dd84162528920 100644 (file)
@@ -150,14 +150,18 @@ gboolean receiver_motion_notify_event(GtkWidget *widget, GdkEventMotion *event,
                                 &x,
                                 &y,
                                 &state);
-    // G0ORX: removed test as with it unable to drag screen
-    //if(state & GDK_BUTTON1_MASK) {
-      //int moved=last_x-x;
-      int moved=x-last_x;
+    //
+    // It turns out to be difficult sometimes to "jump" to a
+    // frequency by just clicking in the panadaper, since the
+    // operating system may report a very small move between
+    // pressing and releasing. Then x and last_x is the same.
+    //
+    int moved=x-last_x;
+    if (moved != 0) {
       vfo_move((long long)((float)moved*rx->hz_per_pixel),FALSE);
       last_x=x;
       has_moved=TRUE;
-    //}
+    }
   }
 
   return TRUE;