diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-04-08 04:57:37 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-04-08 04:57:37 +0200 |
| commit | 59b76bf78a2a931f7480bf1f9885cd2141d6492e (patch) | |
| tree | ca5be537b030beaa98b87e8c45e337a31a937445 | |
| parent | 271b927b1ef91242db22c2eca5cfdbfa67e08e37 (diff) | |
LockScreenSettings: add use_fallback option, that is on if OSK is active
This is to workaround on screen keyboard issues (bzr r3736.1.14)
| -rw-r--r-- | lockscreen/LockScreenSettings.cpp | 14 | ||||
| -rw-r--r-- | lockscreen/LockScreenSettings.h | 1 | ||||
| -rw-r--r-- | tests/data/external.gschema.xml | 6 |
3 files changed, 21 insertions, 0 deletions
diff --git a/lockscreen/LockScreenSettings.cpp b/lockscreen/LockScreenSettings.cpp index 319a7d75d..286da7513 100644 --- a/lockscreen/LockScreenSettings.cpp +++ b/lockscreen/LockScreenSettings.cpp @@ -49,6 +49,9 @@ const std::string IDLE_ACTIVATION_ENABLED_KEY = "idle-activation-enabled"; const std::string LOCK_DELAY = "lock-delay"; const std::string LOCK_ENABLED = "lock-enabled"; const std::string LOCK_ON_SUSPEND = "ubuntu-lock-on-suspend"; + +const std::string A11Y_SETTINGS = "org.gnome.desktop.a11y.applications"; +const std::string USE_OSK = "screen-keyboard-enabled"; } struct Settings::Impl @@ -56,11 +59,14 @@ struct Settings::Impl Impl() : greeter_settings_(g_settings_new(GREETER_SETTINGS.c_str())) , gs_settings_(g_settings_new(GS_SETTINGS.c_str())) + , a11y_settings_(g_settings_new(A11Y_SETTINGS.c_str())) , greeter_signal_(greeter_settings_, "changed", sigc::hide(sigc::hide(sigc::mem_fun(this, &Impl::UpdateGreeterSettings)))) , gs_signal_(gs_settings_, "changed", sigc::hide(sigc::hide(sigc::mem_fun(this, &Impl::UpdateGSSettings)))) + , osk_signal_(a11y_settings_, ("changed::"+USE_OSK).c_str(), sigc::hide(sigc::hide(sigc::mem_fun(this, &Impl::UpdateA11YSettings)))) { UpdateGreeterSettings(); UpdateGSSettings(); + UpdateA11YSettings(); } void UpdateGreeterSettings() @@ -83,11 +89,19 @@ struct Settings::Impl s->lock_delay = g_settings_get_uint(gs_settings_, LOCK_DELAY.c_str()); } + void UpdateA11YSettings() + { + auto* s = settings_instance; + s->use_legacy = g_settings_get_boolean(a11y_settings_, USE_OSK.c_str()) != FALSE; + } + glib::Object<GSettings> greeter_settings_; glib::Object<GSettings> gs_settings_; + glib::Object<GSettings> a11y_settings_; glib::Signal<void, GSettings*, const gchar*> greeter_signal_; glib::Signal<void, GSettings*, const gchar*> gs_signal_; + glib::Signal<void, GSettings*, const gchar*> osk_signal_; }; Settings::Settings() diff --git a/lockscreen/LockScreenSettings.h b/lockscreen/LockScreenSettings.h index 59c5f9dd0..0c49e9cea 100644 --- a/lockscreen/LockScreenSettings.h +++ b/lockscreen/LockScreenSettings.h @@ -46,6 +46,7 @@ public: nux::Property<int> lock_delay; nux::Property<bool> lock_enabled; nux::Property<bool> lock_on_suspend; + nux::Property<bool> use_legacy; static const int GRID_SIZE = 40; diff --git a/tests/data/external.gschema.xml b/tests/data/external.gschema.xml index 132b78a81..ebcfcc7a4 100644 --- a/tests/data/external.gschema.xml +++ b/tests/data/external.gschema.xml @@ -106,4 +106,10 @@ <default>true</default> </key> </schema> + + <schema path="/org/gnome/desktop/a11y/applications/" id="org.gnome.desktop.a11y.applications"> + <key type="b" name="screen-keyboard-enabled"> + <default>false</default> + </key> + </schema> </schemalist> |
