arfbtwn / banshee

http://banshee.fm/
MIT License
6 stars 4 forks source link

B.WebBrowser: Zooming with GDK_SCROLL_SMOOTH broken #37

Closed Carbenium closed 6 years ago

Carbenium commented 6 years ago

Pressing Ctrl and scrolling results only in zoom out events. Relevant code: https://github.com/arfbtwn/banshee/blob/f9fb010643ed17a70244af654c2e95c586b84dfe/src/Core/Banshee.WebBrowser/Banshee.WebSource/WebView.cs#L69

The problem is caused by recent Gtk libs sending scoll events with GDK_SCROLL_SMOOTH instead of _UP/_DOWN. Normally this would be fine since the deltaY value of the event would specify the direction. In our case gtk-sharp unfortunatly just doesn't expose this field, so there is just no sane way to handle smooth scrolling.

As far as I undestand the Gtk code, there isn't a way to disable smooth scrolling on a per-widget base.

Proposal: Until we find a way to upgrade to a newer gtk-sharp lib (e.g https://github.com/openmedicus/gtk-sharp) remove the scroll handling and add zoom button to the navigation bar.

arfbtwn commented 6 years ago

ahh, I see - it's GDK in this case, I guess we need to find a way to call this function, if we're lucky there'll be a handle we can use to get at the native event structure 🤞

We might consider always using switch statements for enums like this to avoid the odd behaviour, it wouldn't have saved us from the bug but scrolling would have simply stopped working which may have been better from a user's perspective.

Carbenium commented 6 years ago

Genius :+1:

I updated #38 accordingly.

arfbtwn commented 6 years ago

Should be resolved in master after merge of #65, thanks again