diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-11-30 16:42:15 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-30 16:44:10 +0000 |
commit | 6408b735283751cf6cacb8c758b99a2d90a9868a (patch) | |
tree | 177a0886730aee02daa5903292be532d4845b991 /vcl/unx | |
parent | 9401a065d0d53b31427f85a936ef53244ac8a6b8 (diff) |
gtk3: implement GetIndicatorState
Change-Id: I006c739a9dc876dd9ec83375f76fd1343b39557a
(cherry picked from commit 503864037b2f6b73979f46d11df5d365b81f9dcf)
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk/gtksalframe.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx index 923581d0fbee..4a9fa434c059 100644 --- a/vcl/unx/gtk/gtksalframe.cxx +++ b/vcl/unx/gtk/gtksalframe.cxx @@ -2786,8 +2786,18 @@ KeyIndicatorState GtkSalFrame::GetIndicatorState() #if !GTK_CHECK_VERSION(3,0,0) return GetGtkSalData()->GetGtkDisplay()->GetIndicatorState(); #else - g_warning ("missing get indicator state"); - return KeyIndicatorState::NONE; + KeyIndicatorState nState = KeyIndicatorState::NONE; + + GdkKeymap *pKeyMap = gdk_keymap_get_for_display(getGdkDisplay()); + + if (gdk_keymap_get_caps_lock_state(pKeyMap)) + nState |= KeyIndicatorState::CAPSLOCK; + if (gdk_keymap_get_num_lock_state(pKeyMap)) + nState |= KeyIndicatorState::NUMLOCK; + if (gdk_keymap_get_scroll_lock_state(pKeyMap)) + nState |= KeyIndicatorState::SCROLLLOCK; + + return nState; #endif } |