Commit Graph

2813 Commits

Author SHA1 Message Date
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
Bernhard Miklautz
8be6ec9720 fix [cmdline]: parameter parsing
use strtoul instead of strtol
2018-11-08 11:13:57 +01:00
Bernhard Miklautz
1222e7060b new [crypto/tls]: add support to set tls security level
The newly introduced option /tls-seclevel can be used to set the tls
security level on systems with openssl >= 1.1.0 or libressl.
As default level 1 is used as higher levels might prohibit connections
to older systems.
2018-11-08 11:13:15 +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
akallabeth
3d0ccb3f5d
Merge pull request #4946 from mmattes/fix/floatbar_app_check_missing
added missing check for remote app where no floatbar exists
2018-10-18 16:40:22 +02:00
Markus Mattes
a235b44f61 added missing check for remote app where no floatbar exists 2018-10-18 15:33:01 +02:00
Armin Novak
88d310ff2c Fixed compiler warnings (casts, ...) 2018-10-18 09:09:30 +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
e54af8efa0
Merge pull request #4927 from akallabeth/cmdline_fixes
Fixed command line setting of flags, unified string replace
2018-10-17 12:19:03 +02:00
Armin Novak
7b860ce96a Add command line option /relax-order-checks 2018-10-17 12:16:58 +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
Armin Novak
ca3fb26230 Deactivated unimplemented orders. 2018-10-15 15:22:50 +02:00
Armin Novak
f88ed950d3 Fixed various issues with primary orders. 2018-10-15 14:30:58 +02:00
Armin Novak
9729590870 Fixed command line setting of flags, unified string replace 2018-10-15 12:04:33 +02:00
Armin Novak
a8a6accc15 Fixed compiler warnings. 2018-10-03 15:16:59 +02:00
David Fort
2e1bf90bd9
Merge pull request #4885 from akallabeth/autoreconnect_handle_window_events
Fixed #3423: Process xevents when in reconnect mode.
2018-10-03 09:42:16 +02:00
akallabeth
4e71af6772
Merge pull request #4906 from FeLvi-zzz/japanese-patch
Japanese patch #4905
2018-10-02 15:46:17 +02:00
FeLvi_zzz
751cfde864 remove untranslatable strings in Japanese translation 2018-10-02 21:53:55 +09:00
FeLvi_zzz
6d36707ec4 fixed typo in Japanese translation 2018-10-02 21:47:08 +09:00
Armin Novak
00489ae75b Reworked checks in xf_disp.c 2018-10-02 12:33:52 +02:00
FeLvi_zzz
2564a6a2d2 modified Japanese translation #4905 2018-10-02 18:36:58 +09:00
FeLvi_zzz
7a44e179cf
added Japanese translation 2018-10-02 18:00:29 +09:00
Armin Novak
f332779982 Fixed floatbar X11 leak. 2018-10-01 10:50:47 +02:00
Armin Novak
046d2296a0 Fixed floatbar X11 leak. 2018-10-01 10:49:30 +02:00
Armin Novak
a5b689b35d Readded override redirect but reset on focus loss. 2018-09-26 12:38:16 +02:00
Armin Novak
316eed1fbf Menus are no longer popup windows but dropdown menus. 2018-09-26 12:38:16 +02:00
Armin Novak
fa7902c362 Fixed argument check for floatbar events. 2018-09-26 10:14:51 +02:00
David Fort
d0612151f9
Merge pull request #4874 from r-barnett/fix-MonitorLocalShift
MonitorLocalShiftX,Y should be set when 1st monitor from MonitorIds s…
2018-09-26 10:02:49 +02:00
Martin Fleisz
a90b74b8dc
Merge pull request #4879 from akallabeth/clip_fix
Fixes for clipboard #4876
2018-09-26 09:37:41 +02:00
akallabeth
0b8a66188c
Merge pull request #4865 from mmattes/feature/floatbar
Feature/floatbar for X11
2018-09-25 16:34:20 +02:00
Armin Novak
8357f61818 Fixed load/unload for display channel. 2018-09-24 16:44:25 +02:00
Armin Novak
51f97f2d3e Fixed #3423: Process xevents when in reconnect mode.
Fixed crashes due to unloaded disp channel in reconnect mode.
2018-09-24 16:24:32 +02:00
Armin Novak
13478c7445 Skip empty server format response. 2018-09-24 12:47:46 +02:00
Armin Novak
228e63d619 Free RDP_KEYBOARD_LAYOUT with freerdp_keyboard_layouts_free 2018-09-24 12:47:32 +02:00
Armin Novak
897c0c72a7 Unified auto_reconnect functions for all clients. 2018-09-24 10:31:43 +02:00
rbarnett
41664572a5 MonitorLocalShiftX,Y should be set when 1st monitor from MonitorIds selected as primary 2018-09-21 13:40:48 -05:00
Martin Fleisz
2096c1108e
Merge pull request #4872 from akallabeth/sw_gdi_default
Fix #4851: Software GDI is now default
2018-09-21 13:02:39 +02:00
akallabeth
30601608e4
Merge pull request #4855 from r-barnett/fix-logoff-exit-code
Map a particular disconnect situation triggered by a user logging off…
2018-09-20 12:07:36 +02:00
Armin Novak
dfb1049653 Fix #4851: Software GDI is now default 2018-09-20 10:44:03 +02:00
rbarnett
5d3e76bd80 Replace cryptic names; move the disconnect ultimatum reasons enum into public API and rename; remove setter 2018-09-19 09:36:39 -05:00
rbarnett
8458266183 Store the disconnect provider ulimatum reason in a new field in struct rdp_context and move the test for a logoff reason to xf_client.c 2018-09-18 15:31:10 -05:00
Markus Mattes
36fc5dde21 fix hidden floatbar consumes a lot of cpu 2018-09-18 21:46:02 +02:00
Markus Mattes
21e4804a7f implemented floatbar for x11 2018-09-18 21:25:51 +02:00