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

new packet format: dictionary instead of positional arguments #1942

Open
totaam opened this issue Aug 29, 2018 · 6 comments
Open

new packet format: dictionary instead of positional arguments #1942

totaam opened this issue Aug 29, 2018 · 6 comments
Labels
enhancement New feature or request
Milestone

Comments

@totaam
Copy link
Collaborator

totaam commented Aug 29, 2018

We can support both the old format and the new one for a while.
The new one will have the advantage of being easier to understand and more flexible so we can add new features, make some parts optional, without having to fill in positional arguments we may not have. (they may not be relevant or may not be useful)

@totaam
Copy link
Collaborator Author

totaam commented Aug 31, 2018

Example of ugly packet formats which would benefit from this: r20252 (adding relative position to the existing position parameter to avoid adding it at the end of the packet, which has optional fields..), configure packets, map packets, etc...

We can continue to support the old format, and convert to the new one - and maybe the same conversion function could be used by both the client and server to keep the code simple.

@totaam
Copy link
Collaborator Author

totaam commented Feb 26, 2019

Could also be used for keyboard (#1172, #1716) and refresh (#1449), pointer events (#1941)
On a more general note: info packets and #1983, moving keyboard packets out of hello, hello namespace (#1154) are all related to legacy formats.

Could be useful for #2243#comment:1

@totaam totaam added the v2.3.x label Jan 22, 2021
@totaam totaam added this to the future milestone Jan 23, 2021
@totaam totaam removed the v2.3.x label Jan 23, 2021
@totaam totaam added the enhancement New feature or request label Jul 18, 2021
totaam added a commit that referenced this issue Jan 3, 2023
using a more generic and flexible packet format
@totaam
Copy link
Collaborator Author

totaam commented Jan 3, 2023

Started for pointer-position so that we can also enable QUIC (#3376) datagrams for those packets easily: just use a new, cleaner packet handler for it.

Still need to:

  • populate server_packet_handlers with the (full?) list
  • use a similar mechanism for the server?
  • continue converting the other pointer and wheel events and anything that calls process_mouse_common, ie: window-configure
  • is there any point in sending button events as both datagrams and regular packets? (I think not - perhaps during heavy congestion?)

@totaam
Copy link
Collaborator Author

totaam commented Jan 30, 2023

5178602 caused problems so the new packet types are now disabled until I find the time to fix: 284aeec

@totaam
Copy link
Collaborator Author

totaam commented Oct 10, 2024

New:

  • wheel events should be sent raw, not as pairs of clicks
  • appindicator has a scroll event

@totaam
Copy link
Collaborator Author

totaam commented Nov 25, 2024

Ideally, we can use type hint introspection to move the packet data validation to a generic function that enforces the data types early.

Helps with #3618, see also #3981

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant