]> granicus.if.org Git - graphviz/commitdiff
GTK plugin on_drawingarea1_scroll_event: squash -Wswitch-default
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 5 Sep 2022 17:44:40 +0000 (10:44 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 10 Sep 2022 19:01:11 +0000 (12:01 -0700)
On GTK 2, the only valid scroll values are left, right, up, and down. GTK 3 adds
a fifth, smooth, capture scrolling in a combined x/y direction (diagonal). In
all cases except up and down, it seems clear this code intends to ignore the
action.

As of this commit, the GTK plugin builds warning-free on Linux.

plugin/gtk/callbacks.c

index 35208ca618da0ea3766fe4e0390bb5f464b85bca..2b6e1a3f6d4677d7baa75e539f037c2933e19e87 100644 (file)
@@ -428,8 +428,7 @@ on_drawingarea1_scroll_event           (GtkWidget       *widget,
        case GDK_SCROLL_DOWN:
            job->callbacks->button_press(job, 5, pointer);
            break;
-       case GDK_SCROLL_LEFT:
-       case GDK_SCROLL_RIGHT:
+       default: // do nothing
            break;
     }
     gtk_widget_queue_draw(widget);