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

WPF - Mouse wheel in PDF viewer doesn't work after scrolling with touch screen #4106

Open
klotzoliver opened this issue May 16, 2022 · 10 comments
Labels
known-issue upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium. wpf

Comments

@klotzoliver
Copy link

After using touch display in PDF viewer to scroll (document and thumbnail area) scrolling using mouse wheel doesn’t work anymore.

OS: Windows 10 (19044.1645)

Using Google Chrome 101.0.4951.54 and CEF sample app version 101.0.18.0 feature works as expected.

Tested with CEFSharp WPF sample app

@amaitland
Copy link
Member

What version of CefSharp did you test with?

CEF sample app version 101.0.18.0 feature

Did you test with the command line args for WPF as listed in the bug report template?

This sounds like an upstream bug.

@amaitland amaitland changed the title Mouse wheel in PDF viewer doesn't work after scrolling PDF by using touch monitor WPF - Mouse wheel in PDF viewer doesn't work after scrolling with touch screen May 16, 2022
@amaitland
Copy link
Member

Please confirm you've tested using the following

 cefclient.exe --multi-threaded-message-loop --no-sandbox --off-screen-rendering-enabled --enable-gpu

@klotzoliver
Copy link
Author

I've tested the cefclient without any parameter and by calling cefclient.exe --multi-threaded-message-loop --no-sandbox --off-screen-rendering-enabled --enable-gpu
cefclient without any parameter works as expected. Using parameter above only mouse wheel works. Scrolling using touch screen doesn't work.

Everything was tested with Cef/CefSharp version 101.0.180

@amaitland amaitland added wpf upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium. known-issue labels May 16, 2022
@amaitland
Copy link
Member

amaitland commented May 16, 2022

Based on additional feedback the CEF OSR implementation which WPF uses needs fixes to support the new PDF viewer implementation. Looks like you already raised chromiumembedded/cef#3331 report your findings there.

As an alternative you should be able to use https://github.com/cefsharp/CefSharp.Wpf.HwndHost which is the equivalent of hosting the WinForms version in WPF. It uses windowed rendering as opposed to OSR.

Making as upstream as issue needs to be fixed in CEF.

@amaitland
Copy link
Member

Does the cef log provide any relevant information? (By default there should be a debug.log file in your bin directory)

Any errors in the log?

Any further issues I'd ask that you please use the Bug Report Template.

@zhaozehong
Copy link

zhaozehong commented Jun 15, 2022

I can make sure there is a bug for CefSharp.Wpf.
I cannot tell how to reproduce the bug, since I have not found the rule, but it's very easy to reproduce. Basically, I can reproduce the problem within 1 minute by clicking here and there for several times.

the way I am using to reproduce with the CefSharp source code:

  1. set CefShart.Wpf.Example as startup project.
  2. change Reload command to be able to switch between two pdf file, see the code below.
    if (browser.Address.EndsWith("1.PDF")) browser.LoadUrl(@"C:\Folder\2.PDF"); else browser.LoadUrl(@"C:\Folder\1.PDF");
  3. run the app
  4. change properties from toolbar and hit RELOAD button to switch pdf files. You can find the scroll issue very quickly in this way.

I am sure, the problem must be in the handler of SendMouseWheelEvent(see the last line of the following code of WebBrowserExtensions.cs), I cannot go inside the method.
`public static void SendMouseWheelEvent(this IBrowser browser, int x, int y, int deltaX, int deltaY, CefEventFlags modifiers)
{
browser.ThrowExceptionIfBrowserNull();

  var host = browser.GetHost();
  ThrowExceptionIfBrowserHostNull(host);

  **host.SendMouseWheelEvent(new MouseEvent(x, y, modifiers), deltaX, deltaY);**

}`

If you want any other materials or the screen capture video, please reach me out via skype: xjtu_ok

Really hope the bug can be fixed ASAP. Thanks!
Yes, I am using the latest source code of 101 branch.

@amaitland
Copy link
Member

@zhaozehong See #4106 (comment)

This needs to be fixed in CEF. It's not something that can be fixed in CefSharp directly.

@zhaozehong
Copy link

@zhaozehong See #4106 (comment)

This needs to be fixed in CEF. It's not something that can be fixed in CefSharp directly.

Right. Thanks for your reply.
Any plan to fix that in CEF? Cos it really leads to a bad user experience.

@amaitland
Copy link
Member

Any plan to fix that in CEF? Cos it really leads to a bad user experience.

You'll need to ask the CEF maintainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
known-issue upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium. wpf
Projects
None yet
Development

No branches or pull requests

3 participants