Super keys stop working after adjusting laptop brightness
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mate-dock-applet (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I'm running Ubuntu MATE 18.04 on an HP laptop, with mate-dock-applet 0.85-1. I'm using a tweaked version of the Mutiny panel layout, but the same thing happens in any layout that involves the mate-dock-applet.
I use an Fn modifier key plus the F2 and F3 keys to adjust brightness, and when I do, the Super keys stop working to launch the applications. When I adjust brightness via the Power Management menu it doesn't have an issue. I can get the functionality back by switching panel layouts and restoring it to the old one, presumably because it reloads the applet and rebinds the keys.
The only keys that appear to cause the problem are the brightness control keys. I use the Fn key plus F7 and F8 to adjust volume, and that does not have the same problem.
This might be something highly specific to my machine, so let me know if I need to provide more information. I dug through the code a bit, but it was my first foray into anything like this, so I didn't get much.
Changed in mate-dock-applet (Ubuntu): | |
assignee: | nobody → Nathan Schulzke (nschulzke) |
assignee: | Nathan Schulzke (nschulzke) → nobody |
tags: | added: bionic |
I figured out the problem. I logged the event in the run method of GlobalKeyBinding, and for most key events this is the kind of object I got:
<class 'Xlib.protocol. event.KeyPress' >(type = 130, detail = 10, sequence_number = 192, time = 4374640, root = <<class 'Xlib.display. Window' > 0x00000190>, window = <<class 'Xlib.display. Window' > 0x00000190>, child = <<class 'Xlib.display. Window' > 0x02011ddf>, root_x = 1167, root_y = 241, event_x = 1167, event_y = 241, state = 80, same_screen = 1)
But for my brightness control, this is what I got:
<class 'Xlib.protocol. event.MappingNo tify'>( type = 34, sequence_number = 193, request = 1, first_keycode = 8, count = 248)
No state to speak of. I added this if statement before the rest of the block, and it solved my problem:
if (hasattr(event, 'state')):
I'll fork and submit a pull request, if that's alright.