Fix #262: double click and fullscreen
[geeqie.git] / src / image.c
index 57e1d05..e04037f 100644 (file)
@@ -56,6 +56,10 @@ static void image_cache_set(ImageWindow *imd, FileData *fd);
 static void image_click_cb(PixbufRenderer *pr, GdkEventButton *event, gpointer data)
 {
        ImageWindow *imd = data;
+       if (!options->image_lm_click_nav && event->button == MOUSE_BUTTON_MIDDLE)
+               {
+               imd->mouse_wheel_mode = !imd->mouse_wheel_mode;
+               }
 
        if (imd->func_button)
                {
@@ -63,7 +67,7 @@ static void image_click_cb(PixbufRenderer *pr, GdkEventButton *event, gpointer d
                }
 }
 
-static void image_drag_cb(PixbufRenderer *pr, GdkEventButton *event, gpointer data)
+static void image_drag_cb(PixbufRenderer *pr, GdkEventMotion *event, gpointer data)
 {
        ImageWindow *imd = data;
        gint width, height;
@@ -993,7 +997,7 @@ void image_set_button_func(ImageWindow *imd,
 }
 
 void image_set_drag_func(ImageWindow *imd,
-                          void (*func)(ImageWindow *, GdkEventButton *event, gdouble dx, gdouble dy, gpointer),
+                          void (*func)(ImageWindow *, GdkEventMotion *event, gdouble dx, gdouble dy, gpointer),
                           gpointer data)
 {
        imd->func_drag = func;
@@ -1739,6 +1743,7 @@ static void image_options_set(ImageWindow *imd)
                                        "window_limit_value", options->image.max_window_size,
                                        "autofit_limit", options->image.limit_autofit_size,
                                        "autofit_limit_value", options->image.max_autofit_size,
+                                       "enlargement_limit_value", options->image.max_enlargement_size,
 
                                        NULL);
 
@@ -1936,7 +1941,7 @@ ImageWindow *image_new(gboolean frame)
 
        image_set_selectable(imd, 0);
 
-       g_signal_connect(G_OBJECT(imd->pr), "clicked",
+       g_signal_connect(G_OBJECT(imd->pr), "button_press_event",
                         G_CALLBACK(image_click_cb), imd);
        g_signal_connect(G_OBJECT(imd->pr), "scroll_notify",
                         G_CALLBACK(image_scroll_notify_cb), imd);