aboutsummaryrefslogtreecommitdiff
path: root/www/firefox-esr/files/patch-bug726479
blob: f08c6f7efa7bc0bf4f4e033e98350b1ebff825a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
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