| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
They are not automatically cleaned up with the window on Windows, and we
might want to reconnect so we cannot rely on the process cleanup either.
|
|
|
|
|
|
|
| |
It's unclear why this code was ever added, and it can be very confusing
that the window partially adjusts itself. The code is also in conflict
with the earlier comment that states we'll leave the window size alone
if it didn't perfectly match before the resize.
|
|
|
|
|
| |
It's a source of confusion and possibly bugs to reuse the same variable
name for multiple things.
|
|
|
|
|
| |
It's more readable than 0, and a bit safer than NULL, so let's try to
follow modern norms.
|
|
|
|
|
|
| |
FLTK can send events with fl_xevent pointing to random memory, which
means that we cannot trust that structure. XQueryPointer() can give us
what we need, at the cost of an extra round trip.
|
|
|
|
|
|
|
| |
The coordinates we get are relative the root window of each screen, so
we can only trust them if we are on the same screen. So let's explicitly
check that we are still getting events from the expected screen by
checking the root window field of the event.
|
|
|
|
|
|
|
|
| |
These files don't use anything from this header, so remove the include.
This exposes some missing includes in other places, though. So add an
explicit include in the files that were relying on an indirect
inclusion.
|
|
|
|
|
|
| |
We mostly use classical C strings, but the memory management around them
can get confusing and error prone. Let's use std::string for the cases
where we need to return a newly allocated string.
|
|
|
|
|
| |
We know the needed space here, so let's keep it simple with a constant
size string buffer.
|
|
|
|
|
| |
Avoid having our own custom stuff and instead use the modern, standard
types, for familiarity.
|
|
|
|
|
| |
This allows us to separate accidental fall through from explicit ones,
which allows us to turn on such checks in the compiler.
|
|
|
|
|
| |
This allows us to separate accidentally unused, from explicitly unused
parameters, which allows us to turn on such checks in the compiler.
|
|
|
|
|
| |
Unconditionally log the erroneous screen layout if it fails to
validate to simplify debugging.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If monitor mirroring was enabled while in a session with vncviewer
running on Linux, the session would not be properly resized on the
server. This was a consequence of only looking at the size and
coordinates of each screen when matching against existing screens after
the screen layout was changed, when in fact we have two (or more)
monitors with the same coordinates and size (but differing ids). This
led to the same monitor being added twice to the layout which would
later fail layout validation, resulting in no resize request being sent
to the server.
When matching, we now also check if the existing screen is not already
present in the layout before considering it a match.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we've explicitly requested a position (using -geometry) then we were
still triggering legacy full-screen request logic. This is very counter
intuitive as having a position that doesn't align with a monitor should
disqualify us for that.
It turns out that at least marco (and probably everything
metacity-derived) ends up ignoring the requested position and we go back
to triggering the legacy logic again.
Work around this by assuming that the window manager will adjust our
initial position and don't consider that in the workaround logic.
|
|
|
|
|
| |
Many window managers don't have proper logic to restrict the window size
to something sane, so we have to take care of that ourselves.
|
|
|
|
|
|
| |
If this is done before the window is shown then it can accidentally
override the window manager's placement of the window. Reducing the size
should be sufficient to avoid trigger a full-screen request.
|
|
|
|
|
|
| |
Tweak the workaround from 9023a2e so that it only triggers if there
actually is a problem to fix. This is important since changing levels
also has the side effect of raising the window to the top of the level.
|
|
|
|
|
| |
Fl_RGB_Image doesn't take ownership of the pixel data, so we have to
explicitly free this as well once we are done.
|
|
|
|
|
|
|
|
|
| |
Previously, there were a number of inconsistencies in the use of
"full-screen" and "full screen" in logs, documentation, and user
interfaces. The consensus seems to be that "full screen" is correct when
used as a noun while "full-screen" is correct when used as an
adjective. These inconsistencies have now been adjusted to follow
consensus.
|
|
|
|
|
|
|
|
|
| |
FLTK's fullscreen_x() function will always put the window on a high
level (NSStatusWindowLevel = 25), even if the window doesn't have focus.
This causes the OptionsDialog to end up behind the DesktopWindow when
the fullscreen function is called. Until we can rest assured that most
people building TigerVNC will use a fixed version of FLTK, we will need
this workaround.
|
|
|
|
|
|
|
|
|
|
|
| |
There was an issue with the new grabs that were introduced in commit
2289342de7222e4ff2483eae95bb9898830e6097. On macOS when running
vncviewer in fullscreen on one monitor, we saw that we sometimes got
resize and fullscreen events when switching the focus away from
vncviewer. With the changes in the commit mentioned above this meant
that we immediately grabbed the keyboard again, thus never releasing it.
Fixes #1332.
|
| |
|
|
|
|
|
| |
Let's separate the standard global event handling from the hacky
workarounds, for clarity.
|
| |
|
|\ |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Fix some indentation issues and make sure everything* uses CamelCase.
* MonitorArrangement is left as snake_case in order to pretend it is an
independent FLTK widget class.
|
| |
| |
| |
| |
| |
| |
| | |
There are no guarantees from the WM that calling `fullscreen_screens`
with all monitor indices set to `-1` results in the window's current
monitor being used. Because FullScreenMode uses the word "current"
we want to explicitly ask the WM to use that monitor.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The user might not always want to use all monitors when in fullscreen
mode, but instead only a few. This commit adds support for configuring
selected monitors from command line, in the config file and graphically
in the options menu.
Because it might be hard to guarantee the consistency of monitor
identifiers coming from third-parties (for example FLTK), it has been
decided to use our own numerical identifier. This identifier is based on
the monitor's positions. The mapping between this identifier and the
indices used by FLTK is done by MonitorIndicesParameter.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Before this commit, `FullScreen` and `FullScreenAllMonitors` could be
used to configure whether to use the current monitor in fullscreen,
or all monitors in fullscreen.
This commit deprecates `FullScreenAllMonitors` in favour of
`FullScreenMode` (which can either be `current` or `all`). This allows
for additional modes to be added, without the risk of having invalid
states (for example two activate two different fullscreen modes at the
same time).
A new concept has been added; read-only parameters. They are parameters
that will be read, but never written back. This allows for migration
paths to be constructed, where a parameter can be taken to consideration
but then for example be discarded, logged or changed into something else.
This has been used for `FullScreenAllMonitors` to provide a migration
path. On startup of vncviewer, if `FullScreenAllMonitors` is enabled,
`FullScreenMode=all` will be automatically enabled instead. The next
time the configuration file is written to disk, `FullScreenAllMonitors`
will then be removed.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, it was assumed that all monitors (and especially the primary
monitor, index 0) was inside the window when we calculate the position
of the overlay.
That might not always be the case, for example when using fullscreen
mode over a narrower set of monitors. This commit does so the overlay is
positioned correctly based on the actual window size, instead of what we
expect it to be.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
cocoa_capture_displays it captures all displays enclosed by the
window_rect. If a set of displays were captured, but the configuration of
what monitors to use changed, a second call would only add to the set
of captured displays. Therefore, if the user enabled
FullScreenAllMonitors (all displays captured) and then disabled it (only
one display captured) they would get into a state were monitors not used
for the VNC session still were captured (which on macOS for example,
results in displays being unusable for other things).
This has now been fixed, resulting in monitors outside the window_rect
not being unnecessarily captured.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It was only possible to capture either the current, or all displays
previously. This could become an issue if you want to show a vnc session
over only a selected set of displays, because then we only want to
capture those displays.
The solution in the commit was chosen because it handles all cases - by
looking at what monitors are enclosed by the viewport the implementation
is independent on any configuration, but instead captures the monitors
actually being used.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The old method used a very slow frame rate with small steps,
which made it obnoxious during use. The new method has a few
improvements:
- Calculates "edge" region width automatically, as a ratio of
the viewport size. Default is 1/16th.
- Uses a different edge width for x and y, which works better
on very wide or very tall screens.
- Increased default frame rate from 10 fps to 60 fps.
- Replaced hardcoded frame rate with a #define.
- Reduced maximum movement per frame slightly, because the
frame rate is so much faster. The overall result is still much
faster, but also easier to do small adjustments with.
- Fixed off-by-one error in scroll rate calculation formula. Left/up
scrolls were faster than down/right, but this is fixed.
This makes it more comfortable to use TigerVNC on a small screen
to work on a larger screen for hours at a time.
|
| |
| |
| |
| |
| |
| |
| |
| | |
This change makes it possible for re-synchronizing the remote cursor on
the vncviewer when in fullscreen mode. This is done by locally moving
the cursor position to what the server thinks it should be.
Now SDL games should work!
|
| |
| |
| |
| |
| |
| |
| |
| | |
Switch from using Core events to using X Input events for pointer
devices in order to differentiate between mouse events and touch events.
Because FLTK doesn't understand X Input 2, we intercept these events and
translate them to core events where possible.
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Most window managers won't like this, and it tends to provoke bugs in
FLTK, so let's avoid it. It's probably not what the user wants anyway.
|
| | |
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | | |
Change the internal clipboard API to use a request based model in
order to be prepared for more advanced clipboard transfers.
|
| | |
| | |
| | |
| | |
| | |
| | | |
We now filter incoming data, which means we can start assuming the
clipboard data is always null terminated. This allows us to clean
up a lot of the internal handling.
|
|/ /
| |
| |
| |
| | |
We're usually white listed, but let's be a good citizen and formally
request the keyboard grab ability from the compositor.
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
We need to track different things in the server and client, so
separate things to two independent structures to keep things more
clear.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Avoid direct access to the screen dimensions and layout so that we
can make sure it stays sane. This also makes sure the layout is
properly updated when we only get the screen dimensions from the
server.
|
|/ / |
|