Commit Graph

190 Commits

Author SHA1 Message Date
ilammy 82f3abac49 client/X11: teach RAIL to use clipboard redirection
XSelection protocol does not define any global clipboard as there is on
Windows. Instead each window has its own property for clipboard content
(like CLIPBOARD or PRIMARY) and there is a global notion of clipboard
ownership.  Only one window can claim ownership of some clipboard type
at the moment.

FreeRDP uses CLIPBOARD for clipboard transfers (it's the one used by
applications when Ctrl+V is pressed). For regular desktop sessions the
session window itself is used for clipboard interactions via
xfc->drawable field. However, for remote app session there is no session
window. We cannot use the current remote app window as it may change or
be destroyed without closing the session. We also cannot use the root
window as it is already used for CF_RAW transfer protocol.

Therefore we create a simple dummy window to put into xfc->drawable for
this exact job: to act as a clipboard vessel on behalf of the entire
remote app session.

xf_create_window() usually creates the window as we immediately start in
RAIL mode when possible. xf_rail_enable_remoteapp_mode() is invoked only
when autologin failed or remote desktop had to show the session window
to the user for some reason.
2017-05-01 02:10:55 +03:00
Armin Novak 8c687611af Print logon error info. 2017-03-17 13:48:32 +01:00
Armin Novak b2c29158be Scanbuild warning, argument checks and leak fixes.
* Added Stream_GetRemainingCapacity to check remaining stream size
  before writes.
* Fixed shadow server memory leak.
* Fixed lots of scanbuild warnings
* Added missing argument checks in many functions
* Added missing static function declarations
2017-03-02 18:13:43 +01:00
Armin Novak 198bc6d9e1 Fixed compiler warnings. 2017-02-16 13:17:49 +01:00
Armin Novak 042594bf82 Fixed stride for XCreateImage. 2017-01-25 08:34:16 +01:00
Armin Novak 03adbd24a8 AutoReconnect support unlimited retries. 2017-01-09 12:34:09 +01:00
Norbert Federa f71b6b46e8 fix string format specifiers
- fixed invalid, missing or additional arguments
- removed all type casts from arguments
- added missing (void*) typecasts for %p arguments
- use inttypes defines where appropriate
2016-12-16 13:48:43 +01:00
Armin Novak f0203900d7 Fixed +auto-reconnect (#3650) 2016-12-15 12:10:11 +01:00
zihao.jiang e3506bfe88 X11/client: call gdi resize on hw desktop resize. The gdi primary buffer is used in client/X11/xf_gdi.c, it should be big enough to hold the full screen update 2016-11-17 14:36:02 +08:00
Armin Novak b6907aa2b1 Deactivated unsupported operations. 2016-10-16 15:11:01 +02:00
Armin Novak 943e295714 WLog using C99 compatible variadic macros. 2016-10-07 14:05:27 +02:00
Armin Novak 649d270ccd Fixed GDI_RGN->null initialization. 2016-10-06 13:43:15 +02:00
Armin Novak 569c6a578d Reformatted file. 2016-10-06 13:43:13 +02:00
Armin Novak f2d7766db6 Moved common async input handling to core library. 2016-10-06 13:43:12 +02:00
Armin Novak c242467346 Fixed some X11 functions. 2016-10-06 13:43:10 +02:00
Armin Novak 22ddec810b Moved pre and post channel hooks. 2016-10-06 13:43:10 +02:00
Armin Novak d35823cf69 Moved channel init code to core library. 2016-10-06 13:43:09 +02:00
Armin Novak dadc5262ae Removed static channel variables.
Global static variables do not work, if more than one instance
of an RDP client is running in the same process space.
Removed the varaibles where possible and replaced them with
thread local storage where necessary.
2016-10-06 13:43:09 +02:00
Armin Novak c8a7065f93 Refactored xfContext. 2016-10-06 13:43:06 +02:00
Armin Novak 9af71b9878 Fixed color conversion from order. 2016-10-06 13:43:06 +02:00
Armin Novak 7dbeeb2df6 Fixed hardware GDI. 2016-10-06 13:43:04 +02:00
Armin Novak 9d82c4701b Removed duplicate code. 2016-10-06 13:43:03 +02:00
Armin Novak b8ff3cb235 Fixed (a lot of) GDI drawing issues. 2016-10-06 13:43:03 +02:00
Armin Novak 85bbe2a908 API refactoring. 2016-10-06 13:43:03 +02:00
Armin Novak e650fdb2b6 Bugfixes. 2016-10-06 13:43:02 +02:00
Armin Novak 9d5ca34d0d Fixed pointer initialisation for X11. 2016-10-06 13:43:02 +02:00
Armin Novak bc8217ed42 Removed palette, using GDI one. 2016-10-06 13:43:01 +02:00
Armin Novak 8fffda5740 Fixed clearcodec and codecs reset. 2016-10-06 13:43:01 +02:00
Armin Novak 9fc8dc6b5d Removed gdi->codecs, unused. 2016-10-06 13:43:00 +02:00
Armin Novak 03907c82a9 Fixed issues. 2016-10-06 13:43:00 +02:00
Armin Novak 716c5c53e9 256 color support. 2016-10-06 13:42:59 +02:00
Armin Novak 48d1b4ee13 Fixed color ordering for GDI. 2016-10-06 13:42:59 +02:00
Armin Novak da956e0388 ... 2016-10-06 13:42:59 +02:00
Armin Novak df35c135d1 Fixed color conversion, unified GFX and updated API. 2016-10-06 13:42:58 +02:00
Norbert Federa 374f97aad3 client/x11: don't close locked mutex 2016-06-07 19:01:03 +02:00
Armin Novak 36cbf1b583 Fixed error handling for channel load failures. 2016-03-14 13:13:43 +01:00
Armin Novak b35f6658b9 Moved common code from cli clients to client lib. 2016-02-05 02:05:37 +01:00
Armin Novak cbf2892ccc Implemented temporary certificate accept.
Certificates can now be accepted temporarily.
The callbacks for certificate validation have been
modified to extend the information presented to the user.
2016-02-05 02:04:57 +01:00
Roland Kaufmann 600d3c5ccb Add option to disable pointer button mapping
In case the old behaviour of not reverse-mapping the mouse buttons is
desirable, a command-line option is added to disable the mapping. This
option is made experimental for the time being.

The default is to do the reverse mapping, as this is the intuitive
behaviour (the mouse then works as it would on the console).
2015-12-15 17:42:57 +01:00
Roland Kaufmann 9f43291126 Get pointer button mapping from input system
If XInput extension is available, then find the (first) pointer device
and use the button mapping of that one. If there are more than one
pointer devices, they could have different button mappings, but it is
not clear how this should be communicated to the RDP server.

If XInput is not available, attempt to fallback to the old global
mapping. (This mapping exists, but is not correct if there actually
is an XInput extension loaded, as it is then not used).
2015-12-15 17:42:05 +01:00
Roland Kaufmann 6ca8962045 Map logical to physical mouse button events
RDP expects to receive an indicator of the physical mouse button that
was pressed on the client, whereas X11 deliver a value for which
logical mouse button that was pressed.

This patch introduces a (reverse) mapping from logical mouse buttons to
physical mouse buttons, so that the RDP server can do correct mapping
for the event on its end.

However, no actual mapping is done here; this patch just introduces the
framework to do so. Thus, there should be no behavioural change from
this patch alone.

There is an implicit assumption that only the first three buttons are
mapped to eachother. Enabling more a general mapping would require
extensive changes to the event handling as fourth logical button and
up is used for special functionality such as wheel.
2015-12-15 17:42:05 +01:00
Hardening 57fe581b16 Merge pull request #2824 from bjcollins/nla_auth_exit_code
Return FREERDP_ERROR_AUTHENTICATION_FAILED on an authentication failure
2015-12-08 22:46:29 +01:00
Norbert Federa 3eee70b164 Merge pull request #2926 from bjcollins/rail_fixes
Rail fixes
2015-11-06 13:34:42 +01:00
Norbert Federa a4580923e7 xfreerdp/clipr: fix self owned test and hardening
- xf_cliprdr_is_self_owned() lied if multiple xfreerdp instances were
  running.
- fixed a few unchecked callocs
- added/modified and handled some return values in compliance with
  the new hardened channel api
2015-10-20 21:28:29 +02:00
bjcollins 8e27b6d05e RemoteApp Support
1. Remove all uses of "localWindowOffsetCorr" variables, they added an extra layer of complexity and they are not actually needed to handle coordination of window position/size between
the local coordinate system and the remote one. This logic was causing issues in the case where the window was moved off the left side of the screen.

2. Update the xf_setWindowVisibilityRects function to offset the visibility rects as necessary when the window is hanging off the left side of the screen.

3. Stop sending mouse events when doing keyboard moves/sizes(as desired), and stop sending two mouse events for non-keyboard moves/sizes

4. Move location of new UTF8_STRING variable from previous commit

5. Refresh window and window shape for any window position/size updates, this helps keep the local and server windows in sync and works around some race conditions
2015-10-15 18:41:55 -05:00
bjcollins cb4e4cf6fc Store Miscellaneous X11 Atoms into variables to match how we handle other X11 Atoms. 2015-10-15 14:59:53 -05:00
bjcollins 6d3565bd4c Fix xf_rail_paint fencepost error
The regions used to store and calculate the invalidRegion are exclusive
of the bottom and right edges, not inclusive.

Fixes "mouse droppings" in mspaint.exe when moving the mouse leftwards
across the canvas.
2015-10-15 14:29:48 -05:00
bjcollins 7fbc7e45a7 Clean up NLA authentication failure handling code
1. Make use of freerdp_set_last_error to set authentication failure without the helper functions
2. Rename ssl callback function
3. Break out AuthenticationOnly exit handling from bad connect handling
2015-09-15 14:07:14 -05:00
bjcollins 32a1406dc4 Return FREERDP_ERROR_AUTHENTICATION_FAILED on an authentication failure
when using NLA with xfreerdp.
2015-09-15 14:07:14 -05:00
Martin Haimberger 52405a3e79 Remove WIN32ERROR type
All return values are UINT now.
2015-08-27 05:38:20 -07:00