diff options
author | Rui Matos <tiagomatos@gmail.com> | 2015-04-02 19:30:34 +0200 |
---|---|---|
committer | Rui Matos <tiagomatos@gmail.com> | 2015-04-14 19:36:03 +0200 |
commit | 59e755dbff9b8d74df0015dad3d2981cb33bd8e7 (patch) | |
tree | eecd26cf03f2085097cb4477c98b45da32465619 | |
parent | 65f8427ea7edae7518396670125b7997fe494916 (diff) | |
download | caribou-59e755dbff9b8d74df0015dad3d2981cb33bd8e7.tar.gz |
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
-rw-r--r-- | 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 (); |