Home Forums Wiki Doc Install Extras Screenshots Source Code Projects Blog Users Groups Register
Glx-Dock / Cairo-Dock List of forums Git Version | Version Git xkl_engine_get_state returns incorrect group value in 64-bits (KDE+XFCE) - Applet Keyboard
The latest stable release is the *3.4.0* : How to install it here.
Note: We just switched from BZR to Git on Github! (only to host the code and your future pull requests)
Git Version | Version Git

Subjects Author Language Messages Last message
[Locked] xkl_engine_get_state returns incorrect group value in 64-bits (KDE+XFCE) - Applet Keyboard
Page : 1 2 3 4 5 6
FrankKubuntu Français 115 FrankKubuntu [Read]
01 January 2013 à 14:56

matttbe, Saturday 15 December 2012 à 21:54


Subscription date : 24 January 2009
Messages : 12573
No, just launch the dock without debug messages but enable all debug messages from XKL:
env XKL_DEBUG=999 cairo-dock


Also, it's maybe better to only use xklavier lib to get state of Caplock/numlock:
=== modified file 'keyboard-indicator/src/applet-xklavier.c'
--- keyboard-indicator/src/applet-xklavier.c    2012-11-02 19:13:48 +0000
+++ keyboard-indicator/src/applet-xklavier.c    2012-12-15 20:50:57 +0000
@@ -108,13 +108,@@
             
state.indicators 0;
         }
         
guint32 indicators;
-        
#if (GTK_MAJOR_VERSION < 3)
         
indicators state.indicators;
-        
#else // it seems that we don't get the right indicators...
-        GdkKeymap *pKeyMap gdk_keymap_get_default ();
-        
// second bit for numlock, first bit for caps lock => 0011 = numlock & caps lock
-        indicators = (gdk_keymap_get_num_lock_state (pKeyMap) << 1) + gdk_keymap_get_caps_lock_state (pKeyMap);
-        
#endif
         
cd_debug ("group : %d -> %d ; indic : %d -> %d"myData.iCurrentGroupstate.groupmyData.iCurrentIndicindicators);
         
         if (
myData.iCurrentGroup == state.group && myData.iCurrentIndic == indicators)


DON'T FORGET TO REVERT YOUR CHANGE before the next update to avoid conflicts

Do I need to define the function? Do I need to use "()" somewhere? Do I need stdio.h header somewhere?

Here's an example of a line with the xkl_engine_get_toplevel_window_state function:
Keyboard-Indicator plugin is already using this function because xkl_engine_get_state is used and this function returns the result of xkl_engine_get_toplevel_window_state

FrankKubuntu, Saturday 15 December 2012 à 22:00


Subscription date : 21 October 2009
Messages : 1575
Oh, it does return the result? So it's not a problem that it does not return the result, it's the result that is invalid... ooooh!

This is what I get when I launch CD with your "env" parm.

$ env XKL_DEBUG=999 cairo-dock

============================================================================
Cairo-Dock version : 3.1.99.alpha0
Compiled date : Dec 15 2012 13:28:25
Built with GTK : 3.2
Running with OpenGL: 1
============================================================================

warning : (/home/frank/stuff/Downloads/cairo-dock_bzr/cairo-dock-plug-ins/Dbus/src/applet-dbus.c:cd_dbus_register_module_in_dir:172)
file /home/frank/.config/cairo-dock/third-party/po/auto-load.conf should not be here
Cairo-Dock - Launcher API Daemon is already running (2296)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (_MainDock_)
CairoKeyBinding '<Control>F1' failed!
warning : (/home/frank/stuff/Downloads/cairo-dock_bzr/cairo-dock-core/src/gldit/cairo-dock-keybinder.c:cd_keybinder_bind:282)
Couldn't bind '<Control>F1' (Applications Menu: Show/hide the Applications menu)
This shortkey is probably already used by another applet or another application
CairoKeyBinding '<Control>F2' failed!
warning : (/home/frank/stuff/Downloads/cairo-dock_bzr/cairo-dock-core/src/gldit/cairo-dock-keybinder.c:cd_keybinder_bind:282)
Couldn't bind '<Control>F2' (Applications Menu: Show/hide the quick-launch dialog)
This shortkey is probably already used by another applet or another application
warning : (/home/frank/stuff/Downloads/cairo-dock_bzr/cairo-dock-plug-ins/kde-integration/src/applet-vfs.c:vfs_backend_measure_directory:1322)
kde-integration : The URI 'trash://' is not an absolute URI using the "file" scheme
warning : (/home/frank/stuff/Downloads/cairo-dock_bzr/cairo-dock-plug-ins/mail/src/cd-mail-applet-init.c:_load_theme:161)
mail : couldn't find images, this theme is not valid
_cd_find_volume_name_from_drive_name: assertion `pDrive != NULL' failed
_cd_find_volume_name_from_drive_name: assertion `pDrive != NULL' failed
_cd_find_volume_name_from_drive_name: assertion `pDrive != NULL' failed
_cd_find_volume_name_from_drive_name: assertion `pDrive != NULL' failed
_cd_find_volume_name_from_drive_name: assertion `pDrive != NULL' failed
_cd_find_volume_name_from_drive_name: assertion `pDrive != NULL' failed
CairoKeyBinding '<Control>F3' failed!
warning : (/home/frank/stuff/Downloads/cairo-dock_bzr/cairo-dock-core/src/gldit/cairo-dock-keybinder.c:cd_keybinder_bind:282)
Couldn't bind '<Control>F3' (Sound Control: Show/hide the Sound menu)
This shortkey is probably already used by another applet or another application
_cairo_dock_search_icon_from_subdock (Mail)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (dolphin)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Mail)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (dolphin)
_cairo_dock_search_icon_from_subdock (_MainDock_)
on_name_owner_changed:
g_object_unref: assertion `G_IS_OBJECT (object)' failed
_cairo_dock_create_surface_from_desktop_bg: assertion `iRootPixmapID != 0' failed
warning : (/home/frank/stuff/Downloads/cairo-dock_bzr/cairo-dock-plug-ins/switcher/src/applet-load-icons.c:cd_switcher_load_desktop_bg_map_surface:196)
couldn't get the wallpaper
[1355605203,150,xklavier.c:xkl_engine_one_switch_to_secondary_group_performed/] Resetting allow_one_switch_to_secondary_group flag
[1355605203,150,xklavier.c:xkl_engine_constructor/] Trying all backends:
[1355605203,150,xklavier.c:xkl_engine_constructor/] Trying XKB backend
[1355605203,160,xklavier_xkb.c:xkl_xkb_init/] xkbEvenType: 77, xkbError: A8, display: 0x1d5bdc0, root: 15a
[1355605203,100,xklavier_config_xkb.c:xkl_xkb_multiple_layouts_supported/] !!! Checking multiple layouts support
[1355605203,100,xklavier_config.c:xkl_engine_get_ruleset_name/] Rules set: [evdev]
[1355605203,160,xklavier_config_xkb.c:xkl_rules_set_load/] Loading rules from [/usr/share/X11/xkb/rules/evdev]
[1355605203,200,xklavier_config_xkb.c:xkl_xkb_config_native_prepare/] keymap: (null)
[1355605203,200,xklavier_config_xkb.c:xkl_xkb_config_native_prepare/] keycodes: evdev+aliases(qwerty)
[1355605203,200,xklavier_config_xkb.c:xkl_xkb_config_native_prepare/] compat: complete
[1355605203,200,xklavier_config_xkb.c:xkl_xkb_config_native_prepare/] types: complete
[1355605203,200,xklavier_config_xkb.c:xkl_xkb_config_native_prepare/] symbols: pc+us+de:2+inet(evdev)
[1355605203,200,xklavier_config_xkb.c:xkl_xkb_config_native_prepare/] geometry: pc(pc105)
[1355605203,100,xklavier_config_xkb.c:xkl_xkb_multiple_layouts_supported/] !!! Multiple layouts ARE supported
[1355605203,150,xklavier_xkb.c:xkl_xkb_init/] XInputExtension found (143, 100, 160) version 2.1
[1355605203,200,xklavier_xkb.c:xkl_xkb_init/] DevicePresence available
[1355605203,150,xklavier.c:xkl_engine_constructor/] Actual backend: XKB
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] found 2 groups
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Group 1 has name [English (US)]
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Group 0 has name [French (Canada)]
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[31] is Caps Lock
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[30] is Num Lock
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[29] is Scroll Lock
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[28] is Compose
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[27] is Kana
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[26] is Sleep
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[25] is Suspend
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[24] is Mute
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[23] is Misc
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[22] is Mail
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[21] is Charging
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[20] is Shift Lock
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[19] is Group 2
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[18] is Mouse Keys
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[17] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[16] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[15] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[14] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[13] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[12] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[11] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[10] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[9] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[8] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[7] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[6] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[5] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[4] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[3] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[2] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[1] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Indicator[0] is
[1355605203,200,xklavier_xkb.c:xkl_xkb_load_all_info/] Real indicators are 7FF
[1355605203,150,xklavier_toplevel.c:xkl_engine_get_toplevel_window_state/] Appwin 240000b, 'Yakuake' does not have state
warning : (/home/frank/stuff/Downloads/cairo-dock_bzr/cairo-dock-plug-ins/keyboard-indicator/src/applet-xklavier.c:cd_xkbd_keyboard_state_changed:106)
xkl_engine_get_state() failed, we use the first keyboard layout as a workaround (37748747, 0)
[1355605203,100,xklavier_xkb.c:xkl_xkb_lock_group/] Posted request for change the group to 0 ##
[1355605224,150,xklavier_toplevel.c:xkl_engine_get_toplevel_window_state/] Appwin 44000e8, 'Glx-Dock / Cairo-Dock - xkl_engi' does not have state
warning : (/home/frank/stuff/Downloads/cairo-dock_bzr/cairo-dock-plug-ins/keyboard-indicator/src/applet-xklavier.c:cd_xkbd_keyboard_state_changed:106)
xkl_engine_get_state() failed, we use the first keyboard layout as a workaround (16, 0)

FrankKubuntu, Saturday 15 December 2012 à 22:02


Subscription date : 21 October 2009
Messages : 1575
Same error msg as before when I try to switch.

So if CD returns a result of the xklavier function, what is the result returned as per my debug?

g_object_unref: assertion `G_IS_OBJECT (object)' failed
_cairo_dock_search_icon_from_subdock (Mail)
_cairo_dock_search_icon_from_subdock (Shortcuts)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (dolphin)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Mail)
_cairo_dock_search_icon_from_subdock (Shortcuts)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (dolphin)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Mail)
_cairo_dock_search_icon_from_subdock (Shortcuts)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (dolphin)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Mail)
_cairo_dock_search_icon_from_subdock (Shortcuts)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (dolphin)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Mail)
_cairo_dock_search_icon_from_subdock (Shortcuts)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (dolphin)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Mail)
_cairo_dock_search_icon_from_subdock (Shortcuts)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (dolphin)
_cairo_dock_search_icon_from_subdock (_MainDock_)
[1355605289,150,xklavier_toplevel.c:xkl_engine_get_toplevel_window_state/] Appwin 240000b, 'Yakuake' does not have state
cd_xkbd_set_group: assertion `bSuccess' failed
[1355605307,150,xklavier_toplevel.c:xkl_engine_get_toplevel_window_state/] Appwin 44000e8, 'Glx-Dock / Cairo-Dock - xkl_engi' does not have state

FrankKubuntu, Saturday 15 December 2012 à 22:09


Subscription date : 21 October 2009
Messages : 1575
For the CAPS LOCK, something went wrong lolll

$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Warning (dev) at src/CMakeLists.txt:21 (add_definitions):
Policy CMP0005 is not set: Preprocessor definition values are now escaped
automatically. Run "cmake --help-policy CMP0005" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at src/CMakeLists.txt:22 (add_definitions):
Policy CMP0005 is not set: Preprocessor definition values are now escaped
automatically. Run "cmake --help-policy CMP0005" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at src/CMakeLists.txt:23 (add_definitions):
Policy CMP0005 is not set: Preprocessor definition values are now escaped
automatically. Run "cmake --help-policy CMP0005" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at src/CMakeLists.txt:24 (add_definitions):
Policy CMP0005 is not set: Preprocessor definition values are now escaped
automatically. Run "cmake --help-policy CMP0005" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at src/CMakeLists.txt:25 (add_definitions):
Policy CMP0005 is not set: Preprocessor definition values are now escaped
automatically. Run "cmake --help-policy CMP0005" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at src/CMakeLists.txt:26 (add_definitions):
Policy CMP0005 is not set: Preprocessor definition values are now escaped
automatically. Run "cmake --help-policy CMP0005" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at src/CMakeLists.txt:27 (add_definitions):
Policy CMP0005 is not set: Preprocessor definition values are now escaped
automatically. Run "cmake --help-policy CMP0005" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at src/CMakeLists.txt:28 (add_definitions):
Policy CMP0005 is not set: Preprocessor definition values are now escaped
automatically. Run "cmake --help-policy CMP0005" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at src/CMakeLists.txt:29 (add_definitions):
Policy CMP0005 is not set: Preprocessor definition values are now escaped
automatically. Run "cmake --help-policy CMP0005" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Error at src/CMakeLists.txt:39 (target_link_libraries):
target_link_libraries called with incorrect number of arguments

CMake Error at data/CMakeLists.txt:4 (install):
install FILES given no DESTINATION!

CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as

cmake_minimum_required(VERSION 2.8)

should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!

matttbe, Saturday 15 December 2012 à 22:52


Subscription date : 24 January 2009
Messages : 12573
Oh, it does return the result? So it's not a problem that it does not return the result, it's the result that is invalid... ooooh!
xkl_engine_get_state returns a boolean (which seems to be false for you which means that there is a problem) and modify the state variable (which is used to know if capslock, numlock, etc. is enabled or not).

_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (_MainDock_)
_cairo_dock_search_icon_from_subdock (Script)
_cairo_dock_search_icon_from_subdock (_MainDock_)
(...)
Did you use the latest rev for cairo-dock-core (and its plugin)?
cd /home/frank/stuff/Downloads/cairo-dock_bzr/cairo-dock-core
bzr revno
bzr up
bzr revno


[1355605203,150,xklavier.c:xkl_engine_one_switch_to_secondary_group_performed/] Resetting allow_one_switch_to_secondary_group flag
[1355605203,150,xklavier.c:xkl_engine_constructor/] Trying all backends:
[1355605203,150,xklavier.c:xkl_engine_constructor/] Trying XKB backend
[1355605203,160,xklavier_xkb.c:xkl_xkb_init/] xkbEvenType: 77, xkbError: A8, display: 0x1d5bdc0, root: 15a
[1355605203,100,xklavier_config_xkb.c:xkl_xkb_multiple_layouts_supported/] !!! Checking multiple layouts support
(...)
I guess this debug messages are useful for xklavier devs (and also all messages that you'll have when you enable/disable capslock.

For the CAPS LOCK, something went wrong lolll
$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr-- The C compiler identification is GNU
From which folder did you launched this command? If you want to rebuild keyboard-indicator, simply do that:
cd /home/frank/stuff/Downloads/cairo-dock_bzr/cairo-dock-plug-ins/build
rm -rf *
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug
cd keyboard-indicator
make -j 8
sudo make install

FrankKubuntu, Sunday 16 December 2012 à 06:08


Subscription date : 21 October 2009
Messages : 1575
Core 1293, plug-ins latest of Dec 15, it's on my other HD which is shutdown and in my garage at the moment. loll

According to libxklavier,
printf inside get_state function would allow to print the results of XGetWindowProerty, that would explain the false return value


So I try to use printf but I am so far unable to understand how to implement that function inside the .c.

In the meantime, I'll send him the debug again and boolean thing.

matttbe, Sunday 16 December 2012 à 12:48


Subscription date : 24 January 2009
Messages : 12573
Core 1293, plug-ins latest of Dec 15
Are you sure that you've no other conflicts? This is why it can be interesting to launch `bzr revno` and `bzr up` commands.

According to libxklavier,
printf inside get_state function would allow to print the results of XGetWindowProerty, that would explain the false return value
I guess you need to edit xkl_engine_get_toplevel_window_state function in libxklavier/xklavier_toplevel.c but I don't know what he wants to see... This is what we can found at the end of this function:
    if (ret)
        
xkl_debug(150,
              
"Appwin " WINID_FORMAT
              
", '%s' has the group %d, indicators %X\n",
              
toplevel_win,
              
xkl_get_debug_window_title(enginetoplevel_win),
              
grpinds);
    else
        
xkl_debug(150,
              
"Appwin " WINID_FORMAT
              
", '%s' does not have state\n"toplevel_win,
              
xkl_get_debug_window_title(engine,
                             
toplevel_win));
xkl_debug uses printf (imagine a printf command with 2 new arguments at the beginning: 150, "Appwin " WINID_FORMAT",) to display something like that on the standard output:
[1355...,150,xklavier_toplevel.c:xkl_engine_get_toplevel_window_state/]     Appwin xxxxxxx, 'env XKL_DEBUG=999 cairo-dock' has the group X, indicators Y
Is it enough?

About printf: http://www.siteduzero.com/tutoriel-3-13937-afficher-le-contenu-d-une-variable.html or https://en.wikipedia.org/wiki/Printf_format_string

FrankKubuntu, Sunday 16 December 2012 à 16:46


Subscription date : 21 October 2009
Messages : 1575
I'll check for conflicts, what I can tell is that the compile worked perfectly without any errors.

That is what he wants to see:

printf inside get_state function would allow to print the results of
XGetWindowProerty, that would explain the false return value


Do you mean you don't know if he wants to see a float, integer, long, etc.?

FrankKubuntu, Sunday 16 December 2012 à 16:56


Subscription date : 21 October 2009
Messages : 1575
matttbe :
I guess you need to edit xkl_engine_get_toplevel_window_state function in libxklavier/xklavier_toplevel.c but I don't know what he wants to see... This is what we can found at the end of this function:
    if (ret)
        
xkl_debug(150,
              
"Appwin " WINID_FORMAT
              
", '%s' has the group %d, indicators %X\n",
              
toplevel_win,
              
xkl_get_debug_window_title(enginetoplevel_win),
              
grpinds);
    else
        
xkl_debug(150,
              
"Appwin " WINID_FORMAT
              
", '%s' does not have state\n"toplevel_win,
              
xkl_get_debug_window_title(engine,
                             
toplevel_win));
xkl_debug uses printf (imagine a printf command with 2 new arguments at the beginning: 150, "Appwin " WINID_FORMAT",) to display something like that on the standard output:
[1355...,150,xklavier_toplevel.c:xkl_engine_get_toplevel_window_state/]     Appwin xxxxxxx, 'env XKL_DEBUG=999 cairo-dock' has the group X, indicators Y
Is it enough?


Ok but how do I make it display something like that?
Where do I put the printf? And how do I format the %d and function name inside the printf()?
That's what I don't get...

Like this?

    if (ret)
        xkl_debug(150,
             printf("Appwin " WINID_FORMAT)
             printf(", '%s' has the group %d, indicators %X\n", topplevel_win),
             xkl_get_debug_window_title(engine, toplevel_win),
             grp, inds);
    else
        xkl_debug(150,
             printf("Appwin " WINID_FORMAT)
             printf(", '%s' does not have state\n", toplevel_win),
             xkl_get_debug_window_title(engine,
                         toplevel_win));


What about this?

    if (!ignore_existing_state) {
        gboolean have_state =
         xkl_engine_get_toplevel_window_state(engine,
                             toplevel_win,
                             &state);

        if (have_state) {
            xkl_debug(150,
                 "The window " WINID_FORMAT
                 " does not require to be added, it already has the xklavier state \n",
                 toplevel_win);
            return;
        }


No need to edit there?

And here?

    if (default_group_to_use == -1) {
        Window transient_for = 0;
        if (XGetTransientForHint(xkl_engine_get_display(engine), toplevel_win, &transient_for)) {
            if (transient_for) {
                XklState trans_state;
                gboolean have_state =
                    xkl_engine_get_toplevel_window_state(engine,
                             transient_for,
                             &trans_state);
                if (have_state) {
                    default_group_to_use = trans_state.group;
                }
            }
        }
    }


There are a lot of places in the .c where I can see the xkl_engine_get_toplevel_window_state function, but I don't know which one(s) to modify and how.

FrankKubuntu, Sunday 16 December 2012 à 17:19


Subscription date : 21 October 2009
Messages : 1575
In the meantime:

$ bzr revno
1296
$ bzr up
M CMakeLists.txt
M data/CMakeLists.txt
M src/gldit/CMakeLists.txt
All changes applied successfully.
Updated to revision 1296 of branch http://bazaar.launchpad.net/~cairo-dock-team/cairo-dock-core/cairo-dock
$ bzr revno
1296

FrankKubuntu, Sunday 16 December 2012 à 17:20


Subscription date : 21 October 2009
Messages : 1575
The dev just replied:

Well, xkl_debug works ok, no need in sprintf. Yes, all those debug statements
provide plenty of information. And I asked to add one more xkl_debug into
get_state function. It should explain the results of XGetProperty call.


So what now? I will not printf the .c?
Then how can I know how and where to add another xkl_debug into the get_state function?

My guess is I have to add another xkl_debug in

    if (ret)
        xkl_debug(150,
             "Appwin " WINID_FORMAT
             ", '%s' has the group %d, indicators %X\n",
             toplevel_win,
             xkl_get_debug_window_title(engine, toplevel_win),
             grp, inds);
    else
        xkl_debug(150,
             "Appwin " WINID_FORMAT
             ", '%s' does not have state\n", toplevel_win,
             xkl_get_debug_window_title(engine,
                         toplevel_win));


Or maybe here in:

    if (!ignore_existing_state) {
        gboolean have_state =
         xkl_engine_get_toplevel_window_state(engine,
                             toplevel_win,
                             &state);


Or here:

if (transient_for) {
                XklState trans_state;
                gboolean have_state =
                    xkl_engine_get_toplevel_window_state(engine,
                             transient_for,
                             &trans_state);
                if (have_state) {
                    default_group_to_use = trans_state.group;

FrankKubuntu, Sunday 16 December 2012 à 17:48


Subscription date : 21 October 2009
Messages : 1575
Ok, the other guy made the patch already:

Here is a patch I made for testing:
--- xklavier_toplevel.c    2010-01-11 02:57:51.000000000 +0200
+++ ../../../libxklavier-5.0/libxklavier/xklavier_toplevel.c    2012-12-15 01:43:51.794924977 +0200
@@ -292,7 +292,7 @@
    Atom type_ret;
    int format_ret;
    unsigned long nitems, rest;
-    CARD32 *prop = NULL;
+    long *prop = NULL;
    gboolean ret = FALSE;

    gint grp = -1;
@@ -305,6 +305,8 @@
     &format_ret, &nitems, &rest,
     (unsigned char **) (void *) &prop) == Success)
     && (type_ret == XA_INTEGER) && (format_ret == 32)) {
+
+        xkl_debug(0, "type: %d, format: %d\n", (int)type_ret, format_ret);
        grp = prop[0];
        if (grp >= xkl_engine_get_num_groups(engine) || grp < 0)
            grp = 0;
@@ -381,7 +383,7 @@
    Atom type_ret;
    int format_ret;
    unsigned long nitems, rest;
-    CARD32 *prop = NULL;
+    long *prop = NULL;
    if ((XGetWindowProperty
     (xkl_engine_get_display(engine), toplevel_win,
     xkl_engine_priv(engine, atoms)[XKLAVIER_TRANSPARENT], 0L, 1,


But my debug is the same... I don't get more info, so I must I have done something wrong when typing.

matttbe, Monday 17 December 2012 à 16:00


Subscription date : 24 January 2009
Messages : 12573
You can use this patch and launch the dock with:
env XKL_DEBUG=0 cairo-dock
(you should only see this new debug message )

And about your branch, can you check that:
cairo-dock -v
cd (...)/cairo-dock_bzr/cairo-dock-core/
bzr status

FrankKubuntu, Tuesday 18 December 2012 à 01:57


Subscription date : 21 October 2009
Messages : 1575
I'm out of luck, I get the same debug result.
And this time I was in Kubuntu 12.10 under VBox using Canonical's 3.1 version of CD.

Will try bzr and branch check-up later this week or this w-e.

God I can't provide debug info to the dev!! This thing will never get fixed.

FrankKubuntu, Tuesday 18 December 2012 à 02:22


Subscription date : 21 October 2009
Messages : 1575
But I know what the wants to see.

I want to see that:

type: %d, format: %d

In the output, with XKL_DEBUG=150


So far I can't have it. I'll try the debug code on different lines.
The famous debug line that should display TYPE and FORMAT is
xkl_debug(0, "type: %d, format: %d\n", (int)type_ret, format_ret);

matttbe, Wednesday 19 December 2012 à 08:55


Subscription date : 24 January 2009
Messages : 12573
Ok. Can you revert all your changes (or re-download on another directory the latest version of xklavier via git://anongit.freedesktop.org/libxklavier) and just before return ret (line 388) in xkl_engine_get_toplevel_window_state, add this line:
printf ("===== FRANK ===== type: %d, format: %d\n", (int)type_retformat_ret);
Recompile, install (with the right path) and relaunch the dock from your terminal. You should see ===== Frank =====

FrankKubuntu, Wednesday 19 December 2012 à 23:33


Subscription date : 21 October 2009
Messages : 1575
matttbe, before I try that I came across something the dev asked...

He says:
Somewhere in cairo-dock source code (or keyboard plugin?) there must be a call to xkl_engine_start_listen. I am asking about the 2nd parameter of that call.


I checked all .c files in the "keyboard-indicator" folder of the bzr version and couldn't find the keyword "listen".

Any idea if you use that function and where it's called?

He also said:
Also, the function xkl_engine_filter_events should be added to X11 events processing loop. I am sure cairo-doc developers will understand.


Comments, matttbe?

vas.pup, Thursday 20 December 2012 à 13:07


Subscription date : 13 December 2012
Messages : 8
Hi,
I think the problem may come from incorrect xklavier API usage - please read the end of this - https://bugs.freedesktop.org/show_bug.cgi?id=27737 long bug description.
We tried to debug the problem, and I think that it could be very useful if somebody from cairo developers will check the issue.

thanks.

vas.pup, Thursday 20 December 2012 à 13:10


Subscription date : 13 December 2012
Messages : 8
Ups... Sorry, I missed Frank's latest comment. We are talking about the same...

matttbe, Thursday 20 December 2012 à 20:40


Subscription date : 24 January 2009
Messages : 12573
Hello,

Yes, I think something is missing. I tried to rewrite it but it seems that some events (about the indicators) are intercepted... I hope fabounet will be able to fix this problem

Is it possible to test the latest version of keyboard-indicator (the latest revision (2656) on cairo-dock-plug-ins BZR repository)

Git Version | Version Git

Subjects Author Language Messages Last message
[Locked] xkl_engine_get_state returns incorrect group value in 64-bits (KDE+XFCE) - Applet Keyboard
Page : 1 2 3 4 5 6
FrankKubuntu Français 115 FrankKubuntu [Read]
01 January 2013 à 14:56


Glx-Dock / Cairo-Dock List of forums Git Version | Version Git xkl_engine_get_state returns incorrect group value in 64-bits (KDE+XFCE) - Applet Keyboard Top

Online users :

Powered by ElementSpeak © 2007 Adrien Pilleboue, 2009-2013 Matthieu Baerts.
Dock based on CSS Dock Menu (Ndesign) with jQuery. Icons by zgegball
Cairo-Dock is a free software under GNU-GPL3 licence. First stable version created by Fabounet.
Many thanks to TuxFamily for the web Hosting and Mav for the domain name.