Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addons: Implement deselect with single click #481

Merged
merged 1 commit into from
Sep 11, 2016

Conversation

eht16
Copy link
Member

@eht16 eht16 commented Aug 28, 2016

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.

@codebrainz
Copy link
Member

Not sure if it's useful, but Scintilla has a double-click notification.

@eht16
Copy link
Member Author

eht16 commented Aug 29, 2016

I used SCN_DOUBLECLICK before in the code, see d18495a?diff=split#diff-7e319383ec157ada7c430d2e26918d02L119 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 code 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
Copy link
Member Author

eht16 commented Aug 29, 2016

I actually found a better way: see a0ef5fd and its message.

For this to work, we need to connect to the "button-press-event" for
each document, then process each single click and delay the detected
double click event by 50ms before processing it.
This way all markers will be removed (in case of double click
actually twice) and new markers will be set on double click.

Due to the new behaviour introduced here, the feature is disabled
by default.

Closes geany#445.
@eht16 eht16 force-pushed the issue445_markall_single_click branch from a0ef5fd to 26e6906 Compare September 7, 2016 19:44
@eht16 eht16 merged commit 8932d2e into geany:master Sep 11, 2016
@eht16 eht16 deleted the issue445_markall_single_click branch September 11, 2016 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants