$OpenBSD: patch-src_gtk_MainView_cxx,v 1.1 2009/04/04 09:25:25 landry Exp $ --- src/gtk/MainView.cxx.orig Sat Feb 28 22:00:55 2009 +++ src/gtk/MainView.cxx Sat Apr 4 11:08:38 2009 @@ -77,7 +77,7 @@ static void main_window_zoom_in_cb (GtkWidget *, gpoin static void main_window_zoom_out_cb (GtkWidget *, gpointer); static void main_window_zoom_width_cb (GtkToggleAction *, gpointer); static void main_window_set_page_mode (GtkRadioAction *, GtkRadioAction *, gpointer); -static void main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data); +static gboolean main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data); #if defined (HAVE_CUPS) static void main_window_print_cb (GtkWidget *, gpointer); @@ -1479,18 +1479,25 @@ main_window_set_page_mode (GtkRadioAction *action, Gtk pter->setPageMode (mode); } -void +gboolean main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data) { g_assert ( NULL != data && "The data parameter is NULL."); MainPter *pter = (MainPter *)data; // Only zoom when the CTRL-Button is down... - if ( !(event->state & GDK_CONTROL_MASK) ) return; - if ( event->direction == GDK_SCROLL_UP ) { - pter->zoomInActivated (); - } else if ( event->direction == GDK_SCROLL_DOWN ) { - pter->zoomOutActivated (); + if ( GDK_CONTROL_MASK == (event->state & GDK_CONTROL_MASK) ) + { + if ( event->direction == GDK_SCROLL_UP ) + { + pter->zoomInActivated (); + } + else if ( event->direction == GDK_SCROLL_DOWN ) + { + pter->zoomOutActivated (); + } + return TRUE; } + return FALSE; }