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

Add events with flags #12

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 40 additions & 2 deletions include/qubes-gui-protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typedef unsigned __int32 uint32_t;
/* version of protocol described in this file, used as gui-daemon protocol
* version; specific agent defines own version which them support */
#define QUBES_GUID_PROTOCOL_VERSION_MAJOR 1
#define QUBES_GUID_PROTOCOL_VERSION_MINOR 3
#define QUBES_GUID_PROTOCOL_VERSION_MINOR 4
#define QUBES_GUID_PROTOCOL_VERSION (QUBES_GUID_PROTOCOL_VERSION_MAJOR << 16 | QUBES_GUID_PROTOCOL_VERSION_MINOR)

//arbitrary
Expand Down Expand Up @@ -99,7 +99,19 @@ enum {
MSG_WMCLASS,
MSG_WINDOW_DUMP,
MSG_CURSOR,
MSG_MAX
MSG_MAX,
MSG_KEYPRESS2,
MSG_BUTTON2,
MSG_MOTION2,
};
enum {
FLAG_KEYPRESS_REPEAT=0b1,
};
enum {
FLAG_BUTTON_EMULATED=0b1,
};
enum {
FLAG_MOTION_EMULATED=0b1,
Comment on lines +110 to +114
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are those flags actually useful for an application in the VM? It may be seen as a feature that VM has no idea whether event was emulated or not

Copy link
Author

@iacore iacore Feb 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Mouse wheel events are mapped as motion and emulated button presses (the amount of presses per "unit" of wheel scrolled is adjustable in Windows, there are tools for doing it for X11). Some games rely on motion events, and get insane mouse wheel speed when they can't filter emulated mouse wheel events out.

Copy link
Author

@iacore iacore Feb 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we don't send repeated or emulated events to client VMs, and let the client generate those events themselves? This way, each client can have different key repeat intervals.

};
/* VM -> Dom0, Dom0 -> VM */
struct msg_map_info {
Expand Down Expand Up @@ -130,6 +142,15 @@ struct msg_keypress {
uint32_t keycode;
};
/* Dom0 -> VM */
struct msg_keypress2 {
uint32_t type;
uint32_t x;
uint32_t y;
uint32_t state;
uint32_t keycode;
uint32_t flags;
};
/* Dom0 -> VM */
struct msg_button {
uint32_t type;
uint32_t x;
Expand All @@ -138,13 +159,30 @@ struct msg_button {
uint32_t button;
};
/* Dom0 -> VM */
struct msg_button2 {
uint32_t type;
uint32_t x;
uint32_t y;
uint32_t state;
uint32_t button;
uint32_t flags;
};
/* Dom0 -> VM */
struct msg_motion {
uint32_t x;
uint32_t y;
uint32_t state;
uint32_t is_hint;
};
/* Dom0 -> VM */
struct msg_motion2 {
uint32_t x;
uint32_t y;
uint32_t state;
uint32_t is_hint;
uint32_t flags;
};
/* Dom0 -> VM */
struct msg_crossing {
uint32_t type;
uint32_t x;
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.1
4.1.2