From ad154e740dba89dfdae30f80beab056601b69472 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Thu, 2 Apr 2015 19:30:34 +0200 Subject: 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 file changed, 7 insertions(+) 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 (); -- cgit v1.2.1