Prevent thumbnailing from disrupting mouse clicks

This commit is contained in:
Přemysl Eric Janouch 2022-02-24 21:48:26 +01:00
parent 580b68789b
commit da507edd05
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 9 additions and 9 deletions

View File

@ -136,13 +136,6 @@ append_row(FivBrowser *self, int *y, int x, GArray *items_array)
*y += self->item_border_y; *y += self->item_border_y;
} }
static void
abort_button_tracking(FivBrowser *self)
{
self->tracked_button = 0;
self->drag_begin_x = self->drag_begin_y = -1;
}
static int static int
relayout(FivBrowser *self, int width) relayout(FivBrowser *self, int width)
{ {
@ -154,8 +147,8 @@ relayout(FivBrowser *self, int width)
int available_width = width - padding.left - padding.right; int available_width = width - padding.left - padding.right;
g_array_set_size(self->layouted_rows, 0); g_array_set_size(self->layouted_rows, 0);
// Whatever these used to point at might no longer be there. // Whatever self->drag_begin_* used to point at might no longer be there,
abort_button_tracking(self); // but thumbnail reloading would disrupt mouse clicks if we cleared them.
GArray *items = g_array_new(TRUE, TRUE, sizeof(Item)); GArray *items = g_array_new(TRUE, TRUE, sizeof(Item));
int x = 0, y = padding.top; int x = 0, y = padding.top;
@ -1139,6 +1132,13 @@ open_entry(GtkWidget *self, const Entry *entry, gboolean new_window)
return TRUE; return TRUE;
} }
static void
abort_button_tracking(FivBrowser *self)
{
self->tracked_button = 0;
self->drag_begin_x = self->drag_begin_y = -1;
}
static gboolean static gboolean
fiv_browser_button_press_event(GtkWidget *widget, GdkEventButton *event) fiv_browser_button_press_event(GtkWidget *widget, GdkEventButton *event)
{ {