Commit Graph

202 Commits

Author SHA1 Message Date
zengguang e3cfe7300c
Fixed app windows destroy will do close(0) (#8073)
shmid was not initailized on creation of app window, that will be close fd = 0. everytimes in app windows destroy (Call xf_DestroyWindow ).
2022-07-15 09:18:45 +02:00
akallabeth bc8b4ade1c reformatted 2022-06-23 08:48:39 +02:00
akallabeth de91cec5bf Fixed const warning 2022-06-23 07:45:55 +02:00
akallabeth bbf3b8deba Cleaned up xf_AppWindowFromX11Window use 2022-05-19 11:23:43 +02:00
2fly2 8f831ed324 fix RAIL abort when reconnect
Signed-off-by: 2fly2 <wjatchd@163.com>
2022-05-19 11:23:43 +02:00
akallabeth d3e1810473 Follow up to #7832: Add NULL checks 2022-04-27 23:29:44 +02:00
2fly2 56b0ca7b3f fix restore a maximized window when it is minimized
Signed-off-by: 2fly2 <wjatchd@163.com>
2022-04-27 18:15:56 +02:00
akallabeth d22ef1786b Proper use of rdpSettings in client
* Use getter/setter
* Fix uninitialized uses
2022-03-28 15:52:32 +02:00
akallabeth 3d38d2636c Decreased logging verbosity for INFO level 2022-03-04 09:34:02 +01:00
Armin Novak 4d03d7c0bf Freerdp remove #ifdef HAVE_CONFIG_H 2022-03-03 11:26:48 +01:00
Armin Novak b2ad47a809 Reorganized FreeRDP headers 2022-03-03 11:26:48 +01:00
akallabeth e136444f51 Fixed xinput and x11 event priority
* Prefer xinput events over x11 events for mouse input
* Prefer xinput raw events over xinput events:
  * Only use when the mouse is grabbed (events are not bound to a
    specific window but are global)
  * Only use for relative mouse input
2022-02-22 09:44:13 +01:00
akallabeth 7641710f60 Use a client/common context component
* Allows moving common client code from specific client to a
  generic client/common implementation
2022-02-22 09:44:13 +01:00
akallabeth 8cc6582044
Unify struct definitions (#7633)
* Unified enum/struct definitions, fixed include issues

* Fixed mac compilation issues

* Added missing include

* Fixed windows server build warnings

* Fixed VS2010 build issue

* Removed unnecessary library linking

* Fixed ThreadPool WinXP compatibility

* Fixed pr review remarks
2022-02-14 14:59:22 +01:00
Armin Novak 339cdded45 Fixed memory sanitizer warnings 2022-01-11 14:32:18 +01:00
Armin Novak b3209fe2b9 Fixed #7326: Ensure proper window size
When leaving fullscreen with enabled smart sizing the window size
did shrink due to first resizing the window, then enabling window
decorations and finally moving to the correct position.
2021-10-05 10:56:33 +02:00
akallabeth 242f1734ec Fixed dpkg-buildpackage warnings 2021-06-30 11:57:23 +02:00
Ondrej Holy 892cbe3261 Fix various memory leaks reported by Coverity
Covscan report contains various memory leak defects which were marked
as important. I have spent some time analyzing them and although they
were marked as important, most of them are in error cases, so probably
nothing serious. Let's fix most of them anyway. The rest are false
positives, or too complicated to fix, or already fixed in master, or
simply I am unsure about them.

Relates: https://github.com/FreeRDP/FreeRDP/issues/6981
2021-04-27 14:25:20 +02:00
Armin Novak 555e1ad8f2 Properly discard xfc->appWindow on focus loss 2021-01-11 15:18:30 +01:00
akallabeth 896b7bc711 Added support for xwayland keyboard grab 2020-10-27 15:45:44 +01:00
Armin Novak 4530a9a631 Modified xf_lock_x11 and xf_unlock_x11, allow recusive
The X11 locking routines did not handle multiple locks from the same
thread well. This pr fixes that.
2020-03-04 15:50:47 +01:00
Armin Novak 72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Armin Novak f01e042211 Code cleanups (strlen, casts, size_t, ...) 2019-10-29 11:58:43 +01:00
Armin Novak 2cc714a57d Updated RAILS implementation
* Implement new messages and callbacks
* Announce most recent channel features
* Added settings to configure flags to announce
2019-05-08 17:25:15 +02:00
Armin Novak e009a62f06 Fixed sign-compare warnings 2019-04-05 09:14:35 +02: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
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 56156d217e Floatbar self contained. 2018-12-07 15:22: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
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
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
Armin Novak 9633e4576d Fixed signedness of MoniorCount 2018-10-25 14:08:20 +02:00
akallabeth 305f5d1bd5
Merge pull request #4600 from andreesteve/xfullscreen
X11: Fix fullscreen toggle
2018-10-17 17:27:29 +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
akallabeth 0b8a66188c
Merge pull request #4865 from mmattes/feature/floatbar
Feature/floatbar for X11
2018-09-25 16:34:20 +02:00
Markus Mattes 21e4804a7f implemented floatbar for x11 2018-09-18 21:25:51 +02:00
Markus Mattes bad8bbadf4 Fix for #4757 2018-07-22 20:00:25 +02:00
Andre Esteve ab0bc2a7f5 X11: Fix fullscreen toggle
1. Fix fullscreen toggle for window managers that do not have multimonitor fullscreen extension support
2. Fix current monitor detection
3. Fix calculation of vscreen boundaries when single monitor is being used
4. Fix start up position of window when starting (used to always go to the top left corener, now centered)

Still a problem:

1. Window decorations do not show when going windowed
2. Smart resizing makes i3 really sad :(
3. Moving window across monitors and going fullscreen always maximizes on startup screen (when not using /multimon)
2018-05-05 18:24:23 -07:00
Ilya Shipitsin 14c15c680d resolve several possible null pointer dereference
issue detected by cppcheck

[channels/drive/client/drive_main.c:454] -> [channels/drive/client/drive_main.c:443]: (warning) Either the condition '!irp' is redundant or there is possible null pointer dereference: irp.
[client/X11/xf_window.c:582] -> [client/X11/xf_window.c:580]: (warning) Either the condition '!xfc' is redundant or there is possible null pointer dereference: xfc.
[winpr/libwinpr/path/test/TestPathShell.c:40] -> [winpr/libwinpr/path/test/TestPathShell.c:43]: (warning) Either the condition '!path' is redundant or there is possible null pointer dereference: path.
[winpr/libwinpr/path/test/TestPathShell.c:49] -> [winpr/libwinpr/path/test/TestPathShell.c:52]: (warning) Either the condition '!path' is redundant or there is possible null pointer dereference: path.
2018-03-24 17:46:39 +05:00
Armin Novak 338e74a6fb Fix #2707: Set fullscreen first
Due to kwin bug https://bugs.kde.org/show_bug.cgi?id=391960
multimonitor fullscreen is not applied correctly with the
previous approach.
2018-03-19 11:54:06 +01:00
Armin Novak 1628045f67 Fullscreen without _NET_WM_FULLSCREEN_MONITORS
Some window managers do not support _NET_WM_FULLSCREEN_MONITORS.
In that case multimonitor fullscreen does not properly work, so
add a path resizing the window over all screens instead.
Based on @erbth pull request, adding proper X11 atom checks.
2017-12-20 16:54:44 +01:00
David Fort 80dab90f1a disp: implement dynamic resolution for X11
If the display channel is available we use it to allow the user to resize the
xfreerdp window. When the window is resized we announce a new monitor layout and
the server reacts by doing a reactivation sequence to the new size.
The minimum window size is limited to 300x300 as 2012 servers crash horribly
if we send them a smaller layout.
2017-12-14 15:13:11 +01:00
Armin Novak afb08c9dfb X11 window title fix 2017-10-31 18:00:15 +01:00
ChickenPeanut 0efb07bc66 Fixed BadValue with XCreateWindow
xf_FixWindowCoordinates occasionally set the dimensions of the window to invalid values (0) because the minimum value check was done at the beginning of the method rather than at the end
2017-09-03 18:52:34 -04:00
abma 165de91287 Revert "Possible fix for #4081 and #2707 (#4087)"
This reverts most of commit 6b7b602370.

Part of #4096
2017-08-22 22:45:38 +02:00
Kai 6b7b602370 Possible fix for #4081 and #2707 (#4087)
* detect openbox automatically

* format code

* copyright update

* free prop at the end of the function
2017-08-14 10:10:53 +02:00
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