xpra icon
Bug tracker and wiki

Opened 6 months ago

Closed 5 months ago

#1824 closed defect (worksforme)

--key-shortcut not working when using start with attach=yes

Reported by: julian Owned by: julian
Priority: minor Milestone: 2.3
Component: keyboard Version: 2.2.x
Keywords: Cc:

Description

When running the command xpra start-desktop --daemon=no --attach=yes --start-child=i3 --key-shortcut='#+G':toggle_keyboard_grab :42, a window with a desktop appears but the shortcurt Meta-Shift-G does not work as expected (it does nothing).

When running start and attach separately (xpra start-desktop --daemon=no --attach=no --start-child=i3 :42 and xpra attach --key-shortcut='#+G':toggle_keyboard_grab :42) everything works as expected.

The following snippet from --debug=keyboard suggests that the parameter lists gets corrupted somewhere (notice the long single string 'Control+Menu:toggle_keyboard_grab, [...], #+G:toggle_keyboard_grab'). So far I've checked that the commandline gets parsed correctly by optparse (resulting in a list with one element per shortcut). However when the options reach parse_shortcuts, they are broken. As this happens in a different process with --attach=yes, I think there might be a problem with passing the arguments between processes, but I didn't dig deeper.

2018-04-29 17:21:01,694 parse_shortcuts(['Control+Menu:toggle_keyboard_grab', 'Shift+Menu:toggle_pointer_grab', 'Shift+F11:toggle_fullscreen', '#+F1:show_menu', '#+F2:show_start_new_command', '#+F3:show_bug_report', '#+F4:quit', '#+F5:increase_quality', '#+F6:decrease_quality', '#+F7:increase_speed', '#+F8:decrease_speed', '#+F10:magic_key', '#+F11:show_session_info', '#+F12:toggle_debug', '#+plus:scaleup', '#+minus:scaledown', '#+underscore:scaledown', '#+KP_Add:scaleup', '#+KP_Subtract:scaledown', '#+KP_Multiply:scalereset', '#+bar:scalereset', '#+question:scalingoff', 'Control+Menu:toggle_keyboard_grab, Shift+Menu:toggle_pointer_grab, Shift+F11:toggle_fullscreen, #+F1:show_menu, #+F2:show_start_new_command, #+F3:show_bug_report, #+F4:quit, #+F5:increase_quality, #+F6:decrease_quality, #+F7:increase_speed, #+F8:decrease_speed, #+F10:magic_key, #+F11:show_session_info, #+F12:toggle_debug, #+plus:scaleup, #+minus:scaledown, #+underscore:scaledown, #+KP_Add:scaleup, #+KP_Subtract:scaledown, #+KP_Multiply:scalereset, #+bar:scalereset, #+question:scalingoff, #+G:toggle_keyboard_grab'])
2018-04-29 17:21:01,694 parse_shortcuts: modifier names={'control': 'control', 'hyper': 'mod4', 'ctrl': 'control', 'shift': 'shift', 'mode_switch': 'mod5', 'altgr': 'mod5', 'meta': 'mod1', 'alt': 'mod1', 'super': 'mod3'}
2018-04-29 17:21:01,695 shortcut modifiers=['meta', 'shift']
2018-04-29 17:21:01,695 action(Control+Menu:toggle_keyboard_grab)=toggle_keyboard_grab()
2018-04-29 17:21:01,695 shortcut(Control+Menu:toggle_keyboard_grab)=['control'], toggle_keyboard_grab, ()
2018-04-29 17:21:01,695 action(Shift+Menu:toggle_pointer_grab)=toggle_pointer_grab()
2018-04-29 17:21:01,695 shortcut(Shift+Menu:toggle_pointer_grab)=['shift'], toggle_pointer_grab, ()
2018-04-29 17:21:01,695 action(Shift+F11:toggle_fullscreen)=toggle_fullscreen()
2018-04-29 17:21:01,695 shortcut(Shift+F11:toggle_fullscreen)=['shift'], toggle_fullscreen, ()
2018-04-29 17:21:01,695 action(#+F1:show_menu)=show_menu()
2018-04-29 17:21:01,695 shortcut(#+F1:show_menu)=['mod1', 'shift'], show_menu, ()
2018-04-29 17:21:01,695 action(#+F2:show_start_new_command)=show_start_new_command()
2018-04-29 17:21:01,695 shortcut(#+F2:show_start_new_command)=['mod1', 'shift'], show_start_new_command, ()
2018-04-29 17:21:01,695 action(#+F3:show_bug_report)=show_bug_report()
2018-04-29 17:21:01,696 shortcut(#+F3:show_bug_report)=['mod1', 'shift'], show_bug_report, ()
2018-04-29 17:21:01,696 action(#+F4:quit)=quit()
2018-04-29 17:21:01,696 shortcut(#+F4:quit)=['mod1', 'shift'], quit, ()
2018-04-29 17:21:01,696 action(#+F5:increase_quality)=increase_quality()
2018-04-29 17:21:01,696 shortcut(#+F5:increase_quality)=['mod1', 'shift'], increase_quality, ()
2018-04-29 17:21:01,696 action(#+F6:decrease_quality)=decrease_quality()
2018-04-29 17:21:01,696 shortcut(#+F6:decrease_quality)=['mod1', 'shift'], decrease_quality, ()
2018-04-29 17:21:01,696 action(#+F7:increase_speed)=increase_speed()
2018-04-29 17:21:01,696 shortcut(#+F7:increase_speed)=['mod1', 'shift'], increase_speed, ()
2018-04-29 17:21:01,696 action(#+F8:decrease_speed)=decrease_speed()
2018-04-29 17:21:01,696 shortcut(#+F8:decrease_speed)=['mod1', 'shift'], decrease_speed, ()
2018-04-29 17:21:01,696 action(#+F10:magic_key)=magic_key()
2018-04-29 17:21:01,696 shortcut(#+F10:magic_key)=['mod1', 'shift'], magic_key, ()
2018-04-29 17:21:01,696 action(#+F11:show_session_info)=show_session_info()
2018-04-29 17:21:01,696 shortcut(#+F11:show_session_info)=['mod1', 'shift'], show_session_info, ()
2018-04-29 17:21:01,696 action(#+F12:toggle_debug)=toggle_debug()
2018-04-29 17:21:01,697 shortcut(#+F12:toggle_debug)=['mod1', 'shift'], toggle_debug, ()
2018-04-29 17:21:01,697 action(#+plus:scaleup)=scaleup()
2018-04-29 17:21:01,697 shortcut(#+plus:scaleup)=['mod1', 'shift'], scaleup, ()
2018-04-29 17:21:01,697 action(#+minus:scaledown)=scaledown()
2018-04-29 17:21:01,697 shortcut(#+minus:scaledown)=['mod1', 'shift'], scaledown, ()
2018-04-29 17:21:01,697 action(#+underscore:scaledown)=scaledown()
2018-04-29 17:21:01,697 shortcut(#+underscore:scaledown)=['mod1', 'shift'], scaledown, ()
2018-04-29 17:21:01,697 action(#+KP_Add:scaleup)=scaleup()
2018-04-29 17:21:01,697 shortcut(#+KP_Add:scaleup)=['mod1', 'shift'], scaleup, ()
2018-04-29 17:21:01,697 action(#+KP_Subtract:scaledown)=scaledown()
2018-04-29 17:21:01,697 shortcut(#+KP_Subtract:scaledown)=['mod1', 'shift'], scaledown, ()
2018-04-29 17:21:01,697 action(#+KP_Multiply:scalereset)=scalereset()
2018-04-29 17:21:01,697 shortcut(#+KP_Multiply:scalereset)=['mod1', 'shift'], scalereset, ()
2018-04-29 17:21:01,697 action(#+bar:scalereset)=scalereset()
2018-04-29 17:21:01,697 shortcut(#+bar:scalereset)=['mod1', 'shift'], scalereset, ()
2018-04-29 17:21:01,697 action(#+question:scalingoff)=scalingoff()
2018-04-29 17:21:01,697 shortcut(#+question:scalingoff)=['mod1', 'shift'], scalingoff, ()
2018-04-29 17:21:01,698 action(Control+Menu:toggle_keyboard_grab, Shift+Menu:toggle_pointer_grab, Shift+F11:toggle_fullscreen, #+F1:show_menu, #+F2:show_start_new_command, #+F3:show_bug_report, #+F4:quit, #+F5:increase_quality, #+F6:decrease_quality, #+F7:increase_speed, #+F8:decrease_speed, #+F10:magic_key, #+F11:show_session_info, #+F12:toggle_debug, #+plus:scaleup, #+minus:scaledown, #+underscore:scaledown, #+KP_Add:scaleup, #+KP_Subtract:scaledown, #+KP_Multiply:scalereset, #+bar:scalereset, #+question:scalingoff, #+G:toggle_keyboard_grab)=toggle_keyboard_grab, Shift+Menu:toggle_pointer_grab, Shift+F11:toggle_fullscreen, #+F1:show_menu, #+F2:show_start_new_command, #+F3:show_bug_report, #+F4:quit, #+F5:increase_quality, #+F6:decrease_quality, #+F7:increase_speed, #+F8:decrease_speed, #+F10:magic_key, #+F11:show_session_info, #+F12:toggle_debug, #+plus:scaleup, #+minus:scaledown, #+underscore:scaledown, #+KP_Add:scaleup, #+KP_Subtract:scaledown, #+KP_Multiply:scalereset, #+bar:scalereset, #+question:scalingoff, #+G:toggle_keyboard_grab()
2018-04-29 17:21:01,698 shortcut(Control+Menu:toggle_keyboard_grab, Shift+Menu:toggle_pointer_grab, Shift+F11:toggle_fullscreen, #+F1:show_menu, #+F2:show_start_new_command, #+F3:show_bug_report, #+F4:quit, #+F5:increase_quality, #+F6:decrease_quality, #+F7:increase_speed, #+F8:decrease_speed, #+F10:magic_key, #+F11:show_session_info, #+F12:toggle_debug, #+plus:scaleup, #+minus:scaledown, #+underscore:scaledown, #+KP_Add:scaleup, #+KP_Subtract:scaledown, #+KP_Multiply:scalereset, #+bar:scalereset, #+question:scalingoff, #+G:toggle_keyboard_grab)=['control'], toggle_keyboard_grab, Shift+Menu:toggle_pointer_grab, Shift+F11:toggle_fullscreen, #+F1:show_menu, #+F2:show_start_new_command, #+F3:show_bug_report, #+F4:quit, #+F5:increase_quality, #+F6:decrease_quality, #+F7:increase_speed, #+F8:decrease_speed, #+F10:magic_key, #+F11:show_session_info, #+F12:toggle_debug, #+plus:scaleup, #+minus:scaledown, #+underscore:scaledown, #+KP_Add:scaleup, #+KP_Subtract:scaledown, #+KP_Multiply:scalereset, #+bar:scalereset, #+question:scalingoff, #+G:toggle_keyboard_grab, ()
2018-04-29 17:21:01,698 parse_shortcuts(['Control+Menu:toggle_keyboard_grab', 'Shift+Menu:toggle_pointer_grab', 'Shift+F11:toggle_fullscreen', '#+F1:show_menu', '#+F2:show_start_new_command', '#+F3:show_bug_report', '#+F4:quit', '#+F5:increase_quality', '#+F6:decrease_quality', '#+F7:increase_speed', '#+F8:decrease_speed', '#+F10:magic_key', '#+F11:show_session_info', '#+F12:toggle_debug', '#+plus:scaleup', '#+minus:scaledown', '#+underscore:scaledown', '#+KP_Add:scaleup', '#+KP_Subtract:scaledown', '#+KP_Multiply:scalereset', '#+bar:scalereset', '#+question:scalingoff', 'Control+Menu:toggle_keyboard_grab, Shift+Menu:toggle_pointer_grab, Shift+F11:toggle_fullscreen, #+F1:show_menu, #+F2:show_start_new_command, #+F3:show_bug_report, #+F4:quit, #+F5:increase_quality, #+F6:decrease_quality, #+F7:increase_speed, #+F8:decrease_speed, #+F10:magic_key, #+F11:show_session_info, #+F12:toggle_debug, #+plus:scaleup, #+minus:scaledown, #+underscore:scaledown, #+KP_Add:scaleup, #+KP_Subtract:scaledown, #+KP_Multiply:scalereset, #+bar:scalereset, #+question:scalingoff, #+G:toggle_keyboard_grab'])={'F1': [(['mod1', 'shift'], 'show_menu', ())], 'F2': [(['mod1', 'shift'], 'show_start_new_command', ())], 'F3': [(['mod1', 'shift'], 'show_bug_report', ())], 'F4': [(['mod1', 'shift'], 'quit', ())], 'F5': [(['mod1', 'shift'], 'increase_quality', ())], 'F6': [(['mod1', 'shift'], 'decrease_quality', ())], 'F7': [(['mod1', 'shift'], 'increase_speed', ())], 'F8': [(['mod1', 'shift'], 'decrease_speed', ())], 'Menu': [(['control'], 'toggle_keyboard_grab', ()), (['shift'], 'toggle_pointer_grab', ()), (['control'], 'toggle_keyboard_grab, Shift+Menu:toggle_pointer_grab, Shift+F11:toggle_fullscreen, #+F1:show_menu, #+F2:show_start_new_command, #+F3:show_bug_report, #+F4:quit, #+F5:increase_quality, #+F6:decrease_quality, #+F7:increase_speed, #+F8:decrease_speed, #+F10:magic_key, #+F11:show_session_info, #+F12:toggle_debug, #+plus:scaleup, #+minus:scaledown, #+underscore:scaledown, #+KP_Add:scaleup, #+KP_Subtract:scaledown, #+KP_Multiply:scalereset, #+bar:scalereset, #+question:scalingoff, #+G:toggle_keyboard_grab', ())], 'KP_Subtract': [(['mod1', 'shift'], 'scaledown', ())], 'question': [(['mod1', 'shift'], 'scalingoff', ())], 'KP_Add': [(['mod1', 'shift'], 'scaleup', ())], 'plus': [(['mod1', 'shift'], 'scaleup', ())], 'underscore': [(['mod1', 'shift'], 'scaledown', ())], 'F12': [(['mod1', 'shift'], 'toggle_debug', ())], 'bar': [(['mod1', 'shift'], 'scalereset', ())], 'F10': [(['mod1', 'shift'], 'magic_key', ())], 'F11': [(['shift'], 'toggle_fullscreen', ()), (['mod1', 'shift'], 'show_session_info', ())], 'minus': [(['mod1', 'shift'], 'scaledown', ())], 'KP_Multiply': [(['mod1', 'shift'], 'scalereset', ())]}

Tested with Xpra 2.2.6 on Arch Linux.

Change History (3)

comment:1 Changed 6 months ago by Antoine Martin

Milestone: 2.3
Status: newassigned

comment:2 Changed 6 months ago by Antoine Martin

Owner: changed from Antoine Martin to julian
Status: assignednew
Summary: --key-shortcut not working when using xpra start-desktop --daemon=no --attach=yes--key-shortcut not working when using start with attach=yes

For more information on the keyboard shortcut and shortcut-modifiers feature, see #1657.

This bug is fixed by r19132.

Note: as per the man page (now updated in r19133) and the xpra -h output, if any keyboard shortcuts are specified on the command line using --key-shortcut=STRING, these will now replace the default list of shortcuts.
(we were previously appending to that list, which was causing the problems)

@julian: please close if this works for you.

comment:3 Changed 5 months ago by Antoine Martin

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.