Added fix for mozbz#1802327

This commit is contained in:
Martin Stransky 2022-12-15 10:05:22 +01:00
parent 1d86ce0d55
commit 6fa1c4438c
2 changed files with 60 additions and 0 deletions

58
D163310.diff Normal file
View File

@ -0,0 +1,58 @@
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -3029,11 +3029,11 @@
#endif
}
void nsWindow::SetUserTimeAndStartupTokenForActivatedWindow() {
nsGTKToolkit* toolkit = nsGTKToolkit::GetToolkit();
- if (!toolkit) {
+ if (!toolkit || MOZ_UNLIKELY(mWindowType == eWindowType_invisible)) {
return;
}
mWindowActivationTokenFromEnv = toolkit->GetStartupToken();
if (!mWindowActivationTokenFromEnv.IsEmpty()) {
@@ -6614,30 +6614,34 @@
return;
}
}
}
// Set up usertime/startupID metadata for the created window.
- if (mWindowType != eWindowType_invisible) {
+ // On X11 we use gtk_window_set_startup_id() so we need to call it
+ // before show.
+ if (GdkIsX11Display()) {
SetUserTimeAndStartupTokenForActivatedWindow();
}
if (GdkIsWaylandDisplay()) {
if (IsWaylandPopup()) {
ShowWaylandPopupWindow();
} else {
ShowWaylandToplevelWindow();
}
+ } else {
+ LOG(" calling gtk_widget_show(mShell)\n");
+ gtk_widget_show(mShell);
+ }
+ if (GdkIsWaylandDisplay()) {
+ SetUserTimeAndStartupTokenForActivatedWindow();
#ifdef MOZ_WAYLAND
auto token = std::move(mWindowActivationTokenFromEnv);
if (!token.IsEmpty()) {
FocusWaylandWindow(token.get());
}
#endif
- } else {
- LOG(" calling gtk_widget_show(mShell)\n");
- gtk_widget_show(mShell);
- }
-
+ }
if (mHiddenPopupPositioned && IsPopup()) {
LOG(" re-position hidden popup window");
gtk_window_move(GTK_WINDOW(mShell), mPopupPosition.x, mPopupPosition.y);
mHiddenPopupPositioned = false;
}

View File

@ -230,6 +230,7 @@ Patch55: firefox-testing.patch
Patch61: firefox-glibc-dynstack.patch
Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch
Patch78: firefox-i686-build.patch
Patch79: D163310.diff
# Test patches
# Generate without context by
@ -506,6 +507,7 @@ This package contains results of tests executed during build.
%patch54 -p1 -b .1669639
%patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12
%patch78 -p1 -b .firefox-i686
%patch79 -p1 -b .D163310
# Test patches
#%patch100 -p1 -b .firefox-tests-xpcshell