[banshee] [osx] make X11 call in X11NotificationAreaBox ctor



commit 18805b0c6f427ad4d3850a68db50d91545e4ff73
Author: Aaron Bockover <abockover novell com>
Date:   Tue Jan 19 11:27:01 2010 -0500

    [osx] make X11 call in X11NotificationAreaBox ctor
    
    This will fail on quartz, which will allow the service to fall back
    to the built-in xplat GTK notification area, which in turn will
    do nothing on OS X.

 .../X11NotificationAreaBox.cs                      |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/X11NotificationAreaBox.cs b/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/X11NotificationAreaBox.cs
index 90f98ed..c165e6f 100644
--- a/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/X11NotificationAreaBox.cs
+++ b/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/X11NotificationAreaBox.cs
@@ -62,8 +62,16 @@ namespace Banshee.NotificationArea
             get { return event_box; }
         }
 
+        [System.Runtime.InteropServices.DllImport ("libgdk-x11-2.0.so.0")]
+        private static extern int gdk_x11_get_default_screen ();
+
         public X11NotificationAreaBox () : base (Catalog.GetString ("Banshee"))
         {
+            // NOTE: this is a dummy call to ensure we're actually on X11,
+            // otherwise X11 calls won't get made until we are realized,
+            // at which point it is too late to fall back to xplat GTK tray
+            gdk_x11_get_default_screen ();
+
             event_box = new EventBox ();
             Add (event_box);
             icon = new Image ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]