[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#301971: KGlobalAccel conflicts with Mode_switch handling on SunRay



Package: kdelibs4
Version: 4:3.3.2-4.0.2
Severity: normal
Tags: patch

Kde global accelerators (like Ctrl+Fn to switch desktops, Alt_F2 for Run
Command, etc) don't work on SunRay terminals, served from a Debian Linux
server, if keyboard is in Russian mode. Accelerators work OK when
keyboard is in English mode.

This is caused by the way how SunRay's handle keyboard mode switch. The
X server used (Xnewt) does not support XKB. The only way to implement
two-language keyboard is to write a xmodmap file, that defines 4-keysym
mappings, and maps Mode_switch to mod3 (note that only mapping to mod3
works, mapping to any other X modifier does not).

This makes most things work correctly, but not KGlobalAccel, which
becomes confused by mod3 bit set in state of incoming X
KeyPress/KeyRelease events.

This may be fixed by applying the following patch to libkdecore (patch
done for KDE 3.3, but almost same applies to KDE 3.4).

diff -urN kdecore.orig/kglobalaccel_x11.cpp kdecore/kglobalaccel_x11.cpp
--- kdecore.orig/kglobalaccel_x11.cpp	2004-10-03 11:40:15.000000000 +0400
+++ kdecore/kglobalaccel_x11.cpp	2005-03-29 15:21:45.461660064 +0400
@@ -49,7 +49,8 @@
 	g_keyModMaskXOnOrOff =
 			KKeyServer::modXLock() |
 			KKeyServer::modXNumLock() |
-			KKeyServer::modXScrollLock();
+			KKeyServer::modXScrollLock() |
+			KKeyServer::modXModeSwitch();
 	//kdDebug() << "g_keyModMaskXAccel = " << g_keyModMaskXAccel
 	//	<< "g_keyModMaskXOnOrOff = " << g_keyModMaskXOnOrOff << endl;
 }
diff -urN kdecore.orig/kkeynative.h kdecore/kkeynative.h
--- kdecore.orig/kkeynative.h	2003-08-18 12:45:04.000000000 +0400
+++ kdecore/kkeynative.h	2005-03-29 15:18:46.000000000 +0400
@@ -235,6 +235,13 @@
 	 */
 	static uint modXScrollLock();
 
+	/**
+	 * Returns the X11 Mode_switch modifier mask/flag.
+	 * @return the X11 Mode_switch modifier mask/flag.
+	 * @see accelModMaskX()
+	 */
+	static uint modXModeSwitch();
+
  private:
 	uint m_code, m_mod, m_sym;
 	KKeyNativePrivate* d;
diff -urN kdecore.orig/kkeyserver_x11.cpp kdecore/kkeyserver_x11.cpp
--- kdecore.orig/kkeyserver_x11.cpp	2004-05-23 00:55:09.000000000 +0400
+++ kdecore/kkeyserver_x11.cpp	2005-03-29 15:21:03.000000000 +0400
@@ -283,13 +283,13 @@
 //---------------------------------------------------------------------
 static bool g_bInitializedMods, g_bInitializedVariations, g_bInitializedKKeyLabels;
 static bool g_bMacLabels;
-static uint g_modXNumLock, g_modXScrollLock;
+static uint g_modXNumLock, g_modXScrollLock, g_modXModeSwitch;
 
 bool initializeMods()
 {
 	XModifierKeymap* xmk = XGetModifierMapping( qt_xdisplay() );
 
-	g_rgModInfo[3].modX = g_modXNumLock = g_modXScrollLock = 0;
+	g_rgModInfo[3].modX = g_modXNumLock = g_modXScrollLock = g_modXModeSwitch = 0;
 
         int min_keycode, max_keycode;
         int keysyms_per_keycode = 0;
@@ -313,6 +313,7 @@
 			case XK_Meta_L:
 			case XK_Meta_R:      if( !g_rgModInfo[3].modX ) g_rgModInfo[3].modX = mask; break; // Win alternate
 			case XK_Scroll_Lock: g_modXScrollLock = mask; break;  // Normally Mod5Mask
+			case XK_Mode_switch: g_modXModeSwitch = mask; break;
 		}
 	}
 
@@ -533,6 +534,7 @@
 uint modXNumLock()    { if( !g_bInitializedMods ) { initializeMods(); } return g_modXNumLock; }
 uint modXWin()        { if( !g_bInitializedMods ) { initializeMods(); } return g_rgModInfo[3].modX; }
 uint modXScrollLock() { if( !g_bInitializedMods ) { initializeMods(); } return g_modXScrollLock; }
+uint modXModeSwitch() { if( !g_bInitializedMods ) { initializeMods(); } return g_modXModeSwitch; }
 
 uint accelModMaskX()
 {

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (620, 'testing'), (600, 'unstable'), (550, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.10-1-686-smp
Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R (charmap=KOI8-R)

Versions of packages kdelibs4 depends on:
ii  kdelibs-bin            4:3.3.2-4.0.2     KDE core binaries
ii  kdelibs-data           4:3.3.2-4         KDE core shared data
ii  libart-2.0-2           2.3.17-1          Library of functions for 2D graphi
ii  libarts1               1.3.2-2           aRts Sound system
ii  libasound2             1.0.8-3           ALSA library
ii  libaspell15            0.60.2+20050121-1 The GNU Aspell spell-checker runti
ii  libaudio2              1.7-2             The Network Audio System (NAS). (s
ii  libaudiofile0          0.2.3-4           The Audiofile Library
ii  libbz2-1.0             1.0.2-1           A high-quality block-sorting file 
ii  libc6                  2.3.2.ds1-20      GNU C Library: Shared libraries an
ii  libcupsys2-gnutls10    1.1.23-7          Common UNIX Printing System(tm) - 
ii  libesd0                0.2.35-2          Enlightened Sound Daemon - Shared 
ii  libfam0c102            2.7.0-6           client library to control the FAM 
ii  libgcc1                1:3.4.3-6         GCC support library
ii  libglib2.0-0           2.6.3-1           The GLib library of C routines
ii  libice6                4.3.0.dfsg.1-10   Inter-Client Exchange library
ii  libidn11               0.5.13-1.0        GNU libidn library, implementation
ii  libjack0.80.0-0        0.99.0-6          JACK Audio Connection Kit (librari
ii  libjasper-1.701-1      1.701.0-2         The JasPer JPEG-2000 runtime libra
ii  libjpeg62              6b-9              The Independent JPEG Group's JPEG 
ii  libmad0                0.15.1b-1         MPEG audio decoder library
ii  libogg0                1.1.0-1           Ogg Bitstream Library
ii  libopenexr2            1.2.2-1           runtime files for the OpenEXR imag
ii  libpcre3               4.5-1.1           Perl 5 Compatible Regular Expressi
ii  libpng12-0             1.2.8rel-1        PNG library - runtime
ii  libqt3c102-mt          3:3.3.3-8         Qt GUI Library (Threaded runtime v
ii  libsm6                 4.3.0.dfsg.1-10   X Window System Session Management
ii  libstdc++5             1:3.3.5-8         The GNU Standard C++ Library v3
ii  libtiff4               3.7.1-4           Tag Image File Format (TIFF) libra
ii  libvorbis0a            1.0.1-1           The Vorbis General Audio Compressi
ii  libvorbisenc2          1.0.1-1           The Vorbis General Audio Compressi
ii  libvorbisfile3         1.0.1-1           The Vorbis General Audio Compressi
ii  libx11-6               4.3.0.dfsg.1-10   X Window System protocol client li
ii  libxext6               4.3.0.dfsg.1-10   X Window System miscellaneous exte
ii  libxml2                2.6.16-4          GNOME XML library
ii  libxrender1            0.8.3-7           X Rendering Extension client libra
ii  libxslt1.1             1.1.12-6          XSLT processing library - runtime 
ii  libxt6                 4.3.0.dfsg.1-10   X Toolkit Intrinsics
ii  xbase-clients          4.3.0.dfsg.1-10   miscellaneous X clients
ii  xlibs                  4.3.0.dfsg.1-10   X Keyboard Extension (XKB) configu
ii  zlib1g                 1:1.2.2-3         compression library - runtime

-- no debconf information



Reply to: