Skip to content

Commit

Permalink
Fix #499: Unable to move zoomed image
Browse files Browse the repository at this point in the history
  • Loading branch information
caclark committed Jul 24, 2017
1 parent 4c3854b commit c7cb4da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
17 changes: 16 additions & 1 deletion src/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ static void image_click_cb(PixbufRenderer *pr, GdkEventButton *event, gpointer d
}
}

static void image_press_cb(PixbufRenderer *pr, GdkEventButton *event, gpointer data)
{
ImageWindow *imd = data;
LayoutWindow *lw;

lw = layout_find_by_image(imd);
if (event->button == MOUSE_BUTTON_LEFT && event->type == GDK_2BUTTON_PRESS && !options->image_lm_click_nav)
{
if (lw->full_screen)
layout_image_full_screen_stop(lw);
}
}

static void image_drag_cb(PixbufRenderer *pr, GdkEventMotion *event, gpointer data)
{
ImageWindow *imd = data;
Expand Down Expand Up @@ -1941,8 +1954,10 @@ ImageWindow *image_new(gboolean frame)

image_set_selectable(imd, 0);

g_signal_connect(G_OBJECT(imd->pr), "button_press_event",
g_signal_connect(G_OBJECT(imd->pr), "clicked",
G_CALLBACK(image_click_cb), imd);
g_signal_connect(G_OBJECT(imd->pr), "button_press_event",
G_CALLBACK(image_press_cb), imd);
g_signal_connect(G_OBJECT(imd->pr), "scroll_notify",
G_CALLBACK(image_scroll_notify_cb), imd);

Expand Down
5 changes: 0 additions & 5 deletions src/layout_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -1686,11 +1686,6 @@ static void layout_image_button_cb(ImageWindow *imd, GdkEventButton *event, gpoi
switch (event->button)
{
case MOUSE_BUTTON_LEFT:
if (event->type == GDK_2BUTTON_PRESS)
{
if (lw->full_screen)
layout_image_full_screen_stop(lw);
}
if (options->image_lm_click_nav && lw->split_mode == SPLIT_NONE)
layout_image_next(lw);
break;
Expand Down

0 comments on commit c7cb4da

Please sign in to comment.