Commit Graph

1392 Commits

Author SHA1 Message Date
Armin Novak
05901280fe Fixed unused argument warnings. 2019-04-05 09:14:35 +02:00
Armin Novak
c18b30af96 Fixed dead store warnings 2019-04-05 09:14:35 +02:00
Armin Novak
e009a62f06 Fixed sign-compare warnings 2019-04-05 09:14:35 +02:00
DraganNSDK
f002c7429b potential fix for ENTER (modifiers) stuck after CTRL-ALT-ENTER (toggle fullscreen), clearing the buffer in xk_keyboard_update_modifier_keys. (#5280)
* xk_keyboard_update_modifier_keys fixed to clear the buffer.

* removed the xf_keyboard_clear(xfc) fix comments
2019-02-25 12:44:51 +01:00
Armin Novak
81d7e62642 Fixed broken checks in X11 event (RAIL mode) 2019-02-08 10:46:26 +01:00
Armin Novak
2dab778101 Fixed NULL dereferences and uninitialized values 2019-01-30 16:11:10 +01:00
Armin Novak
087390b303 Refactored client clipboard function callbacks for const data pointers. 2019-01-23 16:55:13 +01:00
Martin Fleisz
aa442de059
Merge pull request #5174 from chipitsine/master
resolve several issues found by cppcheck
2019-01-07 15:21:46 +01:00
Armin Novak
2dcc2614d4 Fixed X11 horizontal mouse wheel direction. 2019-01-07 10:01:46 +01:00
Ilya Shipitsin
bdc039e719 resolve several issues found by cppcheck
[client/X11/xf_floatbar.c:800] -> [client/X11/xf_floatbar.c:796]: (warning) Either the condition '!floatbar' is redundant or there is possible null pointer dereference: floatbar.
[client/X11/xf_floatbar.c:800] -> [client/X11/xf_floatbar.c:797]: (warning) Either the condition '!floatbar' is redundant or there is possible null pointer dereference: floatbar.
[client/X11/xf_floatbar.c:800] -> [client/X11/xf_floatbar.c:798]: (warning) Either the condition '!floatbar' is redundant or there is possible null pointer dereference: floatbar.
[libfreerdp/codec/dsp.c:1156] -> [libfreerdp/codec/dsp.c:1154]: (warning) Either the condition '!srcFormat' is redundant or there is possible null pointer dereference: srcFormat.
[channels/drdynvc/client/drdynvc_main.c:1453] -> [channels/drdynvc/client/drdynvc_main.c:1450]: (warning) Either the condition '!drdynvc' is redundant or there is possible null pointer dereference: drdynvc.
[channels/audin/client/opensles/audin_opensl_es.c:98] -> [channels/audin/client/opensles/audin_opensl_es.c:94]: (warning) Either the condition '!opensles' is redundant or there is possible null pointer dereference: opensles.
[channels/audin/client/opensles/audin_opensl_es.c:159] -> [channels/audin/client/opensles/audin_opensl_es.c:153]: (warning) Either the condition '!opensles' is redundant or there is possible null pointer dereference: opensles.
2019-01-02 20:35:24 +05:00
Bernhard Miklautz
6f6c8473a1
Merge pull request #5126 from akallabeth/x11_button_mapping
X11 extended button remapping support.
2018-12-11 08:53:39 +00:00
Armin Novak
0fa9f06565 Modified flag checks to avoid invalid flag sets. 2018-12-11 09:34:07 +01:00
Armin Novak
2ce04069cb Fixed crashes in rail mode after merge of floatbar fixes. 2018-12-10 15:41:20 +01:00
Armin Novak
7102927548 X11 extended button remapping support.
Up until now X11 mouse button remapping was only possible for the
default buttons 1 to 3.
With this pull any X11 mouse button can be mapped to any RDP mouse
event and all X11 remappings are respected.
2018-12-10 15:03:29 +01:00
Martin Fleisz
b82c4f779a
Merge pull request #5020 from akallabeth/floatbar_fixes
Floatbar fixes and windows support
2018-12-10 14:45:10 +01:00
Armin Novak
0d3192b9f7 Fixed rail window key hash function to work with UINT32 2018-12-10 11:16:43 +01:00
akallabeth
2927114e7b
Merge pull request #5117 from hardening/rail_hash
rails: allow a window with id == 0
2018-12-10 10:26:52 +01:00
David Fort
88e361fa00 rails: allow a window with id == 0 2018-12-08 00:32:00 +01:00
Armin Novak
594d10620e Fixed #5040: Unified xfreerdp window title setting. 2018-12-07 15:22:28 +01:00
Armin Novak
5343f6931d Fixed monitor width and height checks. 2018-12-07 15:22:28 +01:00
Armin Novak
56156d217e Floatbar self contained. 2018-12-07 15:22:28 +01:00
Bernhard Miklautz
6c88c21736
Merge pull request #5099 from akallabeth/floatbar_close_window
Fixed #5098: Abort connection and let the application clean up resour…
2018-12-07 13:03:46 +00:00
Martin Fleisz
d0688f058b
Merge pull request #5102 from akallabeth/rail_cleanups
Cleaned up xf_rail_server_handshake
2018-12-07 11:28:22 +01:00
Martin Fleisz
8c7f8eb395
Merge pull request #5085 from akallabeth/cert_callbacks_update
Refactored Certificate callbacks (but keep compatible)
2018-12-06 10:08:17 +01:00
Armin Novak
f5e449a4f8 Cleaned up xf_rail_server_handshake 2018-12-05 09:13:04 +01:00
David Fort
46ffa611cc
Merge pull request #5097 from hualet/master
Fixed RAIL window can't show again once hidden
2018-12-04 22:42:25 +01:00
Armin Novak
0c13c3199e Follow up to #4959: Lock gdi_UpdateSurfaces like xf_UpdateSurfaces 2018-12-04 16:56:22 +01:00
Armin Novak
d260d4e29e Fixed #5098: Abort connection and let the application clean up resources before exit. 2018-12-04 16:42:28 +01:00
Hualet Wang
e33efccf48 Fixed RAIL window can't show again once hidden
The cause is very simple: we didn't map the xwindow on receiving
WINDOW_SHOW. but doing that causes another problem that you can't
hide a window anymore, and that is because whlie window hiding, the
_NET_WM_STATE and WM_STATE properies of the xwindow may change, in
the function `xf_event_PropertyNotify` we just assume that windows
not maximized, not minimized, yet not showing normally should be
corrected to be shown, we just need to consider the situation that
the window is hidden here.

fix: #5078
2018-12-04 20:37:37 +08:00
Armin Novak
e04c319d21 Added new default certificate callbacks with extended information.
The extended information provided by VerifyCertificateEx and
VerifyChangedCertificateEx is now exploited by the new functions
client_cli_verify_certificate_ex and client_cli_verify_changed_certificate_ex.

The old callbacks now print out deprecation warnings to inform the
user and developer about this deprecation.
2018-12-04 09:35:24 +01:00
Armin Novak
2e019b2fd1 Implemented GFX locking and enforce return value checks.
To fix #4825 GFX functions must now aquire a lock before accessing surfaces.
This prevents simultaneous update of internal data by client and gfx threads.
Also enforce return value checks, where not already done.
2018-11-29 11:55:27 +01:00
Armin Novak
7d89ea22d4 Unified initialization of OrderSupport
Added a library internal function freerdp_settings_set_default_order_support
which initializes the OrderSupport array of settings.
Now clients no longer need to set this up on their own, if they
do not implement their own hardware accelerated order processing.
2018-11-23 10:11:50 +01:00
Armin Novak
a471fc5939 Spelling fix in log message.
Integrate spelling fix from debian patch from
Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
2018-11-22 12:06:30 +01:00
Bernhard Miklautz
ef0c7e81a7
Merge pull request #4953 from akallabeth/region_signed
signed gdi regions to adjust negative coordinates
2018-11-20 10:07:30 +00:00
Armin Novak
666ef4ab34 Fix #4864: Register pointer cache after PostConnect is called
With #4950 client side pointer implementation was made optional.
This addresses an issue that each client had to call
pointer_cache_register_callbacks on its own.
2018-11-20 09:49:39 +01:00
akallabeth
b6eca4fc54 signed gdi regions to adjust negative coordinates 2018-11-19 12:52:43 +01:00
ileGITimo
d5dd983bcd call xf_SetWindowTitle before XMapWindow, so window manager can act on window name 2018-11-17 06:32:52 -08:00
David Fort
e118d14f6a cmdline: add window-position argument to set initial window position
This is useful if you want the window to be at a given position. The patch also mutualizes
the parsing of <xpos>x<ypos> or <width>x<height> arguments.
2018-11-15 14:40:03 +01:00
Armin Novak
43e17c9755 Fixed color conversion, log level and buffer types 2018-11-14 11:57:57 +01:00
ilammy
9292b2231f xfreerdp: set _NET_WM_ICON to RAIL app icon
Icons on X11 windows are configured using the _NET_WM_ICON property
described in Extended Window Manager Hints. Here we implement converison
from DIB bitmaps used by RAIL to the format expected by _NET_WM_ICON,
and actually set the icon for RAIL app windows.

Both DIB format and _NET_WM_ICON (or rather, Xlib) are weird. Let's
start with RAIL's format. That's the one used in BMP and ICO formats
on Windows. It has some strange properties but thankfully FreeRDP's
freerdp_image_copy() can handle most of them for us. (With an exception
of monochrome and 16-color formats that it does not support. Sorry, but
I'm too lazy to fix them. They are not seem to be used by any real
application either.) The one thing that it can't do is to apply the
alpha transparency bitmask so we have to do it manually. This instantly
reminds us that DIB format has HISTORY: it's vertically flipped and
each must be padded to 4 bytes. Both these quirks having reasonable
(for a certain definition of 'reason') explanations. Such is life.
(Also, 8-bit images require a color palette which we must fill in.)

So okay, now comes _NET_WM_ICON. It is more sane (or rather, easier to
deal with). The bitmap is represented with a tiny [width, height] header
followed by an array of pixels in ARGB format. There is no padding, no
weird color formats. But here's a catch: you can't simply take the
output of freerdp_image_copy() and cast to (unsigned char*) of colors.
We have to allocate an array of C's longs and copy the pixels there,
because that's what Xlib expects (and this is mentioned in the spec).
Simply casting an array of bytes causes crashes on 64-bit systems.
So don't try to cheat or "optimize" and read the docs, kids.

Note that XFlush() call after XChangeProperty(). It's there because it
seems to helps see the icon quicker with Unity on Ubuntu 14.04. I don't
know why. (And Unity does not support _NET_WM_ICON officially. But it
sorta kinda works sometimes.)

Oh, and while we're here, delete some old, unused, and commented out
code that was setting window icons in the past. It's not needed anymore.
2018-11-14 10:53:45 +01:00
ilammy
8163b6d1ce xfreerdp: add RAIL icon cache
This commit adds a cache for RAIL application icons. It is (surpisingly)
used to cache icons for remote applications. This mechanism is described
in MS-RDPERP 3.1.1.2 Icon Cache Support and related items.

Note that some (actually, most) of the icons are not cached. These are
marked with CacheId == 0xFF. In order to keep the code clean we do not
introduce a special case and instead use a 'scratch' icon and simply
pretend to return an xfRailIcon from cache.

We're going to set icons via _NET_WM_ICON property which explains
why we use "long" values to store pixel data. The icon conversion
is not implemented in this commit, it's only stubs.

However, we do implement processing of window information orders that
contain new icons or cached references to previously sent icons. Note
that it is important to not fail (i.e., to not return FALSE) if we
cannot find a window for the icon by its ID. The server occasionally
likes to be slow or something and send icon updates for nonexistent
windows. This behavior is mandated by the spec, too:

    MS-RDPERP 3.2.5.1.6 Processing Window Information Orders

    Upon receipt of a Window Information Order for an icon or
    cached icon, as specified in sections 2.2.1.3.1.2.2 and
    2.2.1.3.1.2.3, the client SHOULD locate the local RAIL window
    that corresponds to the WindowId reported in the Hdr field
    and apply the icon updates to the RAIL window. If no such
    window can be found, the client SHOULD ignore the order.

Indeed, we silently ignore such orders now.
2018-11-14 10:53:45 +01:00
Armin Novak
9633e4576d Fixed signedness of MoniorCount 2018-10-25 14:08:20 +02:00
Armin Novak
02f68c35b9 Fixed -Wextra sign warnings 2018-10-24 13:25:31 +02:00
Bernhard Miklautz
0e9b26c1d2
Merge pull request #4796 from akallabeth/groegera_fixes
Update X11-modifier key state on focus_in
2018-10-22 12:50:21 +00:00
Bernhard Miklautz
9b353202a5 fix [x11]: compiler warnings in floatbar
client/X11/xf_floatbar.c:530:27: warning: use of logical '&&' with constant
      operand [-Wconstant-logical-operand]
        if (event->xmotion.state && Button1Mask && mode > XF_FLOATBAR_MODE_DRAGGING)
                                 ^  ~~~~~~~~~~~
client/X11/xf_floatbar.c:534:32: warning: use of logical '&&' with constant
      operand [-Wconstant-logical-operand]
        else if (event->xmotion.state && Button1Mask && mode == XF_FLOATBAR_MODE_DRAGGING)
                                      ^  ~~~~~~~~~~~
clang 8.0.0-svn344413-1~exp1+0~20181012203207.819~1.gbpc91f27
2018-10-19 11:33:28 +02:00
Markus Mattes
a235b44f61 added missing check for remote app where no floatbar exists 2018-10-18 15:33:01 +02:00
akallabeth
305f5d1bd5
Merge pull request #4600 from andreesteve/xfullscreen
X11: Fix fullscreen toggle
2018-10-17 17:27:29 +02:00
Martin Fleisz
e46d1d95ff
Merge pull request #4926 from akallabeth/primary_order_checks
Order data validation and correction
2018-10-17 16:02:28 +02:00
akallabeth
5778bf102b
Merge pull request #4891 from akallabeth/rail_fixes
Rail fixes #4846 and a crash
2018-10-17 11:32:56 +02:00
Armin Novak
10cc319973 Announce glyph orders if glyph cache is activated. 2018-10-17 10:47:23 +02:00