Skip to content

Commit

Permalink
Use activation_id instead of serial
Browse files Browse the repository at this point in the history
  • Loading branch information
whot committed Aug 30, 2022
1 parent fff2833 commit 03f0b78
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions tests/pyportaltest/templates/inputcapture.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ def Enable(self, session_handle, options, sender):
def send_activated():
opts = {}
if current_eis_serial is not None:
opts["serial"] = dbus.UInt32(current_eis_serial, variant_level=1)
opts["activation_id"] = dbus.UInt32(
current_eis_serial, variant_level=1
)

if self.activated_position is not None:
opts["cursor_position"] = dbus.Struct(
Expand All @@ -291,7 +293,7 @@ def send_activated():
def send_deactivated():
opts = {}
if current_eis_serial:
opts["serial"] = dbus.UInt32(
opts["activation_id"] = dbus.UInt32(
current_eis_serial, variant_level=1
)

Expand Down
11 changes: 7 additions & 4 deletions tests/pyportaltest/test_inputcapture.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,18 +488,21 @@ def session_deactivated(session, opts):

assert session_activated_signal_received
assert list(signal_activated_options.keys()) == [
"serial",
"activation_id",
"cursor_position",
"barrier_id",
]
assert signal_activated_options["barrier_id"] == 1
assert signal_activated_options["cursor_position"] == (10.0, 20.0)
assert signal_activated_options["serial"] == 123
assert signal_activated_options["activation_id"] == 123

assert session_deactivated_signal_received
assert list(signal_deactivated_options.keys()) == ["serial", "cursor_position"]
assert list(signal_deactivated_options.keys()) == [
"activation_id",
"cursor_position",
]
assert signal_deactivated_options["cursor_position"] == (20.0, 30.0)
assert signal_deactivated_options["serial"] == 123
assert signal_deactivated_options["activation_id"] == 123

def test_zones_changed(self):
"""
Expand Down

0 comments on commit 03f0b78

Please sign in to comment.