Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUACAMOLE-261: Implement Spice protocol support. #394

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

necouchman
Copy link
Contributor

Well, here we are - ready to submit at least a draft pull request for implementation of Spice protocol support. It still has some work to be done - quite a bit of cleanup, I suspect, and a handful of things left to get working - but I'm ready to start getting some other eyes on it for review.

@mike-jumper
Copy link
Contributor

Nice! I'll start looking through this.

@csarn
Copy link

csarn commented Oct 1, 2022

Cool, SPICE coming to guacamole!

I just tried it out, using docker. It basically works, but I'm having trouble with the keyboard layout.
I'm using a german QWERTZ keyboard, so I set the layout in the SPICE configuration also to German QWERTZ.
In the linux VM I'm viewing via guacamole -> spice I also used "setxkbmap de nodeadkeys".

When I type capital letters using shift, they work fine, but all other key combinations don't. So Shift + just types the number and not the symbol associated with it. Example: Shift+1 should type "!".

Here is what xev shows on my laptop when I type Shift+1:

KeyPress event, serial 40, synthetic NO, window 0x8e00001,
    root 0x7ab, subw 0x0, time 103910823, (-197,145), root:(3209,584),
    state 0x10, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x8e00001,
    root 0x7ab, subw 0x0, time 103911367, (-197,145), root:(3209,584),
    state 0x11, keycode 10 (keysym 0x21, exclam), same_screen YES,
    XLookupString gives 1 bytes: (21) "!"
    XmbLookupString gives 1 bytes: (21) "!"
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x8e00001,
    root 0x7ab, subw 0x0, time 103911649, (-197,145), root:(3209,584),
    state 0x11, keycode 10 (keysym 0x21, exclam), same_screen YES,
    XLookupString gives 1 bytes: (21) "!"
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x8e00001,
    root 0x7ab, subw 0x0, time 103911932, (-197,145), root:(3209,584),
    state 0x11, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

And here is the xev output for Shift+1 from inside the guacamole spice vm:

KeyPress event, serial 37, synthetic NO, window 0x5000001,
    root 0x529, subw 0x0, time 1355819, (225,399), root:(592,595),
    state 0x2, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x5000001,
    root 0x529, subw 0x0, time 1356183, (225,399), root:(592,595),
    state 0x3, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x5000001,
    root 0x529, subw 0x0, time 1356183, (225,399), root:(592,595),
    state 0x2, keycode 10 (keysym 0x31, 1), same_screen YES,
    XLookupString gives 1 bytes: (31) "1"
    XmbLookupString gives 1 bytes: (31) "1"
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x5000001,
    root 0x529, subw 0x0, time 1356327, (225,399), root:(592,595),
    state 0x2, keycode 10 (keysym 0x31, 1), same_screen YES,
    XLookupString gives 1 bytes: (31) "1"
    XFilterEvent returns: False

For some reason, a Shift_L release event is seen even if I didn't release the key.
For the working capital letters, it looks like this:

KeyPress event, serial 37, synthetic NO, window 0x4c00001,
    root 0x529, subw 0x0, time 1833793, (164,-12), root:(1035,420),
    state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x4c00001,
    root 0x529, subw 0x0, time 1834395, (164,-12), root:(1035,420),
    state 0x1, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x4c00001,
    root 0x529, subw 0x0, time 1834395, (164,-12), root:(1035,420),
    state 0x3, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x4c00001,
    root 0x529, subw 0x0, time 1834395, (164,-12), root:(1035,420),
    state 0x3, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x4c00001,
    root 0x529, subw 0x0, time 1834395, (164,-12), root:(1035,420),
    state 0x2, keycode 24 (keysym 0x51, Q), same_screen YES,
    XLookupString gives 1 bytes: (51) "Q"
    XmbLookupString gives 1 bytes: (51) "Q"
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x4c00001,
    root 0x529, subw 0x0, time 1834526, (164,-12), root:(1035,420),
    state 0x2, keycode 24 (keysym 0x51, Q), same_screen YES,
    XLookupString gives 1 bytes: (51) "Q"
    XFilterEvent returns: False

Somehow a Caps_Lock gets involved there.

There are other inconsistencies, if it would help to show them in detail, let me know.

@necouchman
Copy link
Contributor Author

Thanks, @csarn - The keyboard mapping does indeed seem to be an area where there are likely to be some bugs. I reused the RDP protocol's keyboard mapping code due to the similarities in what the remote sides of both RDP and Spice require, but my guess is that there are some nuances of Spice that need to be factored in. In my testing I think most of the QWERTY keys from the US mapping work as expected; however, I do see that pressing "Shift" seems to activate "Caps Lock" on the remote side, and release it de-activates it - which is not what I'd call desirable or expected. I'll take a look at the xev output you sent, and the code, and see what I can figure out.

@raptaml
Copy link

raptaml commented Feb 2, 2024

Hey guys, thanks for working on this!
Could you please give me an estimate when this will be availabale in Gucamole release?
Thanks

@necouchman
Copy link
Contributor Author

@raptaml No, there is no estimate on when this will be complete.

@ExplodingDragon
Copy link

@necouchman Hey guys, is there any update currently? The current pull request seems to have conflicts with the main branch

@necouchman
Copy link
Contributor Author

@necouchman Hey guys, is there any update currently? The current pull request seems to have conflicts with the main branch

@ExplodingDragon I've not had much time to work on this lately. Also, at the moment Mike is working on a set of changes (GUACAMOLE-377) to the display API that will end up impacting this, so I'm not going to do much in the way of trying to fix the merge conflicts until that is all finished up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants