MFH: r535269

gecko: drop x11/startup-notification dependency

https://bugzilla.mozilla.org/show_bug.cgi?id=726479

Approved by:	ports-secteam blanket
This commit is contained in:
Jan Beich 2020-07-02 02:57:44 +00:00
parent 0c297e89d3
commit 22e399d695
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/branches/2020Q2/; revision=541008
6 changed files with 478 additions and 3 deletions

View File

@ -214,9 +214,7 @@ RUN_DEPENDS+= libcanberra>0:audio/libcanberra
.if ${PORT_OPTIONS:MDBUS}
BUILD_DEPENDS+= libnotify>0:devel/libnotify
LIB_DEPENDS+= libdbus-1.so:devel/dbus \
libdbus-glib-1.so:devel/dbus-glib \
libstartup-notification-1.so:x11/startup-notification
MOZ_OPTIONS+= --enable-startup-notification
libdbus-glib-1.so:devel/dbus-glib
.else
MOZ_OPTIONS+= --disable-dbus
.endif

View File

@ -3,6 +3,7 @@
PORTNAME= thunderbird
DISTVERSION= 68.10.0
PORTREVISION= 1
CATEGORIES= mail news net-im
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \
MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source

View File

@ -0,0 +1,237 @@
commit b92dbf54798e
Author: Ben Iofel <iofelben@gmail.com>
Date: Mon Jan 6 12:03:38 2020 +0000
Bug 726479 - Use GTK's support for startup notifications, r=karlt
Original author: Ben Iofel <iofelben@gmail.com>
Differential Revision: https://phabricator.services.mozilla.com/D58594
--HG--
extra : moz-landing-system : lando
---
config/system-headers.mozbuild | 10 ----------
old-configure.in | 35 -----------------------------------
toolkit/library/moz.build | 3 ---
toolkit/xre/nsAppRunner.cpp | 6 ------
widget/gtk/moz.build | 4 ----
widget/gtk/mozgtk/mozgtk.c | 1 +
widget/gtk/nsWindow.cpp | 37 +------------------------------------
7 files changed, 2 insertions(+), 94 deletions(-)
diff --git config/system-headers.mozbuild config/system-headers.mozbuild
index 33ba01eaea3ae..2081d0c683a4c 100644
--- config/system-headers.mozbuild
+++ config/system-headers.mozbuild
@@ -1267,16 +1267,6 @@ if CONFIG['MOZ_SYSTEM_ZLIB']:
'zlib.h',
]
-if CONFIG['MOZ_ENABLE_STARTUP_NOTIFICATION']:
- system_headers += [
- 'libsn/sn-common.h',
- 'libsn/sn.h',
- 'libsn/sn-launchee.h',
- 'libsn/sn-launcher.h',
- 'libsn/sn-monitor.h',
- 'libsn/sn-util.h',
- ]
-
if CONFIG['MOZ_SYSTEM_LIBEVENT']:
system_headers += [
'event2/event_compat.h',
diff --git old-configure.in old-configure.in
index f9278ba3f8451..2ac7fd92dfaa7 100644
--- old-configure.in
+++ old-configure.in
@@ -61,7 +61,6 @@ GTK2_VERSION=2.18.0
GTK3_VERSION=3.4.0
GDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4
W32API_VERSION=3.14
-STARTUP_NOTIFICATION_VERSION=0.8
DBUS_VERSION=0.60
SQLITE_VERSION=3.30.1
@@ -1759,40 +1758,6 @@ fi # COMPILE_ENVIRONMENT
AC_SUBST(MOZ_FS_LAYOUT)
-dnl ========================================================
-dnl = startup-notification support module
-dnl ========================================================
-
-if test "$MOZ_ENABLE_GTK"
-then
- MOZ_ENABLE_STARTUP_NOTIFICATION=
-
- MOZ_ARG_ENABLE_BOOL(startup-notification,
- [ --enable-startup-notification
- Enable startup-notification support (default: disabled) ],
- MOZ_ENABLE_STARTUP_NOTIFICATION=force,
- MOZ_ENABLE_STARTUP_NOTIFICATION=)
- if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
- then
- PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
- libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
- [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
- if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
- then
- AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
- fi
- MOZ_ENABLE_STARTUP_NOTIFICATION=
- ])
- fi
-
- if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
- AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
- fi
-
- TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
-fi
-AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
-
AC_SUBST_LIST(TK_CFLAGS)
AC_SUBST_LIST(TK_LIBS)
diff --git toolkit/library/moz.build toolkit/library/moz.build
index 736acbaae7fa9..af8400f4931f6 100644
--- toolkit/library/moz.build
+++ toolkit/library/moz.build
@@ -285,9 +285,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
'gthread-2.0',
]
-if CONFIG['MOZ_ENABLE_STARTUP_NOTIFICATION']:
- OS_LIBS += CONFIG['MOZ_STARTUP_NOTIFICATION_LIBS']
-
if CONFIG['MOZ_ENABLE_LIBPROXY']:
OS_LIBS += CONFIG['MOZ_LIBPROXY_LIBS']
diff --git toolkit/xre/nsAppRunner.cpp toolkit/xre/nsAppRunner.cpp
index 219265cbfda75..5e8dfb68e1ca5 100644
--- toolkit/xre/nsAppRunner.cpp
+++ toolkit/xre/nsAppRunner.cpp
@@ -278,7 +278,6 @@ nsString gAbsoluteArgv0Path;
# ifdef MOZ_X11
# include <gdk/gdkx.h>
# endif /* MOZ_X11 */
-# include "nsGTKToolkit.h"
# include <fontconfig/fontconfig.h>
#endif
#include "BinaryPath.h"
@@ -3851,7 +3850,6 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) {
#endif
#if defined(MOZ_WIDGET_GTK)
g_set_application_name(mAppData->name);
- gtk_window_set_auto_startup_notification(false);
#endif /* defined(MOZ_WIDGET_GTK) */
#ifdef MOZ_X11
@@ -4492,10 +4490,6 @@ nsresult XREMain::XRE_mainRun() {
#endif
#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_WIDGET_GTK)
- nsGTKToolkit* toolkit = nsGTKToolkit::GetToolkit();
- if (toolkit && !mDesktopStartupID.IsEmpty()) {
- toolkit->SetDesktopStartupID(mDesktopStartupID);
- }
// Clear the environment variable so it won't be inherited by
// child processes and confuse things.
g_unsetenv("DESKTOP_STARTUP_ID");
diff --git widget/gtk/moz.build widget/gtk/moz.build
index 2cbd226ef2222..1c8ee424aeb11 100644
--- widget/gtk/moz.build
+++ widget/gtk/moz.build
@@ -146,8 +146,6 @@ DEFINES['CAIRO_GFX'] = True
DEFINES['MOZ_APP_NAME'] = '"%s"' % CONFIG['MOZ_APP_NAME']
-CFLAGS += CONFIG['MOZ_STARTUP_NOTIFICATION_CFLAGS']
-
# When building with GTK3, the widget code always needs to use
# system Cairo headers, regardless of whether we are also linked
# against and using in-tree Cairo. By not using in-tree Cairo
@@ -158,8 +156,6 @@ CFLAGS += CONFIG['MOZ_STARTUP_NOTIFICATION_CFLAGS']
if not (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk' and CONFIG['MOZ_TREE_CAIRO']):
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
-CXXFLAGS += CONFIG['MOZ_STARTUP_NOTIFICATION_CFLAGS']
-
CFLAGS += CONFIG['TK_CFLAGS']
CXXFLAGS += CONFIG['TK_CFLAGS']
diff --git widget/gtk/mozgtk/mozgtk.c widget/gtk/mozgtk/mozgtk.c
index 9954083d5c1ef..84599830ca00a 100644
--- widget/gtk/mozgtk/mozgtk.c
+++ widget/gtk/mozgtk/mozgtk.c
@@ -529,6 +529,7 @@ STUB(gtk_window_set_geometry_hints)
STUB(gtk_window_set_icon_name)
STUB(gtk_window_set_modal)
STUB(gtk_window_set_skip_taskbar_hint)
+STUB(gtk_window_set_startup_id)
STUB(gtk_window_set_title)
STUB(gtk_window_set_transient_for)
STUB(gtk_window_set_type_hint)
diff --git widget/gtk/nsWindow.cpp widget/gtk/nsWindow.cpp
index 05902ac3bfb26..89748404988c3 100644
--- widget/gtk/nsWindow.cpp
+++ widget/gtk/nsWindow.cpp
@@ -64,11 +64,6 @@
#include "nsGkAtoms.h"
-#ifdef MOZ_ENABLE_STARTUP_NOTIFICATION
-# define SN_API_NOT_YET_FROZEN
-# include <startup-notification-1.0/libsn/sn.h>
-#endif
-
#include "mozilla/Assertions.h"
#include "mozilla/Likely.h"
#include "mozilla/Preferences.h"
@@ -1393,8 +1388,6 @@ void nsWindow::SetSizeMode(nsSizeMode aMode) {
typedef void (*SetUserTimeFunc)(GdkWindow* aWindow, guint32 aTimestamp);
-// This will become obsolete when new GTK APIs are widely supported,
-// as described here: http://bugzilla.gnome.org/show_bug.cgi?id=347375
static void SetUserTimeAndStartupIDForActivatedWindow(GtkWidget* aWindow) {
nsGTKToolkit* GTKToolkit = nsGTKToolkit::GetToolkit();
if (!GTKToolkit) return;
@@ -1414,35 +1407,7 @@ static void SetUserTimeAndStartupIDForActivatedWindow(
return;
}
-#if defined(MOZ_ENABLE_STARTUP_NOTIFICATION)
- // TODO - Implement for non-X11 Gtk backends (Bug 726479)
- if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
- GdkWindow* gdkWindow = gtk_widget_get_window(aWindow);
-
- GdkScreen* screen = gdk_window_get_screen(gdkWindow);
- SnDisplay* snd = sn_display_new(
- gdk_x11_display_get_xdisplay(gdk_window_get_display(gdkWindow)),
- nullptr, nullptr);
- if (!snd) return;
- SnLauncheeContext* ctx = sn_launchee_context_new(
- snd, gdk_screen_get_number(screen), desktopStartupID.get());
- if (!ctx) {
- sn_display_unref(snd);
- return;
- }
-
- if (sn_launchee_context_get_id_has_timestamp(ctx)) {
- gdk_x11_window_set_user_time(gdkWindow,
- sn_launchee_context_get_timestamp(ctx));
- }
-
- sn_launchee_context_setup_window(ctx, gdk_x11_window_get_xid(gdkWindow));
- sn_launchee_context_complete(ctx);
-
- sn_launchee_context_unref(ctx);
- sn_display_unref(snd);
- }
-#endif
+ gtk_window_set_startup_id(GTK_WINDOW(aWindow), desktopStartupID.get());
// If we used the startup ID, that already contains the focus timestamp;
// we don't want to reuse the timestamp next time we raise the window

View File

@ -3,6 +3,7 @@
PORTNAME= firefox
DISTVERSION= 68.10.0
PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= www
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}esr/source \

View File

@ -0,0 +1,237 @@
commit b92dbf54798e
Author: Ben Iofel <iofelben@gmail.com>
Date: Mon Jan 6 12:03:38 2020 +0000
Bug 726479 - Use GTK's support for startup notifications, r=karlt
Original author: Ben Iofel <iofelben@gmail.com>
Differential Revision: https://phabricator.services.mozilla.com/D58594
--HG--
extra : moz-landing-system : lando
---
config/system-headers.mozbuild | 10 ----------
old-configure.in | 35 -----------------------------------
toolkit/library/moz.build | 3 ---
toolkit/xre/nsAppRunner.cpp | 6 ------
widget/gtk/moz.build | 4 ----
widget/gtk/mozgtk/mozgtk.c | 1 +
widget/gtk/nsWindow.cpp | 37 +------------------------------------
7 files changed, 2 insertions(+), 94 deletions(-)
diff --git config/system-headers.mozbuild config/system-headers.mozbuild
index 33ba01eaea3ae..2081d0c683a4c 100644
--- config/system-headers.mozbuild
+++ config/system-headers.mozbuild
@@ -1267,16 +1267,6 @@ if CONFIG['MOZ_SYSTEM_ZLIB']:
'zlib.h',
]
-if CONFIG['MOZ_ENABLE_STARTUP_NOTIFICATION']:
- system_headers += [
- 'libsn/sn-common.h',
- 'libsn/sn.h',
- 'libsn/sn-launchee.h',
- 'libsn/sn-launcher.h',
- 'libsn/sn-monitor.h',
- 'libsn/sn-util.h',
- ]
-
if CONFIG['MOZ_SYSTEM_LIBEVENT']:
system_headers += [
'event2/event_compat.h',
diff --git old-configure.in old-configure.in
index f9278ba3f8451..2ac7fd92dfaa7 100644
--- old-configure.in
+++ old-configure.in
@@ -61,7 +61,6 @@ GTK2_VERSION=2.18.0
GTK3_VERSION=3.4.0
GDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4
W32API_VERSION=3.14
-STARTUP_NOTIFICATION_VERSION=0.8
DBUS_VERSION=0.60
SQLITE_VERSION=3.30.1
@@ -1759,40 +1758,6 @@ fi # COMPILE_ENVIRONMENT
AC_SUBST(MOZ_FS_LAYOUT)
-dnl ========================================================
-dnl = startup-notification support module
-dnl ========================================================
-
-if test "$MOZ_ENABLE_GTK"
-then
- MOZ_ENABLE_STARTUP_NOTIFICATION=
-
- MOZ_ARG_ENABLE_BOOL(startup-notification,
- [ --enable-startup-notification
- Enable startup-notification support (default: disabled) ],
- MOZ_ENABLE_STARTUP_NOTIFICATION=force,
- MOZ_ENABLE_STARTUP_NOTIFICATION=)
- if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
- then
- PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
- libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
- [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
- if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
- then
- AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
- fi
- MOZ_ENABLE_STARTUP_NOTIFICATION=
- ])
- fi
-
- if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
- AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
- fi
-
- TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
-fi
-AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
-
AC_SUBST_LIST(TK_CFLAGS)
AC_SUBST_LIST(TK_LIBS)
diff --git toolkit/library/moz.build toolkit/library/moz.build
index 736acbaae7fa9..af8400f4931f6 100644
--- toolkit/library/moz.build
+++ toolkit/library/moz.build
@@ -285,9 +285,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
'gthread-2.0',
]
-if CONFIG['MOZ_ENABLE_STARTUP_NOTIFICATION']:
- OS_LIBS += CONFIG['MOZ_STARTUP_NOTIFICATION_LIBS']
-
if CONFIG['MOZ_ENABLE_LIBPROXY']:
OS_LIBS += CONFIG['MOZ_LIBPROXY_LIBS']
diff --git toolkit/xre/nsAppRunner.cpp toolkit/xre/nsAppRunner.cpp
index 219265cbfda75..5e8dfb68e1ca5 100644
--- toolkit/xre/nsAppRunner.cpp
+++ toolkit/xre/nsAppRunner.cpp
@@ -278,7 +278,6 @@ nsString gAbsoluteArgv0Path;
# ifdef MOZ_X11
# include <gdk/gdkx.h>
# endif /* MOZ_X11 */
-# include "nsGTKToolkit.h"
# include <fontconfig/fontconfig.h>
#endif
#include "BinaryPath.h"
@@ -3851,7 +3850,6 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) {
#endif
#if defined(MOZ_WIDGET_GTK)
g_set_application_name(mAppData->name);
- gtk_window_set_auto_startup_notification(false);
#endif /* defined(MOZ_WIDGET_GTK) */
#ifdef MOZ_X11
@@ -4492,10 +4490,6 @@ nsresult XREMain::XRE_mainRun() {
#endif
#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_WIDGET_GTK)
- nsGTKToolkit* toolkit = nsGTKToolkit::GetToolkit();
- if (toolkit && !mDesktopStartupID.IsEmpty()) {
- toolkit->SetDesktopStartupID(mDesktopStartupID);
- }
// Clear the environment variable so it won't be inherited by
// child processes and confuse things.
g_unsetenv("DESKTOP_STARTUP_ID");
diff --git widget/gtk/moz.build widget/gtk/moz.build
index 2cbd226ef2222..1c8ee424aeb11 100644
--- widget/gtk/moz.build
+++ widget/gtk/moz.build
@@ -146,8 +146,6 @@ DEFINES['CAIRO_GFX'] = True
DEFINES['MOZ_APP_NAME'] = '"%s"' % CONFIG['MOZ_APP_NAME']
-CFLAGS += CONFIG['MOZ_STARTUP_NOTIFICATION_CFLAGS']
-
# When building with GTK3, the widget code always needs to use
# system Cairo headers, regardless of whether we are also linked
# against and using in-tree Cairo. By not using in-tree Cairo
@@ -158,8 +156,6 @@ CFLAGS += CONFIG['MOZ_STARTUP_NOTIFICATION_CFLAGS']
if not (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk' and CONFIG['MOZ_TREE_CAIRO']):
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
-CXXFLAGS += CONFIG['MOZ_STARTUP_NOTIFICATION_CFLAGS']
-
CFLAGS += CONFIG['TK_CFLAGS']
CXXFLAGS += CONFIG['TK_CFLAGS']
diff --git widget/gtk/mozgtk/mozgtk.c widget/gtk/mozgtk/mozgtk.c
index 9954083d5c1ef..84599830ca00a 100644
--- widget/gtk/mozgtk/mozgtk.c
+++ widget/gtk/mozgtk/mozgtk.c
@@ -529,6 +529,7 @@ STUB(gtk_window_set_geometry_hints)
STUB(gtk_window_set_icon_name)
STUB(gtk_window_set_modal)
STUB(gtk_window_set_skip_taskbar_hint)
+STUB(gtk_window_set_startup_id)
STUB(gtk_window_set_title)
STUB(gtk_window_set_transient_for)
STUB(gtk_window_set_type_hint)
diff --git widget/gtk/nsWindow.cpp widget/gtk/nsWindow.cpp
index 05902ac3bfb26..89748404988c3 100644
--- widget/gtk/nsWindow.cpp
+++ widget/gtk/nsWindow.cpp
@@ -64,11 +64,6 @@
#include "nsGkAtoms.h"
-#ifdef MOZ_ENABLE_STARTUP_NOTIFICATION
-# define SN_API_NOT_YET_FROZEN
-# include <startup-notification-1.0/libsn/sn.h>
-#endif
-
#include "mozilla/Assertions.h"
#include "mozilla/Likely.h"
#include "mozilla/Preferences.h"
@@ -1393,8 +1388,6 @@ void nsWindow::SetSizeMode(nsSizeMode aMode) {
typedef void (*SetUserTimeFunc)(GdkWindow* aWindow, guint32 aTimestamp);
-// This will become obsolete when new GTK APIs are widely supported,
-// as described here: http://bugzilla.gnome.org/show_bug.cgi?id=347375
static void SetUserTimeAndStartupIDForActivatedWindow(GtkWidget* aWindow) {
nsGTKToolkit* GTKToolkit = nsGTKToolkit::GetToolkit();
if (!GTKToolkit) return;
@@ -1414,35 +1407,7 @@ static void SetUserTimeAndStartupIDForActivatedWindow(
return;
}
-#if defined(MOZ_ENABLE_STARTUP_NOTIFICATION)
- // TODO - Implement for non-X11 Gtk backends (Bug 726479)
- if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
- GdkWindow* gdkWindow = gtk_widget_get_window(aWindow);
-
- GdkScreen* screen = gdk_window_get_screen(gdkWindow);
- SnDisplay* snd = sn_display_new(
- gdk_x11_display_get_xdisplay(gdk_window_get_display(gdkWindow)),
- nullptr, nullptr);
- if (!snd) return;
- SnLauncheeContext* ctx = sn_launchee_context_new(
- snd, gdk_screen_get_number(screen), desktopStartupID.get());
- if (!ctx) {
- sn_display_unref(snd);
- return;
- }
-
- if (sn_launchee_context_get_id_has_timestamp(ctx)) {
- gdk_x11_window_set_user_time(gdkWindow,
- sn_launchee_context_get_timestamp(ctx));
- }
-
- sn_launchee_context_setup_window(ctx, gdk_x11_window_get_xid(gdkWindow));
- sn_launchee_context_complete(ctx);
-
- sn_launchee_context_unref(ctx);
- sn_display_unref(snd);
- }
-#endif
+ gtk_window_set_startup_id(GTK_WINDOW(aWindow), desktopStartupID.get());
// If we used the startup ID, that already contains the focus timestamp;
// we don't want to reuse the timestamp next time we raise the window

View File

@ -3,6 +3,7 @@
PORTNAME= firefox
DISTVERSION= 78.0.1
PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= www
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \