~ubuntu-branches/ubuntu/maverick/gnome-settings-daemon/maverick

« back to all changes in this revision

Viewing changes to debian/patches/16_use_synchronous_notifications.patch

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2010-03-28 02:07:56 UTC
  • Revision ID: james.westby@ubuntu.com-20100328020756-ghpycvrpeck8yqoa
Tags: 2.29.92-0ubuntu4
* debian/patches/16_use_synchronous_notifications.patch:
  - Update so that volume change event sounds work correctly (LP: #538761)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: gnome-settings-daemon-2.29.91.1/plugins/common/Makefile.am
 
1
Index: gnome-settings-daemon-2.29.92/plugins/common/Makefile.am
2
2
===================================================================
3
 
--- gnome-settings-daemon-2.29.91.1.orig/plugins/common/Makefile.am     2010-03-01 10:33:30.450386340 +0000
4
 
+++ gnome-settings-daemon-2.29.91.1/plugins/common/Makefile.am  2010-03-01 10:33:38.780387291 +0000
 
3
--- gnome-settings-daemon-2.29.92.orig/plugins/common/Makefile.am       2010-01-12 15:51:57.000000000 +0000
 
4
+++ gnome-settings-daemon-2.29.92/plugins/common/Makefile.am    2010-03-28 03:35:38.590169099 +0100
5
5
@@ -7,17 +7,21 @@
6
6
        gsd-keygrab.c           \
7
7
        gsd-keygrab.h           \
26
26
-       $(SETTINGS_PLUGIN_LIBS)
27
27
+       $(SETTINGS_PLUGIN_LIBS)         \
28
28
+       $(LIBNOTIFY_LIBS)
29
 
Index: gnome-settings-daemon-2.29.91.1/plugins/common/gsd-osd-notification.c
 
29
Index: gnome-settings-daemon-2.29.92/plugins/common/gsd-osd-notification.c
30
30
===================================================================
31
31
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
32
 
+++ gnome-settings-daemon-2.29.91.1/plugins/common/gsd-osd-notification.c       2010-03-01 10:33:38.780387291 +0000
 
32
+++ gnome-settings-daemon-2.29.92/plugins/common/gsd-osd-notification.c 2010-03-28 03:35:38.590169099 +0100
33
33
@@ -0,0 +1,286 @@
34
34
+/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8; tab-width: 8 -*- */
35
35
+/*
317
317
+
318
318
+        g_type_class_add_private (klass, sizeof (GsdOsdNotificationPrivate));
319
319
+}
320
 
Index: gnome-settings-daemon-2.29.91.1/plugins/common/gsd-osd-notification.h
 
320
Index: gnome-settings-daemon-2.29.92/plugins/common/gsd-osd-notification.h
321
321
===================================================================
322
322
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
323
 
+++ gnome-settings-daemon-2.29.91.1/plugins/common/gsd-osd-notification.h       2010-03-01 10:33:38.780387291 +0000
 
323
+++ gnome-settings-daemon-2.29.92/plugins/common/gsd-osd-notification.h 2010-03-28 03:35:38.590169099 +0100
324
324
@@ -0,0 +1,75 @@
325
325
+/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8; tab-width: 8 -*- */
326
326
+/*
397
397
+G_END_DECLS
398
398
+
399
399
+#endif /* _GSD_OSD_NOTIFICATION_H_ */
400
 
Index: gnome-settings-daemon-2.29.91.1/plugins/media-keys/gsd-media-keys-manager.c
 
400
Index: gnome-settings-daemon-2.29.92/plugins/media-keys/gsd-media-keys-manager.c
401
401
===================================================================
402
 
--- gnome-settings-daemon-2.29.91.1.orig/plugins/media-keys/gsd-media-keys-manager.c    2010-03-01 10:33:30.430397068 +0000
403
 
+++ gnome-settings-daemon-2.29.91.1/plugins/media-keys/gsd-media-keys-manager.c 2010-03-01 10:38:47.740387234 +0000
 
402
--- gnome-settings-daemon-2.29.92.orig/plugins/media-keys/gsd-media-keys-manager.c      2010-03-04 13:48:19.000000000 +0000
 
403
+++ gnome-settings-daemon-2.29.92/plugins/media-keys/gsd-media-keys-manager.c   2010-03-28 03:37:03.350169668 +0100
404
404
@@ -49,6 +49,7 @@
405
405
 #include "eggaccelerators.h"
406
406
 #include "acme.h"
450
450
 
451
451
         command = gconf_client_get_string (manager->priv->conf_client,
452
452
                                            GCONF_MISC_DIR "/eject_command",
453
 
@@ -615,11 +626,13 @@
 
453
@@ -615,24 +626,46 @@
454
454
         GConfClient *client = manager->priv->conf_client;
455
455
         gboolean state = gconf_client_get_bool (client, TOUCHPAD_ENABLED_KEY, NULL);
456
456
 
469
469
 
470
470
         gconf_client_set_bool (client, TOUCHPAD_ENABLED_KEY, !state, NULL);
471
471
 }
472
 
@@ -628,11 +641,19 @@
 
472
 
 
473
 #ifdef HAVE_PULSE
473
474
 static void
 
475
+play_volume_event_sound (GtkWidget *widget)
 
476
+{
 
477
+        ca_gtk_play_for_widget (widget, 0,
 
478
+                                CA_PROP_EVENT_ID, "audio-volume-change",
 
479
+                                CA_PROP_EVENT_DESCRIPTION, "volume changed through key press",
 
480
+                                CA_PROP_APPLICATION_ID, "org.gnome.VolumeControl",
 
481
+                                NULL);
 
482
+}
 
483
+
 
484
+static void
474
485
 update_dialog (GsdMediaKeysManager *manager,
475
486
                guint vol,
476
487
-               gboolean muted)
477
488
+               gboolean muted,
478
489
+               GsdOsdNotifierOvershootType overshoot)
479
490
 {
 
491
+        GtkWidget *window;
 
492
+
480
493
         vol = (int) (100 * (double) vol / PA_VOLUME_NORM);
481
494
-        vol = CLAMP (vol, 0, 100);
482
495
+        if (overshoot != GSD_OSD_NOTIFICATION_NO_OVERSHOOT) {
491
504
         dialog_init (manager);
492
505
         gsd_media_keys_window_set_volume_muted (GSD_MEDIA_KEYS_WINDOW (manager->priv->dialog),
493
506
                                                 muted);
494
 
@@ -641,6 +662,7 @@
 
507
@@ -641,11 +674,16 @@
495
508
                                           GSD_MEDIA_KEYS_WINDOW_ACTION_VOLUME);
496
509
         dialog_show (manager);
497
510
 
 
511
-        ca_gtk_play_for_widget (manager->priv->dialog, 0,
 
512
-                                CA_PROP_EVENT_ID, "audio-volume-change",
 
513
-                                CA_PROP_EVENT_DESCRIPTION, "volume changed through key press",
 
514
-                                CA_PROP_APPLICATION_ID, "org.gnome.VolumeControl",
 
515
-                                NULL);
498
516
+done:
499
 
         ca_gtk_play_for_widget (manager->priv->dialog, 0,
500
 
                                 CA_PROP_EVENT_ID, "audio-volume-change",
501
 
                                 CA_PROP_EVENT_DESCRIPTION, "volume changed through key press",
502
 
@@ -655,6 +677,7 @@
 
517
+        if (manager->priv->dialog == NULL) {
 
518
+                window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
519
+                gtk_window_set_screen (GTK_WINDOW (window), manager->priv->current_screen);
 
520
+                gtk_widget_realize (window);
 
521
+                play_volume_event_sound (window);
 
522
+                gtk_widget_destroy (window);        
 
523
+        } else {
 
524
+                play_volume_event_sound (manager->priv->dialog);        
 
525
+        }
 
526
 }
 
527
 
 
528
 static void
 
529
@@ -655,6 +693,7 @@
503
530
         gboolean muted;
504
531
         guint vol, norm_vol_step;
505
532
         int vol_step;
507
534
 
508
535
         if (manager->priv->stream == NULL)
509
536
                 return;
510
 
@@ -688,6 +711,8 @@
 
537
@@ -688,6 +727,8 @@
511
538
                         vol = vol - norm_vol_step;
512
539
                         if (gvc_mixer_stream_set_volume (manager->priv->stream, vol) != FALSE)
513
540
                                 gvc_mixer_stream_push_volume (manager->priv->stream);
516
543
                 }
517
544
                 break;
518
545
         case VOLUME_UP_KEY:
519
 
@@ -710,12 +735,14 @@
 
546
@@ -710,12 +751,14 @@
520
547
                                 }
521
548
                                 if (gvc_mixer_stream_set_volume (manager->priv->stream, vol) != FALSE)
522
549
                                         gvc_mixer_stream_push_volume (manager->priv->stream);
532
559
 }
533
560
 
534
561
 static void
535
 
@@ -860,8 +887,11 @@
 
562
@@ -860,8 +903,11 @@
536
563
 
537
564
 static gboolean
538
565
 do_multimedia_player_action (GsdMediaKeysManager *manager,
544
571
         return gsd_media_player_key_pressed (manager, key);
545
572
 }
546
573
 
547
 
@@ -932,19 +962,19 @@
 
574
@@ -932,19 +978,19 @@
548
575
                 execute (manager, "gcalctool", FALSE, FALSE);
549
576
                 break;
550
577
         case PLAY_KEY:
569
596
                 break;
570
597
         default:
571
598
                 g_assert_not_reached ();
572
 
@@ -1080,6 +1110,8 @@
 
599
@@ -1080,6 +1126,8 @@
573
600
 
574
601
         gvc_mixer_control_open (manager->priv->volume);
575
602
 
578
605
         gnome_settings_profile_end ("gvc_mixer_control_new");
579
606
 #endif /* HAVE_PULSE */
580
607
         g_idle_add ((GSourceFunc) start_media_keys_idle_cb, manager);
581
 
@@ -1172,6 +1204,9 @@
 
608
@@ -1172,6 +1220,9 @@
582
609
         }
583
610
         g_list_free (priv->media_players);
584
611
         priv->media_players = NULL;