summaryrefslogtreecommitdiffstats
path: root/kxkb/extension.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kxkb/extension.cpp')
-rw-r--r--kxkb/extension.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/kxkb/extension.cpp b/kxkb/extension.cpp
index cf2751068..863cf22e5 100644
--- a/kxkb/extension.cpp
+++ b/kxkb/extension.cpp
@@ -32,7 +32,7 @@ XKBExtension::XKBExtension(Display *d)
if ( d == NULL )
d = tqt_xdisplay();
m_dpy = d;
-
+
// TQStringList dirs = TDEGlobal::dirs()->findDirs ( "tmp", "" );
// m_tempDir = dirs.count() == 0 ? "/tmp/" : dirs[0];
m_tempDir = locateLocal("tmp", "");
@@ -44,7 +44,7 @@ bool XKBExtension::init()
int major = XkbMajorVersion;
int minor = XkbMinorVersion;
-
+
if (!XkbLibraryVersion(&major, &minor))
{
kdError() << "[kxkb-extension] Xlib XKB extension " << major << '.' << minor <<
@@ -101,7 +101,7 @@ bool XKBExtension::setXkbOptions(const XkbOptions options)
p << "-variant";
p << options.variants;
}
-
+
if (!options.model.isEmpty()) {
p << "-model";
p << options.model;
@@ -160,7 +160,7 @@ bool XKBExtension::setGroup(unsigned int group)
return XkbLockGroup( m_dpy, XkbUseCoreKbd, group );
}
-unsigned int XKBExtension::getGroup() const
+uint XKBExtension::getGroup() const
{
XkbStateRec xkbState;
XkbGetState( m_dpy, XkbUseCoreKbd, &xkbState );
@@ -170,9 +170,11 @@ unsigned int XKBExtension::getGroup() const
/** Examines an X Event passed to it and takes actions if the event is of
* interest to KXkb */
void XKBExtension::processXEvent(XEvent *event) {
- XkbEvent* xkb_event = (XkbEvent*)event;
- if (xkb_event->any.xkb_type == XkbStateNotify) {
- emit groupChanged(xkb_event->state.group);
+ XkbEvent* xkb_event = (XkbEvent*)event;
+ if (xkb_event->any.xkb_type == XkbStateNotify &&
+ xkb_event->state.changed & XkbGroupStateMask)
+ {
+ emit groupChanged(xkb_event->state.group);
}
}