summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-11-30 16:42:15 +0000
committerAndras Timar <andras.timar@collabora.com>2015-12-06 14:29:22 +0100
commit513c6092542b0fffa505299545308001a0091c5f (patch)
tree37b89b808008655a3a787e2d915534c6be0dee13
parent82074023fa78df4802abbdd53ae546f9402efea8 (diff)
gtk3: implement GetIndicatorState
(cherry picked from commit 503864037b2f6b73979f46d11df5d365b81f9dcf) (cherry picked from commit 6408b735283751cf6cacb8c758b99a2d90a9868a) Change-Id: I006c739a9dc876dd9ec83375f76fd1343b39557a Reviewed-on: https://gerrit.libreoffice.org/20312 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 754990128f177779e3279a3b06bc768ea2954621)
-rw-r--r--vcl/unx/gtk/window/gtksalframe.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index a28c144675f7..0e58788bcab5 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -3047,8 +3047,19 @@ 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 GTK_CHECK_VERSION(3,18,0)
+ if (gdk_keymap_get_scroll_lock_state(pKeyMap))
+ nState |= KeyIndicatorState::SCROLLLOCK;
+#endif
+ return nState;
#endif
}