Feature #8499

Strange behavior when double clicking

Added by André Reinald about 9 years ago. Updated about 7 years ago.

Closed: invalid
Start date:
Due date:
% Done:


Estimated time:
Affected Version:
hardware architecture:


Double clicks don't select any more :

- in lightable mode, I have to simple click once to select, then double click or press E to go to darkroom mode,

- in darkroom mode, the filmstrip is unusable, double clicking on any image re-opens the currently opened image.

Precisions :

- I just upgraded to Ubuntu Natty, but I also update DT from git daily (sometimes more), so I'm not sure where the misbehaviour originates.

- I am still using Gnome2, not "Unity".


#1 Updated by tetaberta - about 9 years ago

I confirm this problem partially. Darktable works fine for me until I try to create a new style from current history stack (in darkroom). After creating new style, filmstrip becomes unusable (cannot switch images). I have to restart darktable to make it work.

Ubuntu Natty w/ Unity
darktable 0.8+469~g78ed19f

#2 Updated by tmtke - about 9 years ago

I can also confirm this, with some additional info.

  • Using Natty, but with Unity
  • Updating from git frequently
  • When in darkroom mode I select an other image on the filmstrip to open up, it seems like it's working on it, but after a few seconds it drops the "working..." text, and everything stays the same, with defects, like you cannot scale the curve editor's manipulator circle, also it won't alter the curve anymore.
  • Switching back to lighttable mode does not help, you have to restart.

#3 Updated by oliviertoulouse - about 9 years ago

confirmed with 11.04 unity. doubleclick in filmstrip does not work.

#4 Updated by oliviertoulouse - about 9 years ago

it seems to happen after some time of normal behaviour, when using copy/paste historystack.... At first, changing picture in filmstrip works but changes are not saved. Then, changing picture simply does not work anymore.

#5 Updated by oliviertoulouse - about 9 years ago

attachment: gdb
1) I imported a new folder
2) I entered darkroom
3) I tried to change image using filmstrip -> failed

#6 Updated by oliviertoulouse - about 9 years ago

using filmstrip, changing with doubleclick, when it works, leads too often to not save the changes done on previous image....
Moreover, when the bug is active (so no double-click), the widget colorzone is unusable: it is not possible to drag the curve, nor any preset has an effect on the output image.

#7 Updated by oliviertoulouse - about 9 years ago

note that key accels (space and backspace) to change images in darkroom still work. So bug seems related to mouse click.

#8 Updated by pijarski - almost 9 years ago

I am experiencing the same behaviour (dt git on ubuntu natty); also noot possible to drag curves

#9 Updated by devmusings - almost 9 years ago

I observe similar mouse click problems on Debian Wheezy with Fluxbox window manager. Both 0.8 and 0.9 (from unstable) are affected.

- I cannot rate by clicking stars in thumbnails (but it works in one-image preview).
- I cannot move any curve point (but I can move some handles, e.g. triangles below curve in color zones).
- I cannot switch image in darkroom by double-clicking thumbnails : it says 'working', and then reloads the current image rather than switching to the double-clicked one.

In my experience, it fails from the start so restarting darktable does not help.

Curiously, all these (double-)clicks work correctly in GNOME (if launched from GDM, starting gnome-session from Fluxbox and then darktable does not work).

On Enlightenment list, it was reported to fail also in Enlightenment e17, along with some suggestions as where could the error come from.

#10 Updated by devmusings - almost 9 years ago

I investigated a bit and tracked down (at least part of) the problem. The issue is caused in my case by my window manager generating a leave-notify-event/enter-notify-event pair before each button-press-event, which is not expected by the code.

When receiving a leave-notify-event, lighttable resets the currently-selected image number (lib_image_mouse_over_id) to -1. It is not restored properly in the handler for enter-notify-event and is still -1 when the button-press-event occurs. This explains why I cannot rate images from the thumbnails.

The double-click problem in darkroom thumbnails is similar. The leave-notify-event makes the currently-hoovered thumbnail to be forgotten. Enter-notify-event is not monitored at all so it is not restored on re-entry. When the double-click arrives, the currently-edited image is reloaded in place of the one corresponding to the clicked thumbnail.

Similar problem again with "color zones". When you click on a drag point, the inserted leave-notify-event results in the position on the curve being discarded. It is not restored on enter-notify-event (which is again not monitored) so that the click does nothing, coordinates being out of range.

Similar problems seem to have affected many applications (among them Firefox, Eclipse, ...) with many window managers (*box, ion, enlightenment, sawfish) since GTK+ 2.0's beginning.

I see two solutions :
- Be more symmetric, restoring on enter-notify-event what was discarded in leave-notify-event. This would be the more robust solution, but requires a bit of work from core developers and may incur a performance penalty if done naively (discarding state on leave-notify-event to rebuild it immediately on enter-notify-event).
- Ignore WM-generated leave/enter events. The events may be be filtered in X11 on their mode which is notify-normal for normal mouse moves and notify-grab/notify-ungrab for WM-generated events. This should translates seamlessly to GDK_CROSSING_NORMAL vs GDK_CROSSING_GRAB/GDK_CROSSING_UNGRAB modes in GTK+2.0 world. However, GDK crossing modes are only updated when GDK_NATIVE_WINDOWS is set, which it is not by default and is generally not recommended (although it does not seem to hurt). Moreover, there may be unforeseen side-effects to the approach (maybe there are some cases where we want to treat leave/enter events even with the notify-grab/notify-ungrab modes). Notwithstanding these remarks, here follows a proof-of-concept patch which solves all three issues for me. It is not complete, other plugins being affected, but it is sufficient to show the idea.

diff --git a/src/gui/gtk.c b/src/gui/gtk.c
index 55a6f4e..3c3462c 100644
--- a/src/gui/gtk.c
+++ b/src/gui/gtk.c
@@ -1203,14 +1203,16 @@ mouse_moved (GtkWidget *w, [[GdkEventMotion]] *event, gpoint
 static gboolean
 center_leave(GtkWidget *widget, [[GdkEventCrossing]] *event, gpointer user_data)
-  dt_control_mouse_leave();
+  if (event->mode == GDK_CROSSING_NORMAL)
+    dt_control_mouse_leave();
   return TRUE;

 static gboolean
 center_enter(GtkWidget *widget, [[GdkEventCrossing]] *event, gpointer user_data)
-  dt_control_mouse_enter();
+  if (event->mode == GDK_CROSSING_NORMAL)
+    dt_control_mouse_enter();
   return TRUE;

diff --git a/src/iop/colorzones.c b/src/iop/colorzones.c
index 3b6ee88..0167d0c 100644
--- a/src/iop/colorzones.c
+++ b/src/iop/colorzones.c
@@ -715,10 +715,12 @@ colorzones_button_release(GtkWidget *widget, [[GdkEventButto]]
 static gboolean
 colorzones_leave_notify(GtkWidget *widget, [[GdkEventCrossing]] *event, gpointer us
-  dt_iop_module_t *self = (dt_iop_module_t *)user_data;
-  dt_iop_colorzones_gui_data_t *c = (dt_iop_colorzones_gui_data_t *)self->gui_d
-  if(!c->dragging) c->mouse_x = c->mouse_y = -1.0;
-  gtk_widget_queue_draw(widget);
+  if (event->mode == GDK_CROSSING_NORMAL) {
+    dt_iop_module_t *self = (dt_iop_module_t *)user_data;
+    dt_iop_colorzones_gui_data_t *c = (dt_iop_colorzones_gui_data_t *)self->gui
+    if(!c->dragging) c->mouse_x = c->mouse_y = -1.0;
+    gtk_widget_queue_draw(widget);
+  }
   return TRUE;

Remember that you have to call darktable with


or similar, for this patch to change anything (else, GDK crossing mode is always GDK_CROSSING_NORMAL whatever the X11 mode, at least with GTK+2.24).

#11 Updated by Simon Spannagel over 8 years ago

do we still have issues with this? then this maybe should go into 1.0.1

#12 Updated by tetaberta - about 8 years ago

The problem with filmstrip doesn't happen any more with darktable 1.0 in Ubuntu 11.10 with Unity. Not sure about the other problems with gui discussed by devmusings

#13 Updated by Simon Spannagel about 8 years ago

  • Target version changed from 1.0.3 to Candidate for next patch release

#14 Updated by Tobias Ellinghaus almost 8 years ago

  • % Done changed from 0 to 20
  • Priority changed from High to Low
  • Status changed from New to Incomplete

Any updates on this one?

#15 Updated by Simon Spannagel about 7 years ago

  • % Done changed from 20 to 0
  • Status changed from Incomplete to Closed: invalid

yes: a closure coming up...

Also available in: Atom PDF

Go to top