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 MSG_XI_KEYPRESS and MSG_XI_FOCUS #19

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
36 changes: 35 additions & 1 deletion 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 5
#define QUBES_GUID_PROTOCOL_VERSION (QUBES_GUID_PROTOCOL_VERSION_MAJOR << 16 | QUBES_GUID_PROTOCOL_VERSION_MINOR)

//arbitrary
Expand Down Expand Up @@ -99,6 +99,8 @@ enum {
MSG_WMCLASS,
MSG_WINDOW_DUMP,
MSG_CURSOR,
MSG_XI_KEY,
MSG_XI_FOCUS,
MSG_MAX
};
/* VM -> Dom0, Dom0 -> VM */
Expand Down Expand Up @@ -253,4 +255,36 @@ struct msg_window_dump_grant_refs {
uint32_t refs[0];
};

/* Dom0 -> VM */
struct msg_xi_key {
uint32_t evtype; // press or release
uint32_t device;
uint32_t detail; // key code
uint32_t x; // respective to event window
uint32_t y;
uint32_t modifier_effective;
uint32_t flags;
// reserved for fields that may be useful for non-keyboard devices with keys
uint32_t _reserved[6];
};

/*
Dom0 -> VM
VM -> Dom0
only respected when focus is transfered within own VM);
elsewise, Dom0 should flash the window requested focus in taskbar,
but not transfer focus immediately */
struct msg_xi_focus {
uint32_t evtype; // focusin or out
uint32_t device;
uint32_t mode; // NotifyNormal
uint32_t detail; // NotifyNonilnear
uint32_t x;
uint32_t y;
// mod keys state, useful when focus out,
// since this is the only way to prevent, say, Alt getting stuck during Alt+Tab
uint32_t modifier_effective;
uint32_t _reserved[7];
};

#endif /* QUBES_GUI_PROTOCOL_H */