This patch adds mouse wheel support to the Java client.
The mouse wheel is only functional when using JRE 1.4 or later, but the code has been written to gracefully ignore this feature when run by an older JRE which doesn't offer mouse wheel support.
It has been tested in JRE 1.2.2_017 and OpenJDK 1.6.0_0-b12
It applies against version 1.3.10 of the Java client.
An old patch for mouse wheel support is here:
https://sourceforge.net/tracker/index.php?func=detail&aid=808611&group_id=14067&atid=314067
I've done a lot of additional hacking on the Java client recently, and now have a series of patches for various new functionality. Using separate bug reports for each of these patches would get very cumbersome, so I'm simply going to post them all here.
All of these patches now apply against the current revision in subversion. (The original 1.3.10 patch has been removed).
fixes-move_files
move a few files to more sensible locations given the new svn directory layout
fixes-makefile
replace the old makefiles with a new makefile which supports the new svn directory layout
and no longer requires an explicit list of source files in the makefile
fixes-svn_bugs
update package names in several files
fix bug in mouse event throttling code that prevents soft cursor from moving
fix invalid (Integer) cast
fix typo in a comment
mouse_wheel
enable mouse wheel scrolling
error_msgs
always show graphical error messages (not just in applet mode)
The 'scale' patches below have not been tested independently (but have been tested together) - I assume you will apply all four of them. Separate patches are only used to make reading/understanding them easier, as a single patch would be rather large, and the individual changes unclear.
The 'scale' patches will fail to apply unless you apply the above patches first.
scale
allow scaling to arbitrary width/height
(use float multiplier instead of integer, and use separate multipliers for width/height)
improve scaling size calculations to properly account for window decorations
show scroll bars in applet mode if applet is smaller than frame buffer
support scaling in applet mode
scale-fixed_ratio
add 'fixed ratio' scaling option to preserve the frame buffer's aspect ratio when scaling
scale-cleanup1
improve scroll pane / window size calculations
rename updateFramebufferSize() to setFramebufferSize()
(more consistent with other function names)
remove unnecessary dependency on updateFramebufferSize() from setPixelFormat()
scale-cleanup2
clean up some indenting and comments that were left out of the other scaling patches
eliminate unused maxWidth/maxHeight parameters to VncCanvas constructor
merge createCanvas() and paintScaledFrameBuffer() functions into their callers for simplicity/clarity
I'm adding another patch to synchronize the local and remote clipboards.
Given the number of patches here, and the frequency with which I'm updating them, from now on, I'm simply going to attach a tarball containing the latest revision of the entire patch series.
I've added another patch to add support for audio when connecting to a QEMU VNC server.
Several notes on this patch, however:
- I have not yet added options to disable audio or adjust audio settings; audio settings are currently hard-coded in VncViewer.java
- In it's current form, it breaks compatibility with JVMs older than 1.3; reflection will need to be used to add support for ignoring audio if an older JVM is being used. (Or support for such archaic JVMs just needs to be dropped... Does anyone actually use a JVM that old anymore?)
- Audio processing has been specifically written to avoid blocking video frame buffer processing, but the original video processing code will block audio processing. What this means is that audio works fairly well if there are few video updates (for example, if just playing music), but frequently under-runs it's buffer when the client is processing lots of video updates (for example, when playing a video). It is workable, even for playing videos, if you have plenty of bandwidth and use the Raw video encoding (to minimize video processing delays), but this should really be fixed by decoupling the protocol processing code from the video decoding code (as I did for audio processing). I plan to add another patch to accomplish this.
- QEMU's audio protocol VNC extension is non-standard and does not support negotiation of audio support or audio formats. If possible, I'd like to add a TightVNC protocol extension that provides better audio support, and incorporate audio support into the TightVNC servers.
- QEMU currently supports only raw PCM audio. This patch supports compressed audio formats (OGG, MP3), so compression support should be added on the server-side to allow use over a low-bandwidth link.
I've decided to move these patches to my website to ease maintainability.
You can now find them here:
http://www.PaulSD.com/2009/VNC