question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lost Focus after Fullscreen exit

See original GitHub issue

Bug Report

Problem

What is expected to happen?

After entering in fullscreen mode of a video then press the back button of android the fullscreen mode exits. If you then press the back button again it should dispatch the ‘backbutton’ event.

What does actually happen?

After entering in fullscreen mode of a video then press the back button of android the fullscreen mode exits. If you then press the back button again it does not dispatch the ‘backbutton’ event and closes the app.

Information

The focus does not requested after “hide the custom view”. So the context of the ‘backbutton’ is not the WebView.

Command or Code

in #822 is fix to avoid this bug: https://github.com/apache/cordova-android/issues/822#issuecomment-552271879 In CordovaWebViewImpl.java:hideCustomView add engine.getView().requestFocus(); after engine.getView().setVisibility(View.VISIBLE);

Fork of same user have inserted the code: https://github.com/josephlodero/cordova-android/blob/backbuttonfix/framework/src/org/apache/cordova/CordovaWebViewImpl.java

Environment, Platform, Device

Android, testet on Samsung SM-G780F (Galaxy S20 FE). Other developers on other android devices have the same issue.

Version information

cordova-cli: 10.0.0 cordova-android: 9.0.0

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
th3hamm0rcommented, Apr 14, 2021

We’re currently facing an issue, which seems a bit related: In our case, if we listen for the “backbutton” event directly on the app start (after deviceready), it won’t be called unless the user first clicks at the webview/app.

On older devices (eg. Android 6) this is working. On devices with Android 10 and 11, the user has to touch the app screen first, otherwise the “backbutton”-event won’t be fired.

0reactions
ucsbrickscommented, May 27, 2021

Any news when this PR will be merged?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stop exiting fullscreen mode when losing focus #1473 - GitHub
If 2.3 is full screen and I alt-tab then the window switches from full screen to windowed. On version 1.6 however it stays...
Read more >
Entering/Exiting Full Screen Mode causes the IDE's window to ...
When using it IDE loses focus and I have first to mouse-click into the application even if it is in the full screen...
Read more >
Windows 10 Randomly Loses Focus on Current Application ...
Randomly, the game will exit full screen, minimize, and pause it's self. This is normal when I try to access another window on...
Read more >
(firefox) window/tabs lose focus or exit fullscreen
Sometimes my active firefox windows/tabs exit fullscreen after a few seconds. This is especially annoying when i want to watch a youtube video...
Read more >
Full screen programs "losing focus"? - ForgeHub
When a game is minimised, a graphics card load significantly decreases (because it no longer needs to provide graphical calculations of the game ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found