2023-06-20 11:17:27 +00:00
|
|
|
diff -up firefox-102.2.0/widget/gtk/nsWindow.cpp.D110204-fscreen.diff firefox-102.2.0/widget/gtk/nsWindow.cpp
|
|
|
|
--- firefox-102.2.0/widget/gtk/nsWindow.cpp.D110204-fscreen.diff 2022-08-18 21:54:09.000000000 +0200
|
|
|
|
+++ firefox-102.2.0/widget/gtk/nsWindow.cpp 2022-09-02 15:55:18.023843940 +0200
|
|
|
|
@@ -96,6 +96,7 @@
|
|
|
|
#include "ScreenHelperGTK.h"
|
2021-10-01 10:23:15 +00:00
|
|
|
#include "SystemTimeConverter.h"
|
|
|
|
#include "WidgetUtilsGtk.h"
|
2021-07-12 12:17:49 +00:00
|
|
|
+#include "nsIBrowserHandler.h"
|
|
|
|
|
2021-10-01 10:23:15 +00:00
|
|
|
#ifdef ACCESSIBILITY
|
|
|
|
# include "mozilla/a11y/LocalAccessible.h"
|
2023-06-20 11:17:27 +00:00
|
|
|
@@ -169,7 +170,8 @@ const gint kEvents = GDK_TOUCHPAD_GESTUR
|
|
|
|
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
|
|
|
|
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
|
|
|
|
GDK_SMOOTH_SCROLL_MASK | GDK_TOUCH_MASK | GDK_SCROLL_MASK |
|
|
|
|
- GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK;
|
|
|
|
+ GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK |
|
|
|
|
+ GDK_FOCUS_CHANGE_MASK;
|
|
|
|
|
|
|
|
/* utility functions */
|
|
|
|
static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX,
|
|
|
|
@@ -408,7 +410,8 @@ nsWindow::nsWindow()
|
|
|
|
mMovedAfterMoveToRect(false),
|
|
|
|
mResizedAfterMoveToRect(false),
|
|
|
|
mConfiguredClearColor(false),
|
|
|
|
- mGotNonBlankPaint(false) {
|
|
|
|
+ mGotNonBlankPaint(false),
|
|
|
|
+ mPendingFullscreen(false) {
|
|
|
|
mWindowType = eWindowType_child;
|
|
|
|
mSizeConstraints.mMaxSize = GetSafeWindowSize(mSizeConstraints.mMaxSize);
|
|
|
|
|
|
|
|
@@ -4814,6 +4817,19 @@ void nsWindow::OnWindowStateEvent(GtkWid
|
2021-10-01 10:23:15 +00:00
|
|
|
ClearTransparencyBitmap();
|
2021-07-12 12:17:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Hack to ensure window switched to fullscreen - avoid to fail when starting
|
|
|
|
+ // in kiosk mode
|
|
|
|
+ if (mPendingFullscreen &&
|
|
|
|
+ !(aEvent->new_window_state & GDK_WINDOW_STATE_FULLSCREEN)) {
|
|
|
|
+ LOG(
|
2023-06-20 11:17:27 +00:00
|
|
|
+ " Window should be fullscreen, but it's not, retrying set to "
|
|
|
|
+ "fullscreen.\n");
|
2021-07-12 12:17:49 +00:00
|
|
|
+ MakeFullScreen(true);
|
|
|
|
+ } else {
|
2023-06-20 11:17:27 +00:00
|
|
|
+ LOG(" Window successfully switched to fullscreen, happy now\n");
|
2021-07-12 12:17:49 +00:00
|
|
|
+ mPendingFullscreen = false;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
2021-10-01 10:23:15 +00:00
|
|
|
void nsWindow::OnDPIChanged() {
|
2023-06-20 11:17:27 +00:00
|
|
|
@@ -7042,6 +7058,19 @@ nsresult nsWindow::MakeFullScreen(bool a
|
2021-07-12 12:17:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // if in kiosk, ensure the fullscreen is called
|
|
|
|
+ nsCOMPtr<nsIBrowserHandler> browserHandler =
|
|
|
|
+ do_GetService("@mozilla.org/browser/clh;1");
|
|
|
|
+ if (browserHandler) {
|
|
|
|
+ bool isKiosk;
|
|
|
|
+ browserHandler->GetKiosk(&isKiosk);
|
|
|
|
+ if (isKiosk) {
|
2023-06-20 11:17:27 +00:00
|
|
|
+ LOG(" is kiosk, ensure the window switch to fullscreen\n");
|
2021-07-12 12:17:49 +00:00
|
|
|
+ mPendingFullscreen = true;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
2023-06-20 11:17:27 +00:00
|
|
|
+ LOG(" Cannot find the browserHandler service.\n");
|
2021-07-12 12:17:49 +00:00
|
|
|
+ }
|
|
|
|
gtk_window_fullscreen(GTK_WINDOW(mShell));
|
|
|
|
} else {
|
|
|
|
mSizeMode = mLastSizeMode;
|
2023-06-20 11:17:27 +00:00
|
|
|
diff -up firefox-102.2.0/widget/gtk/nsWindow.h.D110204-fscreen.diff firefox-102.2.0/widget/gtk/nsWindow.h
|
|
|
|
--- firefox-102.2.0/widget/gtk/nsWindow.h.D110204-fscreen.diff 2022-08-18 21:53:52.000000000 +0200
|
|
|
|
+++ firefox-102.2.0/widget/gtk/nsWindow.h 2022-09-02 08:17:07.606010905 +0200
|
|
|
|
@@ -712,6 +712,7 @@ class nsWindow final : public nsBaseWidg
|
|
|
|
* move-to-rect callback we set mMovedAfterMoveToRect/mResizedAfterMoveToRect.
|
2021-10-01 10:23:15 +00:00
|
|
|
*/
|
2023-06-20 11:17:27 +00:00
|
|
|
bool mWaitingForMoveToRectCallback : 1;
|
|
|
|
+ bool mPendingFullscreen : 1;
|
|
|
|
bool mMovedAfterMoveToRect : 1;
|
|
|
|
bool mResizedAfterMoveToRect : 1;
|
2021-07-12 12:17:49 +00:00
|
|
|
|