talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 0d5fbaf0c359b6712ac1020fe91fadf1e75f754a
parent 63f0dc7bc4cb44aa8a7d53f47021ab04baf700a8
Author: wwp <subscript@free.fr>
Date:   Wed,  2 Oct 2019 13:40:20 +0200

Get double-click time from GTK API instead of hard-coded value 250.

Diffstat:
Msrc/mimeview.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mimeview.c b/src/mimeview.c @@ -1536,6 +1536,7 @@ static gboolean mimeview_scrolled(GtkWidget *widget, GdkEventScroll *event, return TRUE; } +#include "gdk/gdkscreen.h" /* from gdkevents.c */ #define DOUBLE_CLICK_TIME 250 @@ -1545,8 +1546,11 @@ static gboolean part_button_pressed(MimeView *mimeview, GdkEventButton *event, static MimeInfo *lastinfo; static guint32 lasttime; + gint double_click_time; + g_object_get(gtk_settings_get_default(), "gtk-double-click-time", &double_click_time, NULL); + if (event->button == 2 || - (event->button == 1 && (event->time - lasttime) < DOUBLE_CLICK_TIME && lastinfo == partinfo)) { + (event->button == 1 && (event->time - lasttime) < double_click_time && lastinfo == partinfo)) { /* call external program for image, audio or html */ mimeview_launch(mimeview, partinfo); return TRUE;