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

Introduce MSG_CURSOR (VM to GUI) #7

Merged
merged 1 commit into from
Apr 4, 2020
Merged

Conversation

pwmarcz
Copy link
Contributor

@pwmarcz pwmarcz commented Mar 26, 2020

See QubesOS/qubes-issues#1551.

The message contains a cursor ID to be set for a given window.

pwmarcz added a commit to pwmarcz/qubes-gui-daemon that referenced this pull request Mar 26, 2020
pwmarcz added a commit to pwmarcz/qubes-gui-agent-linux that referenced this pull request Mar 26, 2020
See QubesOS/qubes-gui-common#7.

I use the Xfixes extension to subscribe to cursor change events.
See SelectCursorInput and CursorNotify in the Xfixes specification:

    https://metacpan.org/pod/X11::Protocol::Ext::XFIXES

The returned "cursor name" can be empty, and in general doesn't
have to be meaningful. However, it practice the names are standard
X11 "cursor font" names:

    https://tronche.com/gui/x/xlib/appendix/b/
@pwmarcz pwmarcz changed the title Introduce MSG_CURSOR_NAME (VM to GUI) Introduce MSG_CURSOR(VM to GUI) Mar 27, 2020
@pwmarcz pwmarcz changed the title Introduce MSG_CURSOR(VM to GUI) Introduce MSG_CURSOR (VM to GUI) Mar 27, 2020
@pwmarcz
Copy link
Contributor Author

pwmarcz commented Mar 27, 2020

I'm not too happy with CURSOR_EMPTY = 0x10000, but I'd rather retain the original cursor IDs (which start from 0) instead of complicating the scheme by encoding them.

@marmarek
Copy link
Member

In fact I think CURSOR_EMPTY is a risky thing to allow by default (if it does what I think it does - hides the cursor). It could be used to fool the user about the mouse position, potentially convincing the user to click on a specific thing outside of the VM's window.
This should be guarded by some extra option, maybe the same as allowing VM-initiated fullscreen window?

@pwmarcz
Copy link
Contributor Author

pwmarcz commented Mar 27, 2020

Sorry, it's CURSOR_NONE, not empty, and it means delete the custom cursor and use default (named so because Xlib actually calls this None). No invisible cursor.

@pwmarcz
Copy link
Contributor Author

pwmarcz commented Mar 27, 2020

One alternative would be to specify this default as 0, and shift the rest of cursor IDs (encode them as x + 1, or x | 0x100, or something).

@marmarek
Copy link
Member

0 would be logical for "revert to default" indeed. I slightly more like x | 0x100 for encoding others (name it 0x100 bit means X11 cursor codes).

See QubesOS/qubes-issues#1551.

The message contains a cursor ID to be set for a given window.
@pwmarcz
Copy link
Contributor Author

pwmarcz commented Mar 27, 2020

Updated and tested (and I renamed the default one to CURSOR_DEFAULT). That does look nice.

@marmarek marmarek merged commit 900f592 into QubesOS:master Apr 4, 2020
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.

2 participants