summaryrefslogtreecommitdiff
path: root/extra/transmission/fix_minimize.patch
blob: fe0f42a0316223fa33caeb4521e7e8b9e7b9a96f (plain)
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
Index: /trunk/gtk/main.c
===================================================================
--- /trunk/gtk/main.c	(revision 12968)
+++ /trunk/gtk/main.c	(revision 13067)
@@ -73,4 +73,5 @@
     gboolean                    is_iconified;
 
+    guint                       activation_count;
     guint                       timer;
     guint                       update_model_soon_tag;
@@ -533,6 +534,14 @@
 
 static void
-on_activate( GApplication * app UNUSED, gpointer unused UNUSED )
-{
+on_activate( GApplication * app UNUSED, struct cbdata * cbdata )
+{
+    cbdata->activation_count++;
+
+    /* GApplication emits an 'activate' signal when bootstrapping the primary.
+     * Ordinarily we handle that by presenting the main window, but if the user
+     * user started Transmission minimized, ignore that initial signal... */
+    if( cbdata->is_iconified && ( cbdata->activation_count == 1 ) )
+        return;
+
     gtr_action_activate( "present-main-window" );
 }