[caribou] display-adapter: Allow setting an external default adapter instance



commit ad154e740dba89dfdae30f80beab056601b69472
Author: Rui Matos <tiagomatos gmail com>
Date:   Thu Apr 2 19:30:34 2015 +0200

    display-adapter: Allow setting an external default adapter instance
    
    This will allow gnome-shell, when running as a native wayland
    compositor, to set its own display adapter implementation since the X
    one doesn't work for that case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747273

 libcaribou/display-adapter.vala |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/libcaribou/display-adapter.vala b/libcaribou/display-adapter.vala
index 007d90e..6ffbdd5 100644
--- a/libcaribou/display-adapter.vala
+++ b/libcaribou/display-adapter.vala
@@ -110,6 +110,13 @@ namespace Caribou {
                                                    KeyButtonCallback? func);
 
         static DisplayAdapter instance;
+        public static bool set_default (DisplayAdapter adapter) {
+            if (instance != null)
+                return false;
+
+            instance = adapter;
+            return true;
+        }
         public static DisplayAdapter get_default () {
             if (instance == null) {
                 var display = Gdk.DisplayManager.get ().get_default_display ();


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