Commit Graph

357 Commits

Author SHA1 Message Date
Alexander Zakharov
85f99edd65 Update copyrights 2019-02-01 11:21:32 +03:00
Alexander Zakharov
1cbc2aa739 Change the way we do fullscreen 2019-01-28 11:09:16 +01:00
Alexander Zakharov
bb1c90fb49 Fix FreeBSD build 2019-01-18 13:01:12 +03:00
Alexander Zakharov
ca03f60a09 Fix Solaris build 2018-10-31 10:51:13 +03:00
Henrik Andersson
c16b74a974 Run indent-all.sh script on source 2018-10-29 15:53:57 +01:00
Pierre Ossman
5278291a82 Drain X event queue without any delay
A 100 ms delay between iterations was still too large for many cases,
so try to clear the event queue as fast as possible.
2018-07-02 13:23:22 +02:00
Henrik Andersson
5fbf4bd953 Fixes memleak where unprocessed X11 events builds up on queue
There is a limiter used for processing X11 events set to 20
for slicing between processing X11 event and processing data
on file descriptors. Before this fix, when waiting for data on
filedescriptors, we assumed that there were no pending X11
events left on queue and therefore the select() timeout on
60 seconds.

Now we will check the queue and select a timeout depending
on whats left to do.

Fixes bug #275
2018-06-29 10:31:48 +02:00
Henrik Andersson
79e5b3353b Add support for 16bit cursors
Fixes issue #273
2018-06-26 10:03:50 +02:00
Henrik Andersson
3918157521 Fix crash when freeing already freed null cursor.
The fallback cursor should never be destroy when removed from
cursor cache.

Fixes issue #274
2018-06-26 10:00:50 +02:00
Pierre Ossman
2fb1fd610f Update requested session size with RDPEDISP
We need to track the desired session size even if we can resize
without a reconnect. Otherwise we will request the wrong size in
the event we need to reconnect for another reason (e.g. network
problems).
2018-03-28 16:38:55 +02:00
Cendio
4580492c12 Prefer online resize over reconnect resizes
We had a case on Windows 2012R2 where any early resizes would be
handled by a reconnect rather than an online resize, which led to a
bunch of follow-up problems with the session startup.

To solve this, we gave the RDPEDISP channel more time to become
established.

Co-authored-by: Henrik Andersson <hean01@cendio.com>
Co-authored-by: Karl Mikaelsson <derfian@cendio.se>
2018-03-07 10:49:25 +01:00
Cendio
a0af72a337 Fix fullscreen toggle when dynamic session resize is disabled
When dynamic session resize is disabled, leaving fullscreen should
result in a window that matches the session size.

Co-authored-by: Henrik Andersson <hean01@cendio.com>
Co-authored-by: Karl Mikaelsson <derfian@cendio.se>
2018-02-14 10:49:39 +01:00
Cendio
8bc2cea80f Add check if we can use dynamic session resize
When the server does not comply with our initial session size
request, we disable the dynamic session resize feature.

Co-authored-by: Henrik Andersson <hean01@cendio.com>
Co-authored-by: Karl Mikaelsson <derfian@cendio.se>
2018-02-14 10:49:30 +01:00
Cendio
9d163423eb Fullscreen windows should not be resized to match the session size
Given that a fullscreen window should have the same size as the
screen, when the server tells us a session size, then we can't
resize the fullscreen window.

Co-authored-by: Henrik Andersson <hean01@cendio.com>
Co-authored-by: Karl Mikaelsson <derfian@cendio.se>
2018-02-13 14:14:02 +01:00
Cendio
81c030a887 Fix reconnect-loop going from initial fullscreen on Unity
Moving responsibility for actual resize to process_pending_resize()
Cleaning up duplicated calculation of session size
Removing handling of percentage of screen for now

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-31 11:03:32 +01:00
Cendio
07abc9bade Defer pending resize until after autoreconnect cookie is received
Resize session using disconnect/reconnect sequence should not be
performed before we have received an auto-reconnect cookie which is
used for reconnecting to the session. There is a race when trying to
reconnect at this point so a defer timer is used to delay this further
from the point where the auto-reconnect cookie is received.

Fixes a problem where a login prompt is shown upon reconnect even if
the auto-reconnect cookie is available and used.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
2018-01-31 11:03:32 +01:00
Cendio
a6d82619ee Fix regression introduced in commit 85c10b5
There was either an X11 BadMatch error crash or the
rdesktop main window disappeared when toggling from
window to fullscreen. The bug is consitently
reproducible but only on some systems, maybe this is
a X11 version dependent bug. Move back to old beahavior
were we destroy and recreate the window when toggling
between fullscreen and windowed mode.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
2018-01-11 15:10:05 +01:00
Cendio
1f3d1fb3e0 Refactor handling of user requested window sizes
Extract ui_init_connection() into smaller functions
to clarify purpose.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-11 15:10:05 +01:00
Cendio
884f56a8e7 Fixed failing fullscreen toggle in disconnect/reconnect mode
When starting rdesktop with a fixed window size against W2008R2,
toggling to fullscreen failed to resize window to expected fullscreen
size.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-11 15:10:05 +01:00
Cendio
7f76e2218a Rename of global variable for clarity
Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-11 15:10:05 +01:00
Cendio
8ef9f39aa8 Avoid fight about requested session size upon disconnect/reconnect resize.
Move ui_init_connection() outside main loop since it is the source for the
fight of requested session size after a resize reconnect. This should only
be called once for setting up initial requested session size via command
line args.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-11 15:10:05 +01:00
Cendio
ba41f749c6 Refactor g_sizeopt into an enumeration for clarity
Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
2018-01-11 15:10:05 +01:00
Cendio
e2f5a7b532 Refactor geometry string parsing
Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
2018-01-11 15:10:05 +01:00
Cendio
85c10b5bc0 Remember window position when toggling fullscreen with RDPEDISP
The rdesktop window used to move to a new position on the screen after
leaving fullscreen. This commit restores the window to the position it
had before entering fullscreen.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2017-12-07 11:15:03 +01:00
Cendio
2be151b328 Always call XRRUpdateConfiguration on root window resize
This fixes a problem where HeightOfScreen and WidthOfScreen returned
old, incorrect sizes after the root window was resized while rdesktop
was not in fullscreen. Calling XRRUpdateConfiguration ensures that the
HeightOfScreen and WidthOfScreen macros return the proper values.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2017-12-07 11:15:03 +01:00
Cendio
ab50ea31cf Implement dynamic session resize
This adds support for resizing the RDP session dynamically based on
the window size. Some complicated logic has been added to avoid
sending excessive amounts of resize requests to the RDP server.

When supported, this resize mechanism should use the RDPEDISP way of
signalling the server to initiate a Deactivate/Activate sequence, but
rdesktop will fall back on Disconnect/Reconnect if RDPEDISP is not
supported by the server.

ui_select has been refactored and most functionality has been broken
out into three new functions, simplifying ui_select into a loop.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2017-12-07 11:15:03 +01:00
Cendio
4ea0e06713 Refactor deactivation of seamless mode
Toggling out of seamless mode is piggy backed on toggle fullscreen.
This introduces a broken behaviour were you get out of seamless mode
and subsequent calls to toggle fullscreen will not take you back.
Just toggle the window between windowed and fullscreen mode.

This refactoring will disable toggle between fullscreen and windowed
mode when rdesktop is started in seamless mode. Still there is a
problem were you can not go back into seamless mode when deactivated.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2017-12-07 10:30:01 +01:00
Cendio
2f03f65efe Add Dynamic Virtual Channels and basic RDPEDISP support
Fix issue #192

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
2017-11-09 15:39:39 +01:00
René Genz
9e99dd52d6 Fix minor spelling mistakes 2017-11-02 01:01:44 +01:00
Joshua Hudson
e7cda3dbf8 add -M for local mouse cursor 2017-11-01 06:47:31 +01:00
Karl Mikaelsson
8f83c1f6c7 Rename suppress output functions to match MS-RDPBCGR
Issue #161
2017-10-30 10:47:21 +01:00
Henrik Andersson
0d707ae103 Fix sign-compare compiler warnings 2017-10-20 13:30:42 +02:00
Henrik Andersson
02a7ec4361 Fixed a few compiler warning, compare sign / unsigned values 2017-10-17 10:27:14 +02:00
Henrik Andersson
797a28ed25 Fix pointer sign warning 2017-10-17 10:20:23 +02:00
Henrik Andersson
f50e17ba9f Fix uninitialized variable warning
This also set a cursor pixelvalue to RED to visually
indicate error while parsing the cursor.
2017-10-17 10:16:07 +02:00
Henrik Andersson
7a81f7eae2 Fix all unused params warnings 2017-10-17 10:07:55 +02:00
Henrik Andersson
31f99755f7 Fix bug were for loop will always run until break is hit.
When 'i' is an unsigned int, it can never become negative and
stop the for loop iterating over the children.
2017-10-17 10:00:22 +02:00
Karl Mikaelsson
b8a1d04ffb Use system default pointer when requested
Solves problem with hidden cursors at login screen (part of
issue #165)

Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
Signed-off-by: Henrik Andersson <hean01@cendio.se>
2017-10-16 13:55:39 +02:00
Alexander Zakharov
f091a38cff Sane way to fix absence of HOST_NAME_MAX on osx 2017-10-05 19:47:50 +03:00
Henrik Andersson
0954ac3ca5 Some cursors are hard to see on dark background
The new cursor rendering code that was added will render
1bpp XOR cursors as plain black cursors. This introduces
a problem were the cursor is not visible on dark backgrounds.
This change adds a white outlined rendering of the shape to
those specific cursors.
2017-09-27 13:49:33 +02:00
Henrik Andersson
04761c66c6 Free image after cursor is created. 2017-09-26 11:13:09 +02:00
Henrik Andersson
550056ab42 Add debug log for ui_set_cursor() 2017-09-26 09:16:43 +02:00
Henrik Andersson
109893c9da Fix type in log message 2017-09-26 09:02:32 +02:00
Henrik Andersson
6dd85edc6f Rewrite cursor code to use Xcursor
This commit enables support for color cursors with alpha,
however this raises the requirement of libXcursor which is
not such a big deal.

Fixes issue #86 and #21
2017-09-21 16:02:56 +02:00
Pierre G. Bogossian
9889ed6457 Support extended mouse buttons 4 and 5 (ie back/forward buttons) 2017-07-09 16:56:30 +02:00
Henrik Andersson
05689dbc99 Fix to reset clipping at reconnect resize
The previous fix for clipping problems was not enough, reverted
that change in xwin.c in favor for adding reset of window clipping
rect at reconnect.

Fix issue #117
2017-05-15 14:57:50 +02:00
Henrik Andersson
2c9a706c23 Fix X error BadAlloc when using seamlessrdp
The introduction of setting session size using percentages of both
with and height of screen like -g 50%x100%, commit 3140824be
introduced a bug when using seamless rdp. This commit fixes this bug.
2017-03-09 12:25:10 +01:00
Henrik Andersson
87d8d123b8 Rework the logging system
This commit will add a logging system to solve the problem that
one actually need to recompile rdesktop from source to enable
different debug logging.

- Same logging api  for all kind of logging and messages to
   end user.

- Adding -v for verbose output when running rdesktop.

- All messages are logged into a subject and with a type, eg:

     logger(Keyboard, Notice, "Autos-electing %s based on locale.", locale);

- Debug logging is enabled trough a environment variable RDEKSTOP_DEBUG,
  which specifies subjects of interest, comma separated. There is a special
  subject named All which includes all subject for debug loggin. There is also
  a simple logic opeartor '!' = NOT which can be used in combination like:

    RDESKTOP_DEBUG=All,!Graphics,!Sound

  Which would give debug log output for All subject except Graphics and Sound.
2017-01-26 14:19:40 +01:00
Henrik Andersson
71bf45a5d7 Ran indent-all script 2017-01-25 00:34:37 +01:00
Henrik Andersson
14a4bf2d1d Use the correct mask for XSendEvent()
Sending ClientMessage is plain wrong.
2017-01-24 23:45:17 +01:00