blueboxd / chromium-legacy

Latest Chromium (≒Chrome Canary/Stable) for Mac OS X 10.7+
BSD 3-Clause "New" or "Revised" License
300 stars 17 forks source link

Swipe back and forth don't swipe #77

Open scrutinizer11 opened 2 years ago

scrutinizer11 commented 2 years ago

Describe the bug The swipe gesture to travel through history has no effect.

To Reproduce

  1. Open any page in Chromium. The page should have a visit history accumulated.
  2. Apply the gesture.
  3. Swipes don't happen.

Expected behaviour The standard behaviour.

Desktop (please complete the following information):

Logs Logs-to-Consider.log

Wowfunhappy commented 2 years ago

I have run into this before, but I haven't reported it because I can't figure out how to reproduce it reliably!

Question for you—does the problem go away if you reboot your computer? When the problem happens to me on Mavericks, a reboot fixes it. Nothing less than a full reboot appears to work.

scrutinizer11 commented 2 years ago

I now can swipe. But I swear, I couldn't. I don't know what's going on and if it returns.

Wowfunhappy commented 2 years ago

You weren't hallucinating, this one has happened to me too! It comes and goes. Rebooting is usually the most surefire way to fix it.

To have any chance of fixing this permanently, we'll probably need to figure out how to consistently reproduce the bug.

scrutinizer11 commented 2 years ago

I now have a suspicion which is just guessing at best, but I think the irregularity with the app now showing in Dock and the app switcher and then not, and also the swipe gesture on dry rations, have something to do with changing settings. As you change settings and relaunch it, it's when you've got the problem. You have to relaunch Chromium (computer restart is not necessary) to flush it out. It's just a theory.

Wowfunhappy commented 2 years ago

I can't speak for settings, but:

You have to relaunch Chromium (computer restart is not necessary) to flush it out.

No, when this has happened to me, restarting Chromium is insufficient. Believe me, I tried that first. A full restart has always been necessary.

Waiting some large number of hours seems to work too.

krackers commented 2 years ago

To confirm, the swipe gesture still works in other apps? Does enabling/disabling gesture in trackpad settings work to bring it back?

Wowfunhappy commented 2 years ago

To confirm, the swipe gesture still works in other apps?

Yes.

Does enabling/disabling gesture in trackpad settings work to bring it back?

IIRC, I tried that and it didn’t work.

Wowfunhappy commented 1 year ago

I just had this happen to me, and was able to fix the problem by some combination of:

  1. Quitting and re-opening Chrome
  2. Disabling and re-enabling "Swipe between pages" in System Preferences
  3. Activating the "notification center" gesture

1 & 2 by themselves mostly fixed the swiping, but it was being a bit inconsistent (sometimes it would activate, sometimes it wouldn't) and the visual indicator arrow wasn't appearing.

Then I accidentally opened notification center, and swiping in Chrome began working 100% perfectly again.

If this was all just a fluke I'm going to feel pretty stupid, but wanted to document...

Wowfunhappy commented 1 year ago

Okay, this has happened three times now.

When the Chromium touchpad gestures break, they can be fixed by dragging from the right side of the touchpad with two fingers to open Notification Center. No other action is necessary. Wat.

Hey @krackers, any idea why this would happen? I know you happen to be very well acquainted with the notification center Trackpad gesture. ;)

krackers commented 1 year ago

Sorry for late response (feel free to ping me via other means if I don't respond within a week, GH usually does not notify).

So my previous rendezvous with trackpad gesture RE'ing was closer to the driver level, at the place where raw trackpad events are converted into CG/NSEvents. Since you mentioned that swipe between pages still works in other apps, I don't think there would be an issue at this level.

This issues reminds me of the very annoying issue in Monterey where pinch-zoom stops randomly working, and the only way to get it working is to untoggle & retoggle it (or if you're lazy, RE private prefpane framework and write a script to do this for you). Just like in this issue, when pinch-zoom stops working in chrome it still works in other apps. From what I can tell, the issue there is something about the interaction with CGEventTaps and event delivery. BetterTouchTool developer posted about a similar issue, and it seems it happens less frequently if you don't have any event taps enabled.

So first questions for both of you: do you use any apps like Rectangle, Bettertouchtool, etc.?

The gesture in question you're referring to is the "Swipe between Pages" gesture right? This can be done with either 2 or 3 fingers, which do you have it set to?

If it's 2 fingers, how does osx distinguish between a scroll event and a swipe event?

On the chrome-side do we know where this gesture is recognized? I found https://bugzilla.mozilla.org/show_bug.cgi?id=668953 which documents it for firefox.

Can you try logging all the CGEvents generated during a swipe, once during "baseline" when things are working, and once when it's frozen? (Can just use a CGEventTap to do so). I want to see where the issue lies: is the event being generated but not being routed to chrome, or is the event not being generated at all? I'd bet on the former.

krackers commented 1 year ago

Ah https://stackoverflow.com/questions/12748072/how-to-properly-use-swipewithevent-to-navigate-a-webview-obj-c https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm;l=30?q=trackSwipeEventWithOptions&ss=chromium%2Fchromium%2Fsrc

is how it's implemented.

I think the next step in debugging is to create a quick app that logs CGEvents during baseline swipe, and then once you get into the stuck state, run the app to inspect the events at 3 places: session event tap, annotated sessionEventTap, and PSN (app) level event tap. Although if it is an issue with how cgevents are routed, it's possible the very act of creating an event tap somehow messes with the state of the system. But worth a shot.

Is it only notification center gesture that makes things work? What about expose or space switch?

Wowfunhappy commented 1 year ago

Fwiw this hasn't happened to me since at least mid-December. Not sure if I've been lucky or if the issue disappeared.

Wowfunhappy commented 11 months ago

I have not had this pop up in months and months. I think it's fixed!

Wowfunhappy commented 7 months ago

This should be closed.