Skip to content

JCEF can not get back from pdf viewers presentation mode #502

Description

@JScheiterbauer

Describe the bug
When viewing a PDF with the presentation mode jcef can't return to non presentation mode.

To Reproduce
Steps to reproduce the behavior:

  1. Open detailed MainFrame application
  2. Navigate to a PDF
  3. In PDF Viewer go to the toolbar (right beside the print button)
  4. Press "present" button
    -> PDF Viewers Presentation Mode is activated and JCEF can't return from it to non presentation mode.
    Also terminating the application behaves strange.

Expected behavior
Even presentation mode is not available or jcef can recover from that state.

Screenshots
See screenshots for better understanding:
Image
Image
Image

Versions (please complete the following information):

  • Windows 11, Windows 10
  • Java Version: OpenJDK 1.8.0_432, 32 bit
  • JCEF Version: 7e0ef9d with CEF 130.1.9+gfc42567+chromium-130.0.6723.70
  • JCEF Version cffac27 with CEF 143.0.14+gdd46a37+chromium-143.0.7499.193

Additional context
The problem reproduces with JCEFs simple and detailed sample application.

Does the problem reproduce with the CEF cefclient or cefsimple sample application at the same version?
cefclient.exe starts presentationMode but can recover from it the same way as chrome (shows the ESC message and pressing ESC returns to normal view).

Does the problem reproduce with Google Chrome at the same version?
No, Chrome shows a popup that presentationMode can be left with "ESC" button. Pressing ESC button leaves the presentation mode.
Image

Add any other context about the problem here.
We currently worked around that bug by creating our own CEF build that simply doesn't contain the "Present" Button in the PDF toolbar.

File of CEF build:
./src/chrome/browser/resources/pdf/elements/viewer_toolbar.html:
https://source.chromium.org/chromium/chromium/src/+/refs/tags/130.0.6723.70:chrome/browser/resources/pdf/elements/viewer_toolbar.html;l=137
Image

Activity

JScheiterbauer commented on Mar 7, 2025

@JScheiterbauer
Author

After some additional research I found out that there already is a basic handling of the full screen mode that is also handled in the sample applications:
org.cef.handler.CefDisplayHandler.onFullscreenModeChange(CefBrowser, boolean)
But you still cannot return to non presentation/fullscreen mode because either ESC button is not passed or not interpreted correctly.

JScheiterbauer commented on Mar 19, 2026

@JScheiterbauer
Author

We are currently in the upgrading process to the newest JCEF version (currently https://github.com/chromiumembedded/java-cef/tree/cffac273e4f90348ee02a29ffd919388432fce9f, with CEF version "CEF 143.0.14+gdd46a37+chromium-143.0.7499.193").

The problem is still reproducible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug report

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions