Bug 248250 - option to activate num-lock on kde start has no effect
Summary: option to activate num-lock on kde start has no effect
Status: RESOLVED WORKSFORME
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_keyboard (show other bugs)
Version: 0.2
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Andriy Rysin
URL:
Keywords: investigated, triaged
Depends on:
Blocks:
 
Reported: 2010-08-18 14:59 UTC by H.H.
Modified: 2018-10-21 04:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
test looking for NumLock modifier (1.95 KB, text/x-c++src)
2010-09-10 23:50 UTC, Andriy Rysin
Details
test looking for NumLock modifier v2 (2.30 KB, text/x-c++src)
2010-09-11 03:25 UTC, Andriy Rysin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description H.H. 2010-08-18 14:59:25 UTC
Version:           0.2 (using KDE 4.5.0) 
OS:                Linux

I have to activate num lock manually after every boot.

Reproducible: Always




OS: Linux (x86_64) release 2.6.34-12-desktop
Compiler: gcc
Comment 1 Andriy Rysin 2010-08-31 02:23:37 UTC
This all seems to work for me. But I've improved a code a bit anyway and provided some error output so if you can try the code after r1170172 commit (in 4.5 branch) and see if it works.

If it still doesn't work for you please try to turn numlock flag on/off in systemsettings and see the output from kded (e.g. in ~/.xsession-errors) if it provides any error messages with "numlock" in it.
Comment 2 H.H. 2010-08-31 16:49:38 UTC
Thanks, I'll try 4.5.2, when it is ready, then I'll report.
Comment 3 Alessandro Ghersi 2010-09-10 21:26:44 UTC
Hi, I tested this patch. It still doesn't work here. In my .xsession-errors I have this:
Fetched layout groups from X server: 	layouts: ("it") 	variants: ("") 
kded(1951): Failed to set numlock: numlock mask is 0 
kded(1951): Failed to set numlock: XkbLockModifiers request hasn't been sent 
Fetched layout groups from X server: 	layouts: ("it") 	variants: ("") 
QMetaObject::invokeMethod: No such method KUniqueApplication::loadCommandLineOptionsForNewInstance()
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
QMetaObject::invokeMethod: No such method KUniqueApplication::loadCommandLineOptionsForNewInstance()
Comment 4 Andriy Rysin 2010-09-10 23:50:43 UTC
Created attachment 51535 [details]
test looking for NumLock modifier

Alessandro could you please try to compile and run attached file and post the output? Thanks.
Comment 5 Alessandro Ghersi 2010-09-11 01:46:06 UTC
I built with:
g++ -o test xkb_mask_test.cpp -lpthread -lX11

./test says:
mod count 16
mod 0: NumLock
mask: 0x0

Tell me what you need to fix this bug so I can push the patch to our Kubuntu packages for the final release of Kubuntu Maverick on 10 October. Thanks ;)
Comment 6 Andriy Rysin 2010-09-11 03:25:34 UTC
Created attachment 51537 [details]
 test looking for NumLock modifier v2

Alessandro, could you please try with v2 of the test? Thanks.
Comment 7 Alessandro Ghersi 2010-09-11 04:09:56 UTC
With v2 of the test:
mod count 16
mod 0: NumLock
mask: 0x0
Comment 8 Andriy Rysin 2010-09-11 05:43:24 UTC
Hmm that's weird, looks like XkbVirtualModsToReal can't find real mod for NumLock. Something must be messed up with the modifiers mapping and I don't have enough knowledge in this area.

Also it works here on openSuSE 11.3 and Mandriva 2010.1 so I am curious if it's something related to Kubuntu or possibly newer x.org.
Comment 9 Alessandro Ghersi 2010-09-11 12:33:44 UTC
Can you attach again your patch? Maybe I can run your test with the patch and see if something is changed.
Comment 10 H.H. 2010-09-11 12:59:52 UTC
>Also it works here on openSuSE 11.3 and Mandriva 2010.1 so I am curious if it's
>something related to Kubuntu or possibly newer x.org.

I have the problem with opensuse-11.3. But it seems not to be reproducible 100% of the time. Today is the first time (I recognize), that num lock is activated at kde start.
Comment 11 Alessandro Ghersi 2010-09-11 13:50:20 UTC
I've also Gnome installed (from ubuntu-desktop package) in the same system and num lock works. I've just tried now.
Comment 12 Andriy Rysin 2010-09-11 15:13:48 UTC
hmm, it's good to know it works in gnome but not too good with being not 100% reproducable on opensuse. :)

could you please try xset and see if that changes the led for you?

xset led 3
xset -led 3

xset led named "Num Lock"
xset -led named "Num Lock"
Comment 13 Alessandro Ghersi 2010-09-11 15:18:56 UTC
With:
xset led 3
the led switch to "on"

With:
xset -led 3
the led switch to "off"

With:
xset led named "Num Lock"
xset -led named "Num Lock"
do nothing.
Comment 14 Andriy Rysin 2010-09-11 15:32:58 UTC
Cool, looks like setting leds by name (via XKB) is broken, you may wanna file a bug against xorg for the named led setting problem. I'll take a look if I can use the numeric approach "xset led 3" uses.
Comment 15 H.H. 2010-09-11 15:33:37 UTC
for me, both do nothing
Comment 16 Alessandro Ghersi 2010-09-11 15:56:01 UTC
Ops sorry, xset led 3 don't light the bloc num led, it light a led called "Pausa Interr" here
Comment 17 Andriy Rysin 2010-09-11 17:26:04 UTC
ok, seems it's quite messy there
could you please try 
xset led 1
and also try numlockx program?

For me seems that only the numlockx (which uses Xtest to emulate NumLock key press) is working reliably.
Comment 18 H.H. 2010-09-11 17:31:52 UTC
numlockx is the only command that works for me
Comment 19 Alessandro Ghersi 2010-09-11 17:53:23 UTC
xset led 1 do nothing.
With "numlockx on", the led is off but numpad works. I mean, with numlock on/off the numpad works but I don't have control on the led (the led doesn't light or turn off).
Comment 20 Andriy Rysin 2010-09-11 18:28:47 UTC
Ok, setting numlock seems to be quite messy, I had to just borrow the whole code from numlockx and pushed the change into both trunk and 4.5 branch. If you could try it and let me know if it helped I'd really appreciate it.
Comment 21 Alessandro Ghersi 2010-09-11 22:12:24 UTC
Numpad works but the led is off. If I push "Num Lock" button in the numpad the led turn on and the numpad doesn't work (is off) :)
You should fix the behaviour of the led now :)
Comment 22 Alessandro Ghersi 2010-09-11 22:16:24 UTC
It seems a fault of numlockx code:
https://bugs.launchpad.net/ubuntu/+source/numlockx/+bug/218202
Comment 23 Andriy Rysin 2010-09-11 23:49:47 UTC
Wow, even that bug looks messy spawning across several years and no stable results. The problems were reported for gnome, kde and xfce.

Seems that numlockx works for me on openSuse/Mandriva and for H.H. on openSuse so current solution in kde source is better than what we had before. So I'll just wait until somebody fixes numlockx or x.org for Ubuntu :)

Though Looking at what extent numlockx goes to set a simple led (several hundreds lines of code where it should be 1-liner) I'd say the problem lies at much lower level. There seems to be something quite wrong either at X.org level or at the kernel.

BTW to make sure it's not KDE's fault could you please try to start X without DE and try numlockx to see if it produces right results?
Comment 24 Alessandro Ghersi 2010-09-12 01:38:59 UTC
numlockx produces right results without a DE. Now I tried if it works in Gnome and it does, quite weird :)
Comment 25 Andrew Crouthamel 2018-09-20 22:03:59 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 26 Andrew Crouthamel 2018-10-21 04:54:14 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!