Skip to content

Commit

Permalink
inputcapture: drop the POINTER_ABSOLUTE capability, align with Remote…
Browse files Browse the repository at this point in the history
…Desktop

RemoteDesktop uses keyboard, pointer and touch - given the use-cases we
are targeting here the extra POINTER_ABSOLUTE capability is superfluous
and it's more sensible to align our capabilities with RemoteDesktop.
This requires reshuffling the values so they match.
  • Loading branch information
whot committed Jan 20, 2023
1 parent 349bd5e commit e1908e7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
14 changes: 6 additions & 8 deletions libportal/inputcapture.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,17 @@ G_DECLARE_FINAL_TYPE (XdpInputCaptureSession, xdp_input_capture_session, XDP, IN
/**
* XdpCapability:
* @XDP_CAPABILITY_NONE: no device
* @XDP_CAPABILITY_POINTER_RELATIVE: capture relative pointer events.
* @XDP_CAPABILITY_POINTER_ABSOLUTE: capture absolute pointer events.
* @XDP_CAPABILITY_KEYBOARD: capture the keyboard.
* @XDP_CAPABILITY_TOUCH: capture touch events
* @XDP_CAPABILITY_KEYBOARD: capture the keyboard
* @XDP_CAPABILITY_POINTER: capture pointer events
* @XDP_CAPABILITY_TOUCHSCREEN: capture touchscreen events
*
* Flags to specify what input device capabilities should be captured
*/
typedef enum {
XDP_CAPABILITY_NONE = 0,
XDP_CAPABILITY_POINTER_RELATIVE = 1 << 0,
XDP_CAPABILITY_POINTER_ABSOLUTE = 1 << 1,
XDP_CAPABILITY_KEYBOARD = 1 << 2,
XDP_CAPABILITY_TOUCHSCREEN = 1 << 3
XDP_CAPABILITY_KEYBOARD = 1 << 0,
XDP_CAPABILITY_POINTER = 1 << 1,
XDP_CAPABILITY_TOUCHSCREEN = 1 << 2
} XdpCapability;


Expand Down
2 changes: 1 addition & 1 deletion portal-test/gtk3/portal-test-win.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ start_input_capture (PortalTestWin *win)

xdp_portal_create_input_capture_session (win->portal,
NULL,
XDP_CAPABILITY_POINTER_RELATIVE | XDP_CAPABILITY_KEYBOARD,
XDP_CAPABILITY_POINTER | XDP_CAPABILITY_KEYBOARD,
NULL,
inputcapture_session_created,
win);
Expand Down
6 changes: 3 additions & 3 deletions tests/pyportaltest/test_inputcapture.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def create_session_with_barriers(
self,
params=None,
parent=None,
capabilities=Xdp.Capability.POINTER_RELATIVE,
capabilities=Xdp.Capability.POINTER,
barriers=None,
allow_failed_barriers=False,
cancellable=None,
Expand Down Expand Up @@ -165,7 +165,7 @@ def test_session_create(self):
}
self.setup_daemon(params)

capabilities = Xdp.Capability.POINTER_RELATIVE | Xdp.Capability.KEYBOARD
capabilities = Xdp.Capability.POINTER | Xdp.Capability.KEYBOARD

setup = self.create_session_with_barriers(params, capabilities=capabilities)
assert setup.session is not None
Expand Down Expand Up @@ -285,7 +285,7 @@ def create_session_done(portal, task, data):
session_error = e
self.mainloop.quit()

capabilities = Xdp.Capability.POINTER_RELATIVE | Xdp.Capability.KEYBOARD
capabilities = Xdp.Capability.POINTER | Xdp.Capability.KEYBOARD
xdp.create_input_capture_session(
parent=None,
capabilities=capabilities,
Expand Down

0 comments on commit e1908e7

Please sign in to comment.