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

Fix first click being treated as both a single and double click by deleting vfunc_button_release_event #519

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

jingw
Copy link

@jingw jingw commented Apr 11, 2024

Fixes #516

The problem is that both vfunc_button_press_event and vfunc_button_release_event call _maybeHandleDoubleClick the first time around, so a press+release becomes a double click. But the second time, this._indicator.supportsActivation has been set to true instead of undefined, so vfunc_button_release_event doesn't trigger the double click.

The deleted code cannot be useful because...

  • if supportsActivation is false, _maybeHandleDoubleClick immediately returns EVENT_PROPAGATE
  • if supportsActivation is true, vfunc_button_release_event skips _maybeHandleDoubleClick and returns EVENT_PROPAGATE
  • if it's undefined and changes value, we get the aforementioned bug.

…leting vfunc_button_release_event

Fixes ubuntu#516

The problem is that both vfunc_button_press_event and vfunc_button_release_event call _maybeHandleDoubleClick the first time around, so a press+release becomes a double click. But the second time, this._indicator.supportsActivation has been set to true instead of undefined, so vfunc_button_release_event doesn't trigger the double click.

The deleted code cannot be useful because...
- if supportsActivation is false, _maybeHandleDoubleClick immediately returns EVENT_PROPAGATE
- if supportsActivation is true, vfunc_button_release_event skips _maybeHandleDoubleClick and returns EVENT_PROPAGATE
- if it's undefined and changes value, we get the aforementioned bug.
@plumlis
Copy link

plumlis commented Apr 11, 2024

Teseted and I fixed the issue.
But after this patch. menu popup will have latency ( 0.5 sec).

@jingw
Copy link
Author

jingw commented Apr 11, 2024

Yes, that latency waiting for a potential double click was there before this patch as well. Personally, I don't like that design decision, but it's a separate problem.

@3v1n0
Copy link
Collaborator

3v1n0 commented Apr 18, 2024

Yeah, code is fine... I've another idea to prevent the double-click timeout, since there's no really a supported way to know if that's possible.

@3v1n0 3v1n0 merged commit a576e21 into ubuntu:master Apr 18, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

First click after startup is treated as both a single click and a double click
3 participants