For this to work, we need to connect to the "button-press-event" for each document and then differentiate between single and double clicks, using a timeout handler which is triggered first after the GTK double-click-time has passed, i.e. GTK won't recognise the event as part of a double click.
I didn't find a easier solution to differentiate between single and double click. Better ideas are welcome.
Closes #445. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany-plugins/pull/481
-- Commit Summary --
* Addons: Implement unselect with single click * Make 'single click deselect' feature configurable
-- File Changes --
M addons/src/addons.c (45) M addons/src/ao_markword.c (123) M addons/src/ao_markword.h (6)
-- Patch Links --
https://github.com/geany/geany-plugins/pull/481.patch https://github.com/geany/geany-plugins/pull/481.diff
Not sure if it's useful, but [Scintilla has a double-click notification](http://www.scintilla.org/ScintillaDoc.html#SCN_DOUBLECLICK).
I used `SCN_DOUBLECLICK` before in the code, see https://github.com/geany/geany-plugins/pull/481/commits/d18495a9e5481000670d... but there is no single click notification. I couldn't find any other Scintilla notification which is close to a single click event.
I removed the `SCN_DOUBLECLICK` only because we already get the same event notification in the GTK "button-press-event" handler and so do the logic at one place.
@eht16 pushed 1 commit.
a0ef5fd Handle double click event after the single click
I actually found a better way: see https://github.com/geany/geany-plugins/pull/481/commits/a0ef5fdb6103589fd9fe... and its message.
Merged #481.
github-comments@lists.geany.org