diff options
author | Maxim Devaev <[email protected]> | 2023-03-08 00:50:37 +0200 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2023-03-08 00:50:37 +0200 |
commit | dd702116b7ad1ef302a60c1be459130752766a6c (patch) | |
tree | fcc13ad0204d5fff491e40500ea993f7c71084b6 /kvmd | |
parent | f652eca9c213dd783cf2ffd02109b2353ccb86c1 (diff) |
Fixed pikvm/pikvm#925: The mouse click should be processed after the movement
Diffstat (limited to 'kvmd')
-rw-r--r-- | kvmd/apps/vnc/server.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kvmd/apps/vnc/server.py b/kvmd/apps/vnc/server.py index 697d3172..f4c431a9 100644 --- a/kvmd/apps/vnc/server.py +++ b/kvmd/apps/vnc/server.py @@ -370,11 +370,6 @@ class _Client(RfbClient): # pylint: disable=too-many-instance-attributes async def _on_pointer_event(self, buttons: dict[str, bool], wheel: dict[str, int], move: dict[str, int]) -> None: if self.__kvmd_ws: - for (button, state) in buttons.items(): - if self.__mouse_buttons[button] != state: - await self.__kvmd_ws.send_mouse_button_event(button, state) - self.__mouse_buttons[button] = state - if wheel["x"] or wheel["y"]: await self.__kvmd_ws.send_mouse_wheel_event(wheel["x"], wheel["y"]) @@ -382,6 +377,11 @@ class _Client(RfbClient): # pylint: disable=too-many-instance-attributes await self.__kvmd_ws.send_mouse_move_event(move["x"], move["y"]) self.__mouse_move = move + for (button, state) in buttons.items(): + if self.__mouse_buttons[button] != state: + await self.__kvmd_ws.send_mouse_button_event(button, state) + self.__mouse_buttons[button] = state + async def _on_cut_event(self, text: str) -> None: assert self.__stage1_authorized.is_passed() assert self.__kvmd_session |