Bug 29623

Summary: PrtSc button in Plasma doesn't work for (some?) existing users with existing spectacle (but no problem after installing spectacle for the first time, nor with a new user)
Product: Mageia Reporter: w unruh <unruh>
Component: RPM PackagesAssignee: KDE maintainers <kde>
Status: NEW --- QA Contact:
Severity: major    
Priority: Normal CC: davidwhodgins, fri, marja11
Version: CauldronKeywords: FOR_ERRATA8
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard: MGA8TOO
Source RPM: spectacle(?), Plasma(?) CVE:
Status comment:

Description w unruh 2021-11-04 17:09:26 CET
Description of problem: The fn+PrtSc button on my Dell XPS13 9310 machine does not seem to be working properly. In fact it seems to act identically to the Delete button.
It does not call forth the spectacle printscreen function even though in the SystemSetting->Shortcuts it is fn+Print is listed as starting spectacle, and 
shift+fn+print is listed as cpying the desktop, etc. 

In keyboarddrake I have tried a variety of keyboard type, but none make any difference.

I know there used to be program which would deliver the raw keyboard codes, but I cannot remember what it was. 

Is this a hardware problem (weird if it is) or some software problem.



Version-Release number of selected component (if applicable):No idea which component.


How reproducible:Always
Comment 1 w unruh 2021-11-04 19:47:41 CET
OK, something is strange. I opened another test user account, and here spectacle works. So it is clearly a configuration problem, but I have no idea what is misconfigured.
Comment 2 Lewis Smith 2021-11-04 21:57:55 CET
Trying this under Plasma (I think you use it), the SystemSettings-Shortcuts panel displayed for Spectacle shows these assigned keystrokes - which I have not fiddled with:
- Capture Active Window      Meta+Print[screen]
- Capture Entire Desktop     Shift+Print[screen]
- Capture Rectangular Region Meta+Shift+Print[screen]
- Launch Spectacle           Print[screen]

Meta = Windows key. They all worked as indicated.

Thank you for trying - successfully - with a different user.
> it is clearly a configuration problem
Indeed. Can you ask about this on the Mageia Forum? There is a wider audience there who might have some ideas.

CC: (none) => lewyssmith

Comment 3 Lewis Smith 2021-11-06 15:31:00 CET
I shall be away for a bit, so signing off.
Can somebody else please pick this up?

CC: lewyssmith => (none)

Comment 4 Marja Van Waes 2021-11-07 13:44:26 CET
(In reply to w unruh from comment #1)
> OK, something is strange. I opened another test user account, and here
> spectacle works. So it is clearly a configuration problem, but I have no
> idea what is misconfigured.

I can confirm the issue for an existing user in cauldron that had spectacle already installed, trying to re-assign the keyboard shortcuts to the same keys as are standard, didn't help (but I didn't log out and log back in). 

In another cauldron, after installing spectacle and adding spectacle to the applications with shortcuts in system settings, the default shortcuts worked right away.
I could see the shortcuts were added in .config/kglobalshortcutsrc
I didn't check that file in the cauldron with the issue.

Anyway, in Portuguese the shortcuts in that file look like this:

[org.kde.spectacle.desktop]
ActiveWindowScreenShot=Meta+Print,Meta+Print,Captura da Janela Activa
CurrentMonitorScreenShot=,none,Captura do Monitor Actual
FullScreenScreenShot=Shift+Print,Shift+Print,Captura de Todo o Ecrã
RectangularRegionScreenShot=Meta+Shift+Print,Meta+Shift+Print,Captura de uma Região Rectangular
_k_friendly_name=Spectacle
_launch=Print,Print,Invocar o Spectacle

But, w unruh, you could just try whether copying the settings from your new user to your old user solves the problem.


Anyway, this is for KDE team, because for some users this doesn't work out of the box

Assignee: bugsquad => kde
CC: (none) => marja11
Source RPM: spectacle(?), Plasma(?), BIOS(?) => spectacle(?), Plasma(?)
Version: 8 => Cauldron
Whiteboard: (none) => MGA8TOO

Marja Van Waes 2021-11-07 13:50:12 CET

Summary: PrtSc button on Dell xps13 9310 not working correctly => PrtSc button in Plasma doesn't work for (some?) existing users with existing spectacle (but no problem after installing spectacle for the first time, nor with a new user)

Comment 5 Dave Hodgins 2021-11-07 17:23:25 CET
This is an item for the errata. Some packages are good at converting config
files after an update, some are not. Packages are not allowed to modify files
in /home, as it may or may not be accessible during the package installation.

Hopefully we will be able to id the actual config file involved. If not, the
workaround is to backup the user's files, delete/recreate the user including
files in /home, and then to reapply config changes using the tools such as
systemsettings5, and to restore the data files manually.

CC: (none) => davidwhodgins
Keywords: (none) => FOR_ERRATA8
Whiteboard: MGA8TOO => MGA8TOO

Comment 6 Dave Hodgins 2021-11-07 19:14:47 CET
Clarifying. Packages are not allowed to modify files in /home during package
installation.

And the reason for this is that /home may not be accessible, if that user has
not logged in (network mounted or encrypted /home/$user). Even if the user
has logged in, root may not have access, as is the case when using sshfs
to mount directories/files in /home/$user.
Comment 7 Morgan Leijström 2022-04-02 12:16:38 CEST
I wonder if this is a duplicate of Bug 27183, which is in Errata?

And do the workaround for that as described in https://wiki.mageia.org/en/Mageia_8_Errata#Plasma work for this bug(too)?

CC: (none) => fri

Comment 8 Morgan Leijström 2022-05-01 00:55:31 CEST
@w unruh, per comment 7, can you check if it is that problem?
Then this bug can be closed as duplicate?.
Comment 9 w unruh 2022-09-17 06:24:48 CEST
I tried all the suggestions in comment 7. Nothing worked.
Comment 10 David Walser 2022-09-17 16:22:11 CEST
Try what Lewis said in Comment 2.  PrintScreen was no longer working for me since Mageia 8, but that fixed it.
Comment 11 w unruh 2022-09-17 18:20:36 CEST
That did not work.
 
I have discovered however that fn-PrtScr emits the same sequence as Del does
(^V-fn-PrtScr) emits ^[[3~ just as the Del key does in plasma. So something seems to have hijacked the fn-PrtScr in my system, which makes it not surprizing that fn-ProtScr does not work to call forth Spectacle. But I have no idea of where to even start looking as to where that key could have been redefined.
Comment 12 Morgan Leijström 2022-09-18 11:24:28 CEST
As it is per user (comment 1);

Did you try copying .config/kglobalshortcutsrc per Comment 4 ?

If there are more settings files somewhere to try, I hope someone can fill in.
Comment 13 w unruh 2022-09-18 13:06:28 CEST
Yes, I did. It did not help.
The problem, as in comment 11 seems to be that something is grabbing the Printscreen key and changing it to the Del key before the system tries to substitute the various Spectable possibilities for the keypress. That means that by the time the Shortcuts takes over, it thinks that the key pressed was Del rather than PrtScr, and of course that means Shortcut never runs Spectacle.

Now this problem just happens to me, not to other users, so it is something peculiar in my configuration, not in the general ystem handling of the  keyboard 
 keypress handler itself. But where in my configuration?
Comment 14 David Walser 2022-09-19 21:24:40 CEST
It should be PrtScr, not fn-PrtScr.  If you do what Lewis said in Comment 2, as soon as you click the thing to re-enable the default shortcuts for Spectacle, it will tell you what was hijacking them, and it will let Spectacle take control back for those key sequences.  If that doesn't work, you have a much bigger problem.  Maybe check your keyboard with xev and make sure it's emitting the right button signals.
Comment 15 w unruh 2022-12-25 05:24:14 CET
I did try comment 2 and it did nothing different than before. That is not suprizig if it thinks I have pressed the Del key.


On my keyboard, the PrtScr key is shared with  F10. For the other F? keys, it is fn that selects the alternative rather than the F key code. For the PrtScr/F10, pressing fn-F10 gives Del rather than Spectacle.
I have tried all of the suggestions, but none have worked.

I tried again to make the fn-PritScr  into the Spectacle launcher in Spectacle->Config but I get the warning

"The 'Del' key combination is also used for the standard action "Move to Trash" that some applications use.
Do you really want to use it as a global shortcut as well?"

Ie, the system really thinks that fn-PrtScr is the Del key.
Comment 16 w unruh 2023-01-08 02:25:22 CET
Here is the output to xev.
The fir  two are when I press fn-Prtsc. The second two are when I press the DEL key. 



KeyPress event, serial 40, synthetic NO, window 0x6c00001,
    root 0x523, subw 0x0, time 14185088, (-1448,-274), root:(294,715),
    state 0x0, keycode 107 (keysym 0xffff, Delete), same_screen YES,
    XLookupString gives 1 bytes: (7f) ""
    XmbLookupString gives 1 bytes: (7f) ""
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x6c00001,
    root 0x523, subw 0x0, time 14185276, (-1448,-274), root:(294,715),
    state 0x0, keycode 107 (keysym 0xffff, Delete), same_screen YES,
    XLookupString gives 1 bytes: (7f) ""
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x6c00001,
    root 0x523, subw 0x0, time 14210329, (-1448,-274), root:(294,715),
    state 0x0, keycode 119 (keysym 0xffff, Delete), same_screen YES,
    XKeysymToKeycode returns keycode: 107
    XLookupString gives 1 bytes: (7f) ""
    XmbLookupString gives 1 bytes: (7f) ""
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x6c00001,
    root 0x523, subw 0x0, time 14210536, (-1448,-274), root:(294,715),
    state 0x0, keycode 119 (keysym 0xffff, Delete), same_screen YES,
    XKeysymToKeycode returns keycode: 107
    XLookupString gives 1 bytes: (7f) ""
    XFilterEvent returns: False


But kde thinks that both are the samekey, namely del.
So something is hijacking the fn-prtsc key and substitutint Del, meaning that printscreen does not work.
Comment 17 Dave Hodgins 2023-01-08 02:50:55 CET
I think this is controlled by /etc/default/keyboard
Comment 18 w unruh 2023-01-08 06:06:16 CET
The problem is that it is my account that has this problem. Root for example does not.