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:35:43 +0200 |
commit | ad154e740dba89dfdae30f80beab056601b69472 (patch) | |
tree | 948f69d14095b3c5d12e50c95d3aa48bd7d12c6e | |
parent | e3c26253e53c61d16e17570a76d90bc43da1e5c9 (diff) | |
download | caribou-ad154e740dba89dfdae30f80beab056601b69472.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 (); |