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

[Bug] Freezing when closing tab #33

Open
PhilJbt opened this issue Nov 5, 2024 · 18 comments
Open

[Bug] Freezing when closing tab #33

PhilJbt opened this issue Nov 5, 2024 · 18 comments

Comments

@PhilJbt
Copy link

PhilJbt commented Nov 5, 2024

This bug appeared a few days after installing CMG.
Sometimes, I did not complete to determine why, closing a tab with CMG makes my browser (Vivaldi) freeze for few seconds.

2024-11-05.12-45-55.webm

Here are the logs:

Closing tab:

Pushed button 2
Showing gestures circle...
text selection:
 
hovered element:
DIV
parent element:
SHREDDIT-APP
child element:
<div class="...
setting up canvas...
CMG circle redrawn
CMG circle redrawn
CMG circle redrawn
showing hint tooltip for Close tab
action to perform by CMG:
closeCurrentTab
Action to perform:
closeCurrentTab

Parent tab:

content.js:1
[Violation] Handling of 'wheel' input event was delayed for 4839 ms due to main thread being busy. Consider marking event handler as 'passive' to make the page more responsive.

@emvaized
Copy link
Owner

emvaized commented Nov 8, 2024

I could not recreate this issue, but it seems like the extension thinks you continue pressing the right mouse button, and tries to call the scroll wheel action. Does it still happen if you disable the Hide menu on mouse up if nothing selected option?

@PhilJbt
Copy link
Author

PhilJbt commented Nov 8, 2024

I confirm it still happens if I disable the Hide menu on mouse up if nothing selected option.
But a weird thing happened earlier today: when I closed a tab, the menu shown on the parent tab. But I did not use the RMB menu on this tab.
This makes me think this freezing bug may occur because releasing RMB behavior is not properly handled (maybe depending on the case, or the browser Chrome integration).
Maybe restrict the call of the menu on the currently focused tab might be a clue. Also, find a way to handle RMB releasing globally not to be interpreted by another tab as "the user press RMB" when switching on another tab (because of closing it) could be a thing.

@emvaized
Copy link
Owner

emvaized commented Nov 8, 2024

That's interesting, I never saw a tab catching mouse events from another tab.
Could you try this test version and check if the issue still persists? This build also contains a possible fix for your another issue ticket.

test.zip

@PhilJbt
Copy link
Author

PhilJbt commented Nov 8, 2024

The tab I return to after closing one still freezes.

@emvaized
Copy link
Owner

emvaized commented Nov 8, 2024

Okay, then what about this build?

test_2.zip

@PhilJbt
Copy link
Author

PhilJbt commented Nov 8, 2024

Unfortunately, this doesn't change anything.

@emvaized
Copy link
Owner

emvaized commented Nov 8, 2024

Then, I'm afraid, for now I'm out of ideas why it could happen. What you've described (content script in one page intercepts mouse event from another page) shouldn't really be allowed by the browser.

But I already had Vivaldi-specific bug report previously, which I couldn't resolve as well. Probably Vivaldi messes with mouse events under the hood in some manner, which messes up the CMG's spaghetti code finely tuned and fragile mouse event handling mechanism.

@PhilJbt
Copy link
Author

PhilJbt commented Nov 8, 2024

I wouldn't be surprised if it turns out to be a Vivaldi specific issue... Thanks for trying to fix it, I'll keep you informed if the situation evolves in any way!

@emvaized
Copy link
Owner

emvaized commented Nov 8, 2024

Sure, thanks.

In my case, even the hovered segment highlight is not working in Vivaldi, and mouse events are handled weirdly. But I just tried in latest version of Chrome and everything seems to work fine, as well as in Firefox.

@emvaized
Copy link
Owner

emvaized commented Nov 9, 2024

What I can suggest for now, is to disable Continuous vertical scroll detection. It will break the mouse wheel gestures, but probably will fix the stuttering.

Снимок экрана 2024-11-09 180212

@PhilJbt
Copy link
Author

PhilJbt commented Nov 9, 2024

That's what I thought too, but it doesn't seem to change anything. I kept that option disabled though.

@emvaized
Copy link
Owner

emvaized commented Nov 9, 2024

Hm... How about this one?
test_3.zip

@PhilJbt
Copy link
Author

PhilJbt commented Nov 9, 2024

With the test_3 build, I tried:

  • Both Hide menu on mouse up if nothing selected enabled and disabled;
  • Both Show regular menu if no action selected enabled and disabled;
  • Both Continuous vertical scroll detection enabled and disabled.

In all case, the freeze occurs.

@emvaized
Copy link
Owner

emvaized commented Nov 9, 2024

Hm, okay. So, my last idea is to disable passive attribute of scroll listener if continuous scroll detection is disabled, and horizontal scroll events are disabled as well.

Here's a test build with this change:
test_4.zip

@PhilJbt
Copy link
Author

PhilJbt commented Nov 9, 2024

It seems fixed on the majority of websites! The few remaining are maybe only a problem from the Vivaldi side, not yours.
This is even difficult for me to know exactly what to do to make it freezes...

@emvaized
Copy link
Owner

emvaized commented Nov 9, 2024

Okay, great! It's not a great fix, as it requires you to disable the continuous scroll detection, but at least that's something

@emvaized
Copy link
Owner

I uploaded new 1.5.2 version with these fixes, as well as an additional check to not execute actions if page is not currently focused. I hope this will resolve the problem.

@PhilJbt
Copy link
Author

PhilJbt commented Nov 13, 2024

To be sure, I disabled every extension installed. Unfortunately, Vivaldi is still freezing.
I tried under Chrome, with my config imported, no freeze has occurred. So I sent a bug report to Vivaldi.
Thank you again for taking the time to try to solve the problem.

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

No branches or pull requests

2 participants