Keep screen info in cache

Currently, we only use screen information (width, height, rotation)
once at initialization, to send the device size to the client.

To be able to scale mouse events, make it accessible in memory. For this
purpose, replace the "static" DeviceUtil to a singleton Device, and
update it on every screen rotation.
This commit is contained in:
Romain Vimont
2018-01-23 14:37:54 +01:00
parent d7b00a9bab
commit 11a60e5767
6 changed files with 86 additions and 44 deletions

View File

@@ -23,7 +23,7 @@ SRC := com/genymobile/scrcpy/ScrCpyServer.java \
com/genymobile/scrcpy/ControlEvent.java \
com/genymobile/scrcpy/ControlEventReader.java \
com/genymobile/scrcpy/DesktopConnection.java \
com/genymobile/scrcpy/DeviceUtil.java \
com/genymobile/scrcpy/Device.java \
com/genymobile/scrcpy/EventController.java \
com/genymobile/scrcpy/ScreenInfo.java \
com/genymobile/scrcpy/ScreenStreamer.java \