|
|
c3beec |
--- firefox-91.11.0/widget/gtk/nsWindow.cpp.D110204-fscreen.diff 2022-06-20 21:18:51.000000000 +0200
|
|
|
c3beec |
+++ firefox-91.11.0/widget/gtk/nsWindow.cpp 2022-06-21 12:21:44.892706641 +0200
|
|
|
f3b160 |
@@ -91,6 +91,7 @@
|
|
|
f3b160 |
#include "SystemTimeConverter.h"
|
|
|
f3b160 |
#include "WidgetUtilsGtk.h"
|
|
|
f3b160 |
#include "mozilla/X11Util.h"
|
|
|
72d64d |
+#include "nsIBrowserHandler.h"
|
|
|
72d64d |
|
|
|
f3b160 |
#ifdef ACCESSIBILITY
|
|
|
f3b160 |
# include "mozilla/a11y/LocalAccessible.h"
|
|
|
f3b160 |
@@ -441,6 +442,7 @@ nsWindow::nsWindow()
|
|
|
f3b160 |
mHasMappedToplevel(false),
|
|
|
f3b160 |
mRetryPointerGrab(false),
|
|
|
f3b160 |
mSizeState(nsSizeMode_Normal),
|
|
|
f3b160 |
+ mPendingFullscreen(false),
|
|
|
f3b160 |
mAspectRatio(0.0f),
|
|
|
f3b160 |
mAspectRatioSaved(0.0f),
|
|
|
f3b160 |
mLastScrollEventTime(GDK_CURRENT_TIME),
|
|
|
c3beec |
@@ -4618,6 +4620,19 @@ void nsWindow::OnWindowStateEvent(GtkWid
|
|
|
f3b160 |
ClearTransparencyBitmap();
|
|
|
72d64d |
}
|
|
|
72d64d |
}
|
|
|
72d64d |
+
|
|
|
72d64d |
+ // Hack to ensure window switched to fullscreen - avoid to fail when starting
|
|
|
72d64d |
+ // in kiosk mode
|
|
|
72d64d |
+ if (mPendingFullscreen &&
|
|
|
72d64d |
+ !(aEvent->new_window_state & GDK_WINDOW_STATE_FULLSCREEN)) {
|
|
|
72d64d |
+ LOG(
|
|
|
72d64d |
+ (" Window should be fullscreen, but it's not, retrying set to "
|
|
|
72d64d |
+ "fullscreen.\n"));
|
|
|
72d64d |
+ MakeFullScreen(true);
|
|
|
72d64d |
+ } else {
|
|
|
72d64d |
+ LOG((" Window successfully switched to fullscreen, happy now\n"));
|
|
|
72d64d |
+ mPendingFullscreen = false;
|
|
|
72d64d |
+ }
|
|
|
72d64d |
}
|
|
|
72d64d |
|
|
|
f3b160 |
void nsWindow::OnDPIChanged() {
|
|
|
c3beec |
@@ -6860,6 +6875,19 @@ nsresult nsWindow::MakeFullScreen(bool a
|
|
|
72d64d |
}
|
|
|
72d64d |
}
|
|
|
72d64d |
|
|
|
72d64d |
+ // if in kiosk, ensure the fullscreen is called
|
|
|
72d64d |
+ nsCOMPtr<nsIBrowserHandler> browserHandler =
|
|
|
72d64d |
+ do_GetService("@mozilla.org/browser/clh;1");
|
|
|
72d64d |
+ if (browserHandler) {
|
|
|
72d64d |
+ bool isKiosk;
|
|
|
72d64d |
+ browserHandler->GetKiosk(&isKiosk);
|
|
|
72d64d |
+ if (isKiosk) {
|
|
|
72d64d |
+ LOG((" is kiosk, ensure the window switch to fullscreen\n"));
|
|
|
72d64d |
+ mPendingFullscreen = true;
|
|
|
72d64d |
+ }
|
|
|
72d64d |
+ } else {
|
|
|
72d64d |
+ LOG((" Cannot find the browserHandler service.\n"));
|
|
|
72d64d |
+ }
|
|
|
72d64d |
gtk_window_fullscreen(GTK_WINDOW(mShell));
|
|
|
72d64d |
} else {
|
|
|
72d64d |
mSizeMode = mLastSizeMode;
|
|
|
c3beec |
--- firefox-91.11.0/widget/gtk/nsWindow.h.D110204-fscreen.diff 2022-06-21 12:21:44.894706636 +0200
|
|
|
c3beec |
+++ firefox-91.11.0/widget/gtk/nsWindow.h 2022-06-21 12:25:20.985209461 +0200
|
|
|
c3beec |
@@ -767,6 +767,7 @@ class nsWindow final : public nsBaseWidg
|
|
|
c3beec |
* move-to-rect callback we set mResizedAfterMoveToRect.
|
|
|
f3b160 |
*/
|
|
|
f3b160 |
bool mWaitingForMoveToRectCallback;
|
|
|
72d64d |
+ bool mPendingFullscreen;
|
|
|
c3beec |
bool mResizedAfterMoveToRect;
|
|
|
72d64d |
|
|
|
72d64d |
/**
|