~matttbe/ubuntu/precise/gnome-panel/975299

« back to all changes in this revision

Viewing changes to debian/patches/25_dynamic_fusa_detection.patch

  • Committer: Bazaar Package Importer
  • Author(s): Ted Gould
  • Date: 2011-04-19 08:48:23 UTC
  • Revision ID: james.westby@ubuntu.com-20110419084823-cu359b1xqyix0e04
Tags: 1:2.32.1-0ubuntu6.3
debian/patches/25_dynamic_fusa_detection.patch: Check for indicator
applet complete as well as fusa.  (LP: #506404)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
## Description: add some description
 
2
## Origin/Author: add some origin or author
 
3
## Bug: bug URL
1
4
Description: Remove the shutdown, logout and lock screen items when the FUSA applet is on the panel
2
5
Bug: https://bugs.launchpad.net/ubuntu/+source/gnome-panel/+bug/335242
3
6
 
4
 
Index: gnome-panel-2.32.0/gnome-panel/applet-signaler.c
 
7
Index: gnome-panel-2.32.1/gnome-panel/applet-signaler.c
5
8
===================================================================
6
9
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
7
 
+++ gnome-panel-2.32.0/gnome-panel/applet-signaler.c    2010-10-15 18:48:44.000000000 +0200
 
10
+++ gnome-panel-2.32.1/gnome-panel/applet-signaler.c    2011-04-19 08:40:27.705316019 -0500
8
11
@@ -0,0 +1,133 @@
9
12
+/*
10
13
+ * Fast User Switch Applet: status-manager.c
139
142
+       return;
140
143
+}
141
144
+
142
 
Index: gnome-panel-2.32.0/gnome-panel/applet-signaler.h
 
145
Index: gnome-panel-2.32.1/gnome-panel/applet-signaler.h
143
146
===================================================================
144
147
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
145
 
+++ gnome-panel-2.32.0/gnome-panel/applet-signaler.h    2010-10-15 18:48:44.000000000 +0200
 
148
+++ gnome-panel-2.32.1/gnome-panel/applet-signaler.h    2011-04-19 08:40:27.705316019 -0500
146
149
@@ -0,0 +1,52 @@
147
150
+/*
148
151
+ * Fast User Switch Applet: status-manager.c
196
199
+G_END_DECLS
197
200
+
198
201
+#endif /* APPLET_SIGNALER_H */
199
 
Index: gnome-panel-2.32.0/gnome-panel/applet.c
 
202
Index: gnome-panel-2.32.1/gnome-panel/applet.c
200
203
===================================================================
201
 
--- gnome-panel-2.32.0.orig/gnome-panel/applet.c        2010-09-06 19:55:32.000000000 +0200
202
 
+++ gnome-panel-2.32.0/gnome-panel/applet.c     2010-10-15 18:48:44.108592194 +0200
 
204
--- gnome-panel-2.32.1.orig/gnome-panel/applet.c        2011-04-19 08:40:26.314746668 -0500
 
205
+++ gnome-panel-2.32.1/gnome-panel/applet.c     2011-04-19 08:40:27.705316019 -0500
203
206
@@ -34,6 +34,7 @@
204
207
 #include "panel-globals.h"
205
208
 #include "panel-properties-dialog.h"
295
298
        return info;
296
299
 }
297
300
 
298
 
Index: gnome-panel-2.32.0/gnome-panel/applet.h
 
301
Index: gnome-panel-2.32.1/gnome-panel/applet.h
299
302
===================================================================
300
 
--- gnome-panel-2.32.0.orig/gnome-panel/applet.h        2010-03-17 07:45:18.000000000 +0100
301
 
+++ gnome-panel-2.32.0/gnome-panel/applet.h     2010-10-15 18:48:44.108592194 +0200
 
303
--- gnome-panel-2.32.1.orig/gnome-panel/applet.h        2011-04-19 08:40:26.364767143 -0500
 
304
+++ gnome-panel-2.32.1/gnome-panel/applet.h     2011-04-19 08:40:27.705316019 -0500
302
305
@@ -56,8 +56,10 @@
303
306
 void panel_applet_stop_loading (const char *id);
304
307
 
310
313
 AppletInfo *panel_applet_get_by_type      (PanelObjectType  object_type, GdkScreen *screen);
311
314
 
312
315
 GSList     *panel_applet_list_applets (void);
313
 
Index: gnome-panel-2.32.0/gnome-panel/panel-applet-frame.c
 
316
Index: gnome-panel-2.32.1/gnome-panel/panel-applet-frame.c
314
317
===================================================================
315
 
--- gnome-panel-2.32.0.orig/gnome-panel/panel-applet-frame.c    2010-09-06 23:39:18.000000000 +0200
316
 
+++ gnome-panel-2.32.0/gnome-panel/panel-applet-frame.c 2010-10-15 18:48:44.112592191 +0200
 
318
--- gnome-panel-2.32.1.orig/gnome-panel/panel-applet-frame.c    2011-04-19 08:40:26.404783523 -0500
 
319
+++ gnome-panel-2.32.1/gnome-panel/panel-applet-frame.c 2011-04-19 08:40:27.715320116 -0500
317
320
@@ -1004,3 +1004,15 @@
318
321
 
319
322
        g_free (id);
330
333
+
331
334
+       return frame->priv->iid;
332
335
+}
333
 
Index: gnome-panel-2.32.0/gnome-panel/panel-menu-bar.c
 
336
Index: gnome-panel-2.32.1/gnome-panel/panel-menu-bar.c
334
337
===================================================================
335
 
--- gnome-panel-2.32.0.orig/gnome-panel/panel-menu-bar.c        2010-10-15 18:48:44.084592194 +0200
336
 
+++ gnome-panel-2.32.0/gnome-panel/panel-menu-bar.c     2010-10-15 18:48:44.116592192 +0200
 
338
--- gnome-panel-2.32.1.orig/gnome-panel/panel-menu-bar.c        2011-04-19 08:40:27.665299631 -0500
 
339
+++ gnome-panel-2.32.1/gnome-panel/panel-menu-bar.c     2011-04-19 08:44:36.281440856 -0500
337
340
@@ -47,6 +47,7 @@
338
341
 #include "panel-stock-icons.h"
339
342
 #include "panel-typebuiltins.h"
342
345
 
343
346
 G_DEFINE_TYPE (PanelMenuBar, panel_menu_bar, GTK_TYPE_MENU_BAR)
344
347
 
345
 
@@ -99,9 +100,53 @@
 
348
@@ -99,9 +100,56 @@
346
349
        return FALSE;
347
350
 }
348
351
 
349
352
+#define FUSA_APPLET_IID "OAFIID:GNOME_FastUserSwitchApplet"
 
353
+#define INDICATOR_APPLET_COMPLETE_IID "OAFIID:GNOME_IndicatorAppletComplete"
350
354
+
351
355
+static void
352
356
+panel_menu_bar_set_tooltip_remove (PanelAppletSignaler * pas, AppletInfo * info, GtkWidget * widget)
355
359
+       if (iid == NULL)
356
360
+               return;
357
361
+
358
 
+       if (!strcmp(iid, FUSA_APPLET_IID))
 
362
+       if (g_strcmp0(iid, FUSA_APPLET_IID) == 0 ||
 
363
+               g_strcmp0(iid, INDICATOR_APPLET_COMPLETE_IID) == 0)
359
364
+               panel_util_set_tooltip_text (widget,
360
365
+                                                _("Change desktop appearance and behavior, get help, or log out"));
361
366
+
369
374
+       if (iid == NULL)
370
375
+               return;
371
376
+
372
 
+       if (!strcmp(iid, FUSA_APPLET_IID))
 
377
+       if (g_strcmp0(iid, FUSA_APPLET_IID) == 0 ||
 
378
+               g_strcmp0(iid, INDICATOR_APPLET_COMPLETE_IID) == 0)
373
379
+               panel_util_set_tooltip_text (widget,
374
380
+                                                _("Change system appearance and behavior, or get help"));
375
381
+
396
402
        panel_util_set_tooltip_text (menubar->priv->applications_item,
397
403
                                     _("Browse and run installed applications"));
398
404
        panel_util_set_tooltip_text (menubar->priv->places_item,
399
 
@@ -109,6 +154,16 @@
 
405
@@ -109,6 +157,16 @@
400
406
        panel_util_set_tooltip_text (menubar->priv->desktop_item,
401
407
                                     _("Change desktop appearance and behavior, get help, or log out"));
402
408
 
413
419
        //FIXME: this doesn't handle the right-click case. Sigh.
414
420
        /* Hide tooltip if a menu is activated */
415
421
        g_signal_connect (menubar->priv->applications_item,
416
 
Index: gnome-panel-2.32.0/gnome-panel/panel-menu-items.c
 
422
Index: gnome-panel-2.32.1/gnome-panel/panel-menu-items.c
417
423
===================================================================
418
 
--- gnome-panel-2.32.0.orig/gnome-panel/panel-menu-items.c      2010-10-15 18:48:43.984592196 +0200
419
 
+++ gnome-panel-2.32.0/gnome-panel/panel-menu-items.c   2010-10-15 18:48:44.116592192 +0200
 
424
--- gnome-panel-2.32.1.orig/gnome-panel/panel-menu-items.c      2011-04-19 08:40:27.505234079 -0500
 
425
+++ gnome-panel-2.32.1/gnome-panel/panel-menu-items.c   2011-04-19 08:48:05.624659003 -0500
420
426
@@ -54,6 +54,7 @@
421
427
 #include "panel-recent.h"
422
428
 #include "panel-stock-icons.h"
425
431
 
426
432
 #define BOOKMARKS_FILENAME      ".gtk-bookmarks"
427
433
 #define DESKTOP_IS_HOME_DIR_DIR "/apps/nautilus/preferences"
428
 
@@ -1533,6 +1534,58 @@
 
434
@@ -1533,6 +1534,61 @@
429
435
                                       "menu_panel", panel);
430
436
 }
431
437
 
432
438
+#define FUSA_APPLET_IID "OAFIID:GNOME_FastUserSwitchApplet"
 
439
+#define INDICATOR_APPLET_COMPLETE_IID "OAFIID:GNOME_IndicatorAppletComplete"
433
440
+
434
441
+static void
435
442
+panel_menu_items_hide_on_fusa (PanelAppletSignaler * pas, AppletInfo * info, GtkWidget * widget)
444
451
+       if (iid == NULL)
445
452
+               return;
446
453
+
447
 
+       if (!strcmp(iid, FUSA_APPLET_IID))
 
454
+       if (g_strcmp0(iid, FUSA_APPLET_IID) == 0 ||
 
455
+               g_strcmp0(iid, INDICATOR_APPLET_COMPLETE_IID) == 0)
448
456
+               gtk_widget_hide(widget);
449
457
+
450
458
+       return;
463
471
+       if (iid == NULL)
464
472
+               return;
465
473
+
466
 
+       if (!strcmp(iid, FUSA_APPLET_IID))
 
474
+       if (g_strcmp0(iid, FUSA_APPLET_IID) == 0 ||
 
475
+               g_strcmp0(iid, INDICATOR_APPLET_COMPLETE_IID) == 0)
467
476
+               gtk_widget_show(widget);
468
477
+
469
478
+       return;
484
493
 void
485
494
 panel_menu_items_append_lock_logout (GtkWidget *menu)
486
495
 {
487
 
@@ -1543,6 +1596,11 @@
 
496
@@ -1543,6 +1599,13 @@
488
497
        const char *translate;
489
498
        char       *label;
490
499
        char       *tooltip;
493
502
+       PanelAppletSignaler *signaler = panel_applet_signaler_get_default ();
494
503
+
495
504
+       fusa = panel_applet_get_by_iid(FUSA_APPLET_IID);
 
505
+       if (fusa == NULL)
 
506
+               fusa = panel_applet_get_by_iid(INDICATOR_APPLET_COMPLETE_IID);
496
507
 
497
508
        separator_inserted = FALSE;
498
509
        children = gtk_container_get_children (GTK_CONTAINER (menu));
499
 
@@ -1550,17 +1608,42 @@
 
510
@@ -1550,17 +1613,42 @@
500
511
        if (last != NULL) {
501
512
                separator_inserted = GTK_IS_SEPARATOR (GTK_WIDGET (last->data));
502
513
        }
540
551
                }
541
552
        }
542
553
 
543
 
@@ -1603,19 +1686,65 @@
 
554
@@ -1603,19 +1691,65 @@
544
555
 
545
556
        if (item != NULL) {
546
557
                if (!separator_inserted) {
608
619
        }
609
620
 }
610
621
 
611
 
diff -Nur gnome-panel-2.32.0/gnome-panel/Makefile.am gnome-panel-2.32.0ubuntu/gnome-panel/Makefile.am
612
 
--- gnome-panel-2.32.0/gnome-panel/Makefile.am  2010-09-20 17:49:51.000000000 +0200
613
 
+++ gnome-panel-2.32.0ubuntu/gnome-panel/Makefile.am    2010-10-15 19:40:37.000000000 +0200
 
622
Index: gnome-panel-2.32.1/gnome-panel/Makefile.am
 
623
===================================================================
 
624
--- gnome-panel-2.32.1.orig/gnome-panel/Makefile.am     2011-04-19 08:40:26.334754858 -0500
 
625
+++ gnome-panel-2.32.1/gnome-panel/Makefile.am  2011-04-19 08:40:27.715320116 -0500
614
626
@@ -67,7 +67,8 @@
615
627
        panel-addto.c           \
616
628
        panel-ditem-editor.c    \
631
643
 
632
644
 gnome_panel_SOURCES =                  \
633
645
        $(panel_sources)                \
634
 
diff -Nur gnome-panel-2.32.0/gnome-panel/panel-applet-frame.h gnome-panel-2.32.0ubuntu/gnome-panel/panel-applet-frame.h
635
 
--- gnome-panel-2.32.0/gnome-panel/panel-applet-frame.h 2010-06-23 01:00:28.000000000 +0200
636
 
+++ gnome-panel-2.32.0ubuntu/gnome-panel/panel-applet-frame.h   2010-10-15 19:39:45.000000000 +0200
 
646
Index: gnome-panel-2.32.1/gnome-panel/panel-applet-frame.h
 
647
===================================================================
 
648
--- gnome-panel-2.32.1.orig/gnome-panel/panel-applet-frame.h    2011-04-19 08:40:26.384775333 -0500
 
649
+++ gnome-panel-2.32.1/gnome-panel/panel-applet-frame.h 2011-04-19 08:40:27.715320116 -0500
637
650
@@ -137,6 +137,9 @@
638
651
 void  _panel_applet_frame_applet_move           (PanelAppletFrame *frame);
639
652
 void  _panel_applet_frame_applet_lock           (PanelAppletFrame *frame,