Bug 375708 - Turn on numlock at startup does not work under Wayland
Summary: Turn on numlock at startup does not work under Wayland
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: input (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Roman Gilg
URL:
Keywords:
: 377149 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-01-29 16:08 UTC by Patrick Silva
Modified: 2019-01-18 08:45 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.15
mgraesslin: Wayland+
mgraesslin: X11-


Attachments
Possible patch (3.25 KB, patch)
2018-10-14 16:37 UTC, Martin Flöser
Details
Try 2 (4.17 KB, patch)
2018-10-14 17:47 UTC, Martin Flöser
Details
Try 3 (7.28 KB, patch)
2018-10-25 17:46 UTC, Martin Flöser
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2017-01-29 16:08:31 UTC
I am testing plasma-wayland-devedition-gitunstable-20170128-2117-amd64.iso
and noticed this feature does not work under Wayland.
Comment 1 Christoph Feck 2017-03-18 20:13:14 UTC
*** Bug 377149 has been marked as a duplicate of this bug. ***
Comment 2 tromzy 2017-06-19 14:30:23 UTC
This bug still happens on Plasma 5.10 with Frameworks 5.35.
Comment 3 tromzy 2017-08-28 14:24:44 UTC
The bug still occurs on Plasma 5.10.5 and KDE Frameworks 5.37.
Comment 4 Martin Flöser 2017-08-28 16:00:08 UTC
There is no need to post every 2 months that this is still not implemented. Once we implement it the bug will be updated :-)
Comment 5 tromzy 2017-08-28 18:33:40 UTC
Sorry, I thought it was already implemented and that I was encountering a bug.
Comment 6 Patrick Silva 2018-01-17 01:26:16 UTC
this bug affects plasma 5.12 beta on Arch Linux.
Comment 7 Patrick Silva 2018-05-18 21:27:36 UTC
still not working in plasma 5.13 beta, Arch Linux.
Comment 8 Patrick Silva 2018-09-14 15:48:03 UTC
Still valid for plasma 5.14 beta on Arch Linux.
Comment 9 Martin Flöser 2018-09-28 04:16:24 UTC
There is no need to post every 2 months that this is still not implemented. Once we implement it the bug will be updated :-)
Comment 10 Martin Flöser 2018-10-14 16:37:30 UTC
Created attachment 115640 [details]
Possible patch

This is a possible patch for the feature. Unfortunately I only have systems without num block, so I cannot test the patch.

Please try and report back whether the patch implements it correctly.
Comment 11 Andrius Štikonas 2018-10-14 16:51:03 UTC
(In reply to Martin Flöser from comment #10)
> Created attachment 115640 [details]
> Possible patch
> 
> This is a possible patch for the feature. Unfortunately I only have systems
> without num block, so I cannot test the patch.
> 
> Please try and report back whether the patch implements it correctly.

I tried it with Plasma 5.13.5 and it doesn't work.

Is there anything you want me to try to try to debug this patch out?
Comment 12 Martin Flöser 2018-10-14 17:34:40 UTC
(In reply to Andrius Štikonas from comment #11)
> (In reply to Martin Flöser from comment #10)
> > Created attachment 115640 [details]
> > Possible patch
> > 
> > This is a possible patch for the feature. Unfortunately I only have systems
> > without num block, so I cannot test the patch.
> > 
> > Please try and report back whether the patch implements it correctly.
> 
> I tried it with Plasma 5.13.5 and it doesn't work.
> 
> Is there anything you want me to try to try to debug this patch out?

no, not really. I probably have to check into xkbcommon code to understand better what I need to do, to set the modifier.
Comment 13 Martin Flöser 2018-10-14 17:41:51 UTC
I think I found the reason: I'm reading the config value from the wrong file.
Comment 14 Martin Flöser 2018-10-14 17:47:07 UTC
Created attachment 115644 [details]
Try 2
Comment 15 Andrius Štikonas 2018-10-14 17:58:17 UTC
(In reply to Martin Flöser from comment #14)
> Created attachment 115644 [details]
> Try 2

Still nothing :(
Comment 16 Martin Flöser 2018-10-14 18:07:24 UTC
Just to make sure: you have the config option to enable numlock set, right?
Comment 17 Andrius Štikonas 2018-10-14 18:10:07 UTC
(In reply to Martin Flöser from comment #16)
> Just to make sure: you have the config option to enable numlock set, right?

Yes, of course. In kcminputrc, I have [Keyboard] section which contains NumLock=0.

And your patch is checking for 0 there.
Comment 18 Martin Flöser 2018-10-25 17:46:01 UTC
Created attachment 115900 [details]
Try 3

I added a unit test to investigate why my patch doesn't work and found a bug. I'm quite confident that it works now.
Comment 19 Andrius Štikonas 2018-10-25 18:02:54 UTC
(In reply to Martin Flöser from comment #18)
> Created attachment 115900 [details]
> Try 3
> 
> I added a unit test to investigate why my patch doesn't work and found a
> bug. I'm quite confident that it works now.

Third time's a charm.

Thanks a lot!
Comment 20 Martin Flöser 2018-11-01 16:50:34 UTC
Git commit 7c3a851b040e3b7d33186ce787c43683ec076525 by Martin Flöser.
Committed on 01/11/2018 at 16:49.
Pushed by graesslin into branch 'master'.

Support enabling numlock on startup

Summary:
This change brings improved num lock support to KWin. The modifier state
is read and also mapped to Qt::KeyboardModifiers. Furthermore the input
config is read and the NumLock key is evaluated. If the requested state
does not match the current num lock state the state is swapped.
FIXED-IN: 5.15

Test Plan: New unit test added, no manual test due to lack of hardware

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16428

M  +43   -0    autotests/integration/keyboard_layout_test.cpp
M  +1    -0    keyboard_input.cpp
M  +28   -0    xkb.cpp
M  +11   -0    xkb.h

https://commits.kde.org/kwin/7c3a851b040e3b7d33186ce787c43683ec076525
Comment 21 tromzy 2019-01-18 08:45:43 UTC
I can confirm that it works great now on Plasma 5.15 beta !