Jan Grulich [Wed, 27 Jun 2018 11:13:46 +0000 (13:13 +0200)]
Avoid error/warning about implicit function declaration
Function xorgGlxCreateVendor() is defined in glx_extinit.h, if this header is
not included, we might get either error or warning. This header also need to
be included after scrninststr.h header as it defines some structures used
in glx_extinit.h
Pierre Ossman [Tue, 12 Jun 2018 13:58:34 +0000 (15:58 +0200)]
Ignore fake focus events from XGrabKeyboard()
Grabbing (and ungrabbing) the keyboard generates fake focus events
with modern versions of Xorg. This causes an infinite loop since we
update the grab status on focus events.
Michal Srb [Wed, 6 Jun 2018 11:33:37 +0000 (13:33 +0200)]
Add support for X server 1.20.0.
In-server GLVND requires xorgGlxCreateVendor call from InitOutput.
DPMS functions were moved to another location and no longer need to be faked.
xserver120.patch is a copy of xserver119.patch with refreshed contexts.
Pierre Ossman [Thu, 7 Jun 2018 07:16:02 +0000 (09:16 +0200)]
Properly sync LED state on connect
We should start by getting the remote end in sync with the actual
keyboard state. This would work randomly before depending on if we
got the first LED state message before or after we got focus.
Accept a cfg as an argument as an alt way to start the viewer
The user can specify a tigervnc configuration file as an argument to the
viewer. Previously the viewer assumed this to be a server, but now we
will first check if there is any file matching the given argument. If
so, try to load the content of that file, like we normally do.
Pierre Ossman [Mon, 7 May 2018 12:24:56 +0000 (14:24 +0200)]
Flush pending changes when desktop starts
The system to avoid processing changes for a stopped desktop was a
bit overly aggressive and resulted in those changes getting stuck even
when the desktop started again (yet another change was needed to get
things rolling again).
Make sure we flush out anything pending once the desktop is back up and
running. We don't use the frame timer here as we no longer know how
old these changes are, so we're not really rate limiting any application.
Comparing ScreenSet:s should be done without considering order
Avoids that a viewer connected to Xvnc sometimes disconnects with
"Desktop configured a different screen layout than requested" when
screens are changing.
Change Xserver screen through libXrandr. For complex configurations,
all outputs must have corresponding size modes. As a special case, if
the client requests a single screen with an odd size (for example when
adjusting the size of a non-fullscreen vncviewer), find a smaller
suitable mode, and reduce the framebuffer size as well.
For example, if we have earlier disabled an output because it was too
large for the framebuffer, we should prefer this output when
allocating new outputs.
Move the code that turn off unused outputs to the end.
Also, add support for checking the output connection state.
In RandR land, there's a lot of return code confusion. Our wrappers
are using the same return codes as RRCrtcSet, RRScreenSizeSet: 1/TRUE
for success. Fixes:
* vncRandRCreateOutputs did not follow this convention
* A lot of code returned -1 upon failure
* vncRandRDisableOutput returned 0 for already disabled outputs
Move computeScreenLayout/setScreenLayout to unixcommon lib
These two code blocks are not specific to Xvnc/vnc.so, but useful for
x0vncserver as well. RandrGlue.h defines the interface on which
unixcommon depends on.
Pierre Ossman [Fri, 23 Mar 2018 08:30:09 +0000 (09:30 +0100)]
Limit lossless refresh update to safe size
We don't want to waste bandwidth on the lossless refresh if we might
need that bandwidth for a normal update. Try to estimate how much
data we can safely send without interfering.
Pierre Ossman [Wed, 30 Nov 2016 07:03:35 +0000 (08:03 +0100)]
Automatic lossless refresh
Resend pixel perfect copies of areas that were previously sent
using a lossy encoder. This is done when there is no normal update
to send, and no congestion.
Pierre Ossman [Thu, 22 Mar 2018 14:58:54 +0000 (15:58 +0100)]
Respect request area for cursor rendering
We cannot send updates for a cursor that is outside the requested
region, so make sure we track things properly. This also has the nice
side effect of just re-sending the bits needed when the cursor overlaps
a changed part of the framebuffer.
Pierre Ossman [Mon, 26 Mar 2018 12:17:04 +0000 (14:17 +0200)]
Avoid clipboard updates when not focused
We don't want to surprise the user with unexpected clipboard changes
when vncviewer is in the background, and it is both wasteful and
possibly insecure to inform the server of every clipboard update
when the user isn't interacting with it.
Pierre Ossman [Mon, 26 Mar 2018 10:22:47 +0000 (12:22 +0200)]
Replace "frames" with "updates" in stats
The VNC servers aren't great at getting full frames with each update,
so avoid calling it "frames per second" in the statistics as that
can be misleading.
Pierre Ossman [Thu, 8 Mar 2018 13:05:39 +0000 (14:05 +0100)]
Better detection of AltGr on Windows
Try to properly detect the fake CtrlL+AltR sequence Windows sends
when pressing AltGr. This allows us to send more accurate key
events over to the server.
Michal Srb [Fri, 29 Sep 2017 12:47:56 +0000 (14:47 +0200)]
Unset pixel buffer when x0vncserver client disconnects.
In XDesktop::start() we allocate pixel buffer and set it as the backend to the given VNCServer.
In XDesktop::stop() we deallocate the buffer, so we must unset it from the VNCServer as well.
Otherwise the VNCServer could try to access it and crash, for example in deferred update.
Michal Srb [Fri, 29 Sep 2017 12:45:33 +0000 (14:45 +0200)]
VNCServerST: Allow unsetting pixel buffer.
Originally calling VNCServertST::setPixelBuffer(PixelBuffer* pb_) with pb_=0 would do nothing.
With this change pb will be set to 0 and deferred update timer will be stopped.
Pierre Ossman [Thu, 1 Mar 2018 13:11:39 +0000 (14:11 +0100)]
Fix rounding error in pixel down conversion
Simple shifting can give noticable rounding errors if there is a large
difference in the number of bits between the formats. Do the proper
thing via a lookup table, the same way things are done for up conversion.