mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 796873 - Don't lock the screen if we might not be able to unlock it. r=mounir
This commit is contained in:
parent
714d91c5f3
commit
0ac5acf519
@ -371,19 +371,20 @@ nsScreen::MozLockOrientation(const Sequence<nsString>& aOrientations,
|
||||
case LOCK_ALLOWED:
|
||||
return hal::LockScreenOrientation(orientation);
|
||||
case FULLSCREEN_LOCK_ALLOWED: {
|
||||
// We need to register a listener so we learn when we leave full-screen
|
||||
// and when we will have to unlock the screen.
|
||||
// This needs to be done before LockScreenOrientation call to make sure
|
||||
// the locking can be unlocked.
|
||||
nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(GetOwner());
|
||||
if (!target) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!hal::LockScreenOrientation(orientation)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// We are fullscreen and lock has been accepted.
|
||||
// Now, we need to register a listener so we learn when we leave
|
||||
// full-screen and when we will have to unlock the screen.
|
||||
nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(GetOwner());
|
||||
if (!target) {
|
||||
// XXX: Bug 796873
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!mEventListener) {
|
||||
mEventListener = new FullScreenEventListener();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user