If the incorrect coordinates are sent (abs for rel or vice versa) then the
cursor may look stuck on the right of the screen as QEMU tries to send
multiple deltas.
This was broken in the re-factor. We fix the functionality and also
clean up the code and make it so the persistent value is always up to
date.
Fixes#3669
With the new toolbar that is always visible, there is no value in
storing the legacy toolbar visibility in the per-VM viewState setting.
Now, legacy toolbar VMs will always start with the toolbar visible. With
that removed, we also remove the per-VM keyboard visibility setting to
be a global value (the keyboard visibility for the last VM launched will
persist). This also simplifies the code for the delegate and the VM
manager.
This gives us a few main advantages:
1. It improves encapsulation and division of responsibility.
2. CocoaSpice can be used in other projects more easily.
3. It lays the foundation for better unit testing of key parts.
4. It cleans up the codebase.
Resolves#2376
Multiple mice could be connected. We will always use the most "recent" mice.
Also ignore UITouchTypeIndirectPointer events when mouse is captured.
Fixes#2363
There was a misunderstanding previouly that the input code and
cursor drawing code should reside in the same class. This led to
one CocoaSpice class handling both the SPICE input and cursor
channel. The problem is that SPICE protocol specifies a 1-to-1
mapping of cursor channel and display channel (sharing the same
channel id). To implement support for multiple displays, we
would have to follow this convention.
Additionally, there was some akwardness in forcing CSInput to
comply with the UTMRenderSource protocol because it shared the
viewport size with CSDisplay. "Outside" code would have to
syncronize the display size.
As part of the refactor, we also tried to improve the code style
by first moving as many ivars to properties as possible and by
also renaming some methods and inits.