-
Notifications
You must be signed in to change notification settings - Fork 2
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
Difficulty in Triggering Double-Click Events #2
Comments
Additionally, I can no longer drag and move a window that is not focused. My application allows users to drag the window from anywhere on the screen since it does not have a title bar. In Electron v22, even with However, since integrating I need to keep |
One more thing.
In the case of a left click ( Since there is no code that takes right-click into account,
The result is that the handler is called twice. |
thank you for the thorough feedback @sdr0x07b6! Good catch on the issue with the window drag not happening when the window was not focused. Came up with a fix for that and published it under version However the other two reports I have issue reproducing:
Can you provide a reproducible example that I can try? |
@gerhardberger Hello. First of all, I installed v1.0.6 and I can confirm that it works well regarding dragging unfocused windows. Please let me put on hold the issue of double clicks sometimes not emit. The reproducibility seems to be decreasing now. The reason is unknown. Until the other day it was reproducing frequently. Once it reproduced, it would never emit no matter how many times I repeated the double-click unless I moved the mouse coordinates. Other problems were unexpected behavior related to One more thing, when I run This also has the same minimal application and reproduction video as above. The video may be difficult to understand as I am unable to video record me spinning the mouse wheel. After my recent report, I had hacked a lot of mouse events, mainly in the renderer process, in order to implement the application according to its unexpected behavior. However, I came to the conclusion that this was not enough, so I started to modify However, as I worked on it, I noticed a few other issues that I thought were problematic in addition to the above. But if I rewrote it in such a drastic way, it would no longer be |
After integrating
electron-drag-click
, it seems that the functionality has returned to how it worked in Electron v22, allowing for both drag and click actions to coexist.However, I have noticed that
dblclick
events often do not fire on elements with-webkit-app-region: drag;
set. Whileclick
events perform better thandblclick
events, they still occasionally fail to trigger.I have conducted various investigations and believe that the logic within
electron-drag-click
is likely influencing this behavior. The insights derived from the AI's analysis of electron_drag_click.mm align with the issues I am experiencing:dblclick
events are difficult to trigger.click
events are better thandblclick
events, but they still sometimes do not fire.Is there anything I can do on my application's side to improve this situation?
Response from AI:
Mouse Event Handling:
The
swizzledMouseEvent
method initiates window dragging when the left mouse button is pressed. This behavior may interfere with the recognition of double-click events, making it difficult for the application to detect double-clicks correctly.Event Bubbling:
If the swizzled method does not properly call the original event handling, double-click events may not bubble up correctly. This can particularly affect the recognition of double-clicks when handling
NSEventTypeLeftMouseDown
andNSEventTypeLeftMouseUp
.Conflict Between Drag and Click:
When drag operations and double-click operations compete, especially if the timing for double-clicks is short, the drag action may take precedence, preventing the double-click from being recognized.
The text was updated successfully, but these errors were encountered: