2011-08-09 06:24:12 +04:00
|
|
|
/**
|
2012-10-09 07:02:04 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2011-08-09 06:24:12 +04:00
|
|
|
* X11 Windows
|
|
|
|
*
|
|
|
|
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
2012-06-13 23:45:58 +04:00
|
|
|
* Copyright 2012 HP Development Company, LLC
|
2011-08-09 06:24:12 +04:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2012-08-15 01:20:53 +04:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2011-11-29 01:50:08 +04:00
|
|
|
#include <stdarg.h>
|
2012-07-09 10:52:15 +04:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <sys/types.h>
|
2012-08-15 01:20:53 +04:00
|
|
|
|
2011-10-28 20:27:09 +04:00
|
|
|
#include <X11/Xlib.h>
|
2011-08-09 06:24:12 +04:00
|
|
|
#include <X11/Xutil.h>
|
2011-08-23 23:52:17 +04:00
|
|
|
#include <X11/Xatom.h>
|
2012-08-15 01:20:53 +04:00
|
|
|
|
2012-06-13 23:45:58 +04:00
|
|
|
#include <sys/shm.h>
|
|
|
|
#include <sys/ipc.h>
|
2011-08-24 06:58:36 +04:00
|
|
|
|
2012-11-20 08:49:08 +04:00
|
|
|
#include <winpr/crt.h>
|
|
|
|
|
2011-09-02 02:08:53 +04:00
|
|
|
#include <freerdp/rail.h>
|
|
|
|
#include <freerdp/utils/rail.h>
|
|
|
|
|
2011-08-24 06:58:36 +04:00
|
|
|
#ifdef WITH_XEXT
|
2011-08-23 00:06:12 +04:00
|
|
|
#include <X11/extensions/shape.h>
|
2011-08-24 06:58:36 +04:00
|
|
|
#endif
|
2011-08-09 06:24:12 +04:00
|
|
|
|
2013-04-26 01:00:43 +04:00
|
|
|
#ifdef WITH_XI
|
|
|
|
#include <X11/extensions/XInput2.h>
|
2013-05-08 05:42:49 +04:00
|
|
|
#include "xf_input.h"
|
2013-04-26 01:00:43 +04:00
|
|
|
#endif
|
|
|
|
|
2013-05-11 01:51:09 +04:00
|
|
|
#include "xf_input.h"
|
|
|
|
|
2013-04-02 23:13:10 +04:00
|
|
|
#ifdef WITH_DEBUG_X11
|
|
|
|
#define DEBUG_X11(fmt, ...) DEBUG_CLASS(X11, fmt, ## __VA_ARGS__)
|
|
|
|
#else
|
|
|
|
#define DEBUG_X11(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_DEBUG_X11_LOCAL_MOVESIZE
|
|
|
|
#define DEBUG_X11_LMS(fmt, ...) DEBUG_CLASS(X11_LMS, fmt, ## __VA_ARGS__)
|
|
|
|
#else
|
|
|
|
#define DEBUG_X11_LMS(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
|
|
|
#endif
|
|
|
|
|
2011-10-22 20:55:03 +04:00
|
|
|
#include "FreeRDP_Icon_256px.h"
|
|
|
|
#define xf_icon_prop FreeRDP_Icon_256px_prop
|
|
|
|
|
2011-08-09 06:24:12 +04:00
|
|
|
#include "xf_window.h"
|
|
|
|
|
2011-08-17 22:13:44 +04:00
|
|
|
/* Extended Window Manager Hints: http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html */
|
|
|
|
|
2011-12-03 02:51:30 +04:00
|
|
|
/* bit definitions for MwmHints.flags */
|
|
|
|
#define MWM_HINTS_FUNCTIONS (1L << 0)
|
|
|
|
#define MWM_HINTS_DECORATIONS (1L << 1)
|
|
|
|
#define MWM_HINTS_INPUT_MODE (1L << 2)
|
|
|
|
#define MWM_HINTS_STATUS (1L << 3)
|
|
|
|
|
|
|
|
/* bit definitions for MwmHints.functions */
|
|
|
|
#define MWM_FUNC_ALL (1L << 0)
|
|
|
|
#define MWM_FUNC_RESIZE (1L << 1)
|
|
|
|
#define MWM_FUNC_MOVE (1L << 2)
|
|
|
|
#define MWM_FUNC_MINIMIZE (1L << 3)
|
|
|
|
#define MWM_FUNC_MAXIMIZE (1L << 4)
|
|
|
|
#define MWM_FUNC_CLOSE (1L << 5)
|
|
|
|
|
|
|
|
/* bit definitions for MwmHints.decorations */
|
|
|
|
#define MWM_DECOR_ALL (1L << 0)
|
|
|
|
#define MWM_DECOR_BORDER (1L << 1)
|
|
|
|
#define MWM_DECOR_RESIZEH (1L << 2)
|
|
|
|
#define MWM_DECOR_TITLE (1L << 3)
|
|
|
|
#define MWM_DECOR_MENU (1L << 4)
|
|
|
|
#define MWM_DECOR_MINIMIZE (1L << 5)
|
|
|
|
#define MWM_DECOR_MAXIMIZE (1L << 6)
|
|
|
|
|
2011-08-09 06:24:12 +04:00
|
|
|
#define PROP_MOTIF_WM_HINTS_ELEMENTS 5
|
|
|
|
|
2012-09-03 00:34:06 +04:00
|
|
|
/* to be accessed by gstreamer plugin */
|
2012-06-13 23:45:58 +04:00
|
|
|
#define SHARED_MEM_KEY 7777
|
|
|
|
|
2011-08-09 06:24:12 +04:00
|
|
|
struct _PropMotifWmHints
|
|
|
|
{
|
2011-08-18 00:57:21 +04:00
|
|
|
unsigned long flags;
|
|
|
|
unsigned long functions;
|
|
|
|
unsigned long decorations;
|
|
|
|
long inputMode;
|
|
|
|
unsigned long status;
|
2011-08-09 06:24:12 +04:00
|
|
|
};
|
|
|
|
typedef struct _PropMotifWmHints PropMotifWmHints;
|
|
|
|
|
2011-11-29 01:50:08 +04:00
|
|
|
/**
|
|
|
|
* Post an event from the client to the X server
|
|
|
|
*/
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_SendClientEvent(xfContext* xfc, xfWindow* window, Atom atom, unsigned int numArgs, ...)
|
2011-08-24 08:46:34 +04:00
|
|
|
{
|
2011-11-29 01:50:08 +04:00
|
|
|
XEvent xevent;
|
|
|
|
unsigned int i;
|
|
|
|
va_list argp;
|
|
|
|
|
|
|
|
va_start(argp, numArgs);
|
|
|
|
|
|
|
|
xevent.xclient.type = ClientMessage;
|
|
|
|
xevent.xclient.serial = 0;
|
2011-12-07 03:42:58 +04:00
|
|
|
xevent.xclient.send_event = False;
|
2013-06-13 02:57:25 +04:00
|
|
|
xevent.xclient.display = xfc->display;
|
2011-11-29 01:50:08 +04:00
|
|
|
xevent.xclient.window = window->handle;
|
|
|
|
xevent.xclient.message_type = atom;
|
|
|
|
xevent.xclient.format = 32;
|
|
|
|
|
|
|
|
for (i=0; i<numArgs; i++)
|
|
|
|
{
|
|
|
|
xevent.xclient.data.l[i] = va_arg(argp, int);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEBUG_X11("Send ClientMessage Event: wnd=0x%04X", (unsigned int) xevent.xclient.window);
|
2013-02-15 02:43:37 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XSendEvent(xfc->display, RootWindowOfScreen(xfc->screen), False,
|
2011-12-03 02:51:30 +04:00
|
|
|
SubstructureRedirectMask | SubstructureNotifyMask, &xevent);
|
2013-06-13 02:57:25 +04:00
|
|
|
XSync(xfc->display, False);
|
2011-11-29 01:50:08 +04:00
|
|
|
|
|
|
|
va_end(argp);
|
2011-08-24 08:46:34 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_SetWindowFullscreen(xfContext* xfc, xfWindow* window, BOOL fullscreen)
|
2011-08-09 06:24:12 +04:00
|
|
|
{
|
|
|
|
if (fullscreen)
|
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
rdpSettings* settings = xfc->instance->settings;
|
2013-04-29 02:48:27 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_SetWindowDecorations(xfc, window, FALSE);
|
2011-08-09 06:24:12 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XMoveResizeWindow(xfc->display, window->handle, settings->DesktopPosX, settings->DesktopPosY, window->width, window->height);
|
|
|
|
XMapRaised(xfc->display, window->handle);
|
2011-08-24 08:46:34 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
window->fullscreen = TRUE;
|
2011-08-09 06:24:12 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-17 22:13:44 +04:00
|
|
|
/* http://tronche.com/gui/x/xlib/window-information/XGetWindowProperty.html */
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
BOOL xf_GetWindowProperty(xfContext* xfc, Window window, Atom property, int length,
|
2012-10-09 11:01:37 +04:00
|
|
|
unsigned long* nitems, unsigned long* bytes, BYTE** prop)
|
2011-08-17 22:13:44 +04:00
|
|
|
{
|
|
|
|
int status;
|
|
|
|
Atom actual_type;
|
|
|
|
int actual_format;
|
|
|
|
|
|
|
|
if (property == None)
|
2012-10-09 10:31:28 +04:00
|
|
|
return FALSE;
|
2011-08-17 22:13:44 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
status = XGetWindowProperty(xfc->display, window,
|
2012-10-09 10:31:28 +04:00
|
|
|
property, 0, length, FALSE, AnyPropertyType,
|
2011-08-17 22:13:44 +04:00
|
|
|
&actual_type, &actual_format, nitems, bytes, prop);
|
|
|
|
|
|
|
|
if (status != Success)
|
2012-10-09 10:31:28 +04:00
|
|
|
return FALSE;
|
2011-08-17 22:13:44 +04:00
|
|
|
|
2011-10-17 17:39:06 +04:00
|
|
|
if (actual_type == None)
|
|
|
|
{
|
|
|
|
DEBUG_WARN("Property %lu does not exist", property);
|
2012-10-09 10:31:28 +04:00
|
|
|
return FALSE;
|
2011-10-17 17:39:06 +04:00
|
|
|
}
|
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-17 22:13:44 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
BOOL xf_GetCurrentDesktop(xfContext* xfc)
|
2011-08-17 22:13:44 +04:00
|
|
|
{
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL status;
|
2011-08-17 22:13:44 +04:00
|
|
|
unsigned long nitems;
|
|
|
|
unsigned long bytes;
|
|
|
|
unsigned char* prop;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_GetWindowProperty(xfc, DefaultRootWindow(xfc->display),
|
|
|
|
xfc->_NET_CURRENT_DESKTOP, 1, &nitems, &bytes, &prop);
|
2011-08-17 22:13:44 +04:00
|
|
|
|
2013-03-29 07:09:28 +04:00
|
|
|
if (!status)
|
2012-10-09 10:31:28 +04:00
|
|
|
return FALSE;
|
2011-08-17 22:13:44 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->current_desktop = (int) *prop;
|
2012-10-09 07:21:26 +04:00
|
|
|
free(prop);
|
2011-08-17 22:13:44 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-17 22:13:44 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
BOOL xf_GetWorkArea(xfContext* xfc)
|
2011-08-17 22:13:44 +04:00
|
|
|
{
|
|
|
|
long* plong;
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL status;
|
2011-08-17 22:13:44 +04:00
|
|
|
unsigned long nitems;
|
|
|
|
unsigned long bytes;
|
|
|
|
unsigned char* prop;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_GetCurrentDesktop(xfc);
|
2011-08-17 22:13:44 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
if (status != TRUE)
|
|
|
|
return FALSE;
|
2011-08-17 22:13:44 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_GetWindowProperty(xfc, DefaultRootWindow(xfc->display),
|
|
|
|
xfc->_NET_WORKAREA, 32 * 4, &nitems, &bytes, &prop);
|
2011-09-27 07:06:45 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
if (status != TRUE)
|
|
|
|
return FALSE;
|
2011-08-17 22:13:44 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if ((xfc->current_desktop * 4 + 3) >= nitems)
|
2013-02-15 02:43:37 +04:00
|
|
|
{
|
2012-10-09 07:21:26 +04:00
|
|
|
free(prop);
|
2012-10-09 10:31:28 +04:00
|
|
|
return FALSE;
|
2011-11-01 23:31:57 +04:00
|
|
|
}
|
|
|
|
|
2011-08-17 22:13:44 +04:00
|
|
|
plong = (long*) prop;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->workArea.x = plong[xfc->current_desktop * 4 + 0];
|
|
|
|
xfc->workArea.y = plong[xfc->current_desktop * 4 + 1];
|
|
|
|
xfc->workArea.width = plong[xfc->current_desktop * 4 + 2];
|
|
|
|
xfc->workArea.height = plong[xfc->current_desktop * 4 + 3];
|
2012-10-09 07:21:26 +04:00
|
|
|
free(prop);
|
2011-08-17 22:13:44 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-17 22:13:44 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_SetWindowDecorations(xfContext* xfc, xfWindow* window, BOOL show)
|
2011-08-09 06:24:12 +04:00
|
|
|
{
|
|
|
|
PropMotifWmHints hints;
|
|
|
|
|
2011-12-03 02:51:30 +04:00
|
|
|
hints.decorations = (show) ? MWM_DECOR_ALL : 0;
|
|
|
|
hints.functions = MWM_FUNC_ALL ;
|
|
|
|
hints.flags = MWM_HINTS_DECORATIONS | MWM_HINTS_FUNCTIONS;
|
2012-03-16 18:45:14 +04:00
|
|
|
hints.inputMode = 0;
|
|
|
|
hints.status = 0;
|
2011-08-09 06:24:12 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XChangeProperty(xfc->display, window->handle, xfc->_MOTIF_WM_HINTS, xfc->_MOTIF_WM_HINTS, 32,
|
2012-10-09 11:01:37 +04:00
|
|
|
PropModeReplace, (BYTE*) &hints, PROP_MOTIF_WM_HINTS_ELEMENTS);
|
2011-08-09 06:24:12 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_SetWindowUnlisted(xfContext* xfc, xfWindow* window)
|
2011-08-30 22:21:16 +04:00
|
|
|
{
|
|
|
|
Atom window_state[2];
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
window_state[0] = xfc->_NET_WM_STATE_SKIP_PAGER;
|
|
|
|
window_state[1] = xfc->_NET_WM_STATE_SKIP_TASKBAR;
|
2011-08-30 22:21:16 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XChangeProperty(xfc->display, window->handle, xfc->_NET_WM_STATE,
|
2012-10-09 11:01:37 +04:00
|
|
|
XA_ATOM, 32, PropModeReplace, (BYTE*) &window_state, 2);
|
2011-08-30 22:21:16 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_SetWindowStyle(xfContext* xfc, xfWindow* window, UINT32 style, UINT32 ex_style)
|
2011-08-25 01:16:57 +04:00
|
|
|
{
|
|
|
|
Atom window_type;
|
|
|
|
|
2012-08-04 02:35:17 +04:00
|
|
|
if (/*(ex_style & WS_EX_TOPMOST) ||*/ (ex_style & WS_EX_TOOLWINDOW))
|
2011-08-25 01:16:57 +04:00
|
|
|
{
|
2012-05-26 03:01:25 +04:00
|
|
|
/*
|
|
|
|
* Tooltips and menu items should be unmanaged windows
|
|
|
|
* (called "override redirect" in X windows parlance)
|
|
|
|
* If they are managed, there are issues with window focus that
|
|
|
|
* cause the windows to behave improperly. For example, a mouse
|
|
|
|
* press will dismiss a drop-down menu because the RDP server
|
|
|
|
* sees that as a focus out event from the window owning the
|
|
|
|
* dropdown.
|
|
|
|
*/
|
2012-05-25 20:00:13 +04:00
|
|
|
XSetWindowAttributes attrs;
|
|
|
|
attrs.override_redirect = True;
|
2013-06-13 02:57:25 +04:00
|
|
|
XChangeWindowAttributes(xfc->display, window->handle, CWOverrideRedirect, &attrs);
|
2012-05-25 20:00:13 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
window->is_transient = TRUE;
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_SetWindowUnlisted(xfc, window);
|
|
|
|
window_type = xfc->_NET_WM_WINDOW_TYPE_POPUP;
|
2011-08-25 01:16:57 +04:00
|
|
|
}
|
2012-09-03 00:34:06 +04:00
|
|
|
/*
|
|
|
|
* TOPMOST window that is not a toolwindow is treated like a regular window(ie. task manager).
|
|
|
|
* Want to do this here, since the window may have type WS_POPUP
|
|
|
|
*/
|
2012-08-04 02:35:17 +04:00
|
|
|
else if (ex_style & WS_EX_TOPMOST)
|
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
window_type = xfc->_NET_WM_WINDOW_TYPE_NORMAL;
|
2012-08-04 02:35:17 +04:00
|
|
|
}
|
2011-12-07 04:39:08 +04:00
|
|
|
else if (style & WS_POPUP)
|
|
|
|
{
|
2011-12-10 03:20:23 +04:00
|
|
|
/* this includes dialogs, popups, etc, that need to be full-fledged windows */
|
2012-10-09 10:31:28 +04:00
|
|
|
window->is_transient = TRUE;
|
2013-06-13 02:57:25 +04:00
|
|
|
window_type = xfc->_NET_WM_WINDOW_TYPE_DIALOG;
|
|
|
|
xf_SetWindowUnlisted(xfc, window);
|
2011-12-07 04:39:08 +04:00
|
|
|
}
|
2011-12-03 02:51:30 +04:00
|
|
|
else
|
2011-08-25 01:16:57 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
window_type = xfc->_NET_WM_WINDOW_TYPE_NORMAL;
|
2011-08-25 01:16:57 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XChangeProperty(xfc->display, window->handle, xfc->_NET_WM_WINDOW_TYPE,
|
2012-10-09 11:01:37 +04:00
|
|
|
XA_ATOM, 32, PropModeReplace, (BYTE*) &window_type, 1);
|
2011-12-03 02:51:30 +04:00
|
|
|
|
2011-08-25 01:16:57 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_SetWindowText(xfContext* xfc, xfWindow* window, char *name)
|
2012-05-08 00:07:34 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
XStoreName(xfc->display, window->handle, name);
|
2012-05-08 00:07:34 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
static void xf_SetWindowPID(xfContext* xfc, xfWindow* window, pid_t pid)
|
2012-07-09 10:52:15 +04:00
|
|
|
{
|
|
|
|
Atom am_wm_pid;
|
|
|
|
|
2013-04-09 01:03:21 +04:00
|
|
|
if (!pid)
|
2012-07-09 10:52:15 +04:00
|
|
|
pid = getpid();
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
am_wm_pid = XInternAtom(xfc->display, "_NET_WM_PID", False);
|
2012-07-09 10:52:15 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XChangeProperty(xfc->display, window->handle, am_wm_pid, XA_CARDINAL,
|
2012-07-09 10:52:15 +04:00
|
|
|
32, PropModeReplace, (unsigned char *)&pid, 1);
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xfWindow* xf_CreateDesktopWindow(xfContext* xfc, char* name, int width, int height, BOOL decorations)
|
2011-08-09 06:24:12 +04:00
|
|
|
{
|
|
|
|
xfWindow* window;
|
2012-05-04 22:00:28 +04:00
|
|
|
XEvent xevent;
|
2013-04-29 00:27:23 +04:00
|
|
|
rdpSettings* settings;
|
2011-08-09 06:24:12 +04:00
|
|
|
|
2012-11-20 08:49:08 +04:00
|
|
|
window = (xfWindow*) malloc(sizeof(xfWindow));
|
|
|
|
ZeroMemory(window, sizeof(xfWindow));
|
2013-06-13 02:57:25 +04:00
|
|
|
settings = xfc->instance->settings;
|
2011-08-09 06:24:12 +04:00
|
|
|
|
2013-04-09 01:03:21 +04:00
|
|
|
if (window)
|
2011-08-09 06:24:12 +04:00
|
|
|
{
|
2012-09-03 00:34:06 +04:00
|
|
|
int shmid;
|
2011-08-09 06:24:12 +04:00
|
|
|
int input_mask;
|
|
|
|
XClassHint* class_hints;
|
|
|
|
|
2011-08-24 08:46:34 +04:00
|
|
|
window->width = width;
|
|
|
|
window->height = height;
|
2012-10-09 10:31:28 +04:00
|
|
|
window->fullscreen = FALSE;
|
2011-10-07 23:50:07 +04:00
|
|
|
window->decorations = decorations;
|
2011-12-03 02:51:30 +04:00
|
|
|
window->local_move.state = LMS_NOT_ACTIVE;
|
2012-10-09 10:31:28 +04:00
|
|
|
window->is_mapped = FALSE;
|
|
|
|
window->is_transient = FALSE;
|
2011-08-09 06:24:12 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
window->handle = XCreateWindow(xfc->display, RootWindowOfScreen(xfc->screen),
|
|
|
|
xfc->workArea.x, xfc->workArea.y, xfc->workArea.width, xfc->workArea.height, 0, xfc->depth, InputOutput, xfc->visual,
|
2011-12-03 02:51:30 +04:00
|
|
|
CWBackPixel | CWBackingStore | CWOverrideRedirect | CWColormap |
|
2013-06-13 02:57:25 +04:00
|
|
|
CWBorderPixel | CWWinGravity | CWBitGravity, &xfc->attribs);
|
2011-08-09 06:24:12 +04:00
|
|
|
|
2012-09-03 00:34:06 +04:00
|
|
|
shmid = shmget(SHARED_MEM_KEY, sizeof(int), IPC_CREAT | 0666);
|
|
|
|
|
2012-06-13 23:45:58 +04:00
|
|
|
if (shmid < 0)
|
|
|
|
{
|
|
|
|
DEBUG_X11("xf_CreateDesktopWindow: failed to get access to shared memory - shmget()\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-09-03 00:34:06 +04:00
|
|
|
int* xfwin = shmat(shmid, NULL, 0);
|
|
|
|
|
|
|
|
if (xfwin == (int*) -1)
|
2012-06-13 23:45:58 +04:00
|
|
|
{
|
|
|
|
DEBUG_X11("xf_CreateDesktopWindow: failed to assign pointer to the memory address - shmat()\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-09-03 00:34:06 +04:00
|
|
|
*xfwin = (int) window->handle;
|
2012-06-13 23:45:58 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-09 06:24:12 +04:00
|
|
|
class_hints = XAllocClassHint();
|
|
|
|
|
2013-04-09 01:03:21 +04:00
|
|
|
if (class_hints)
|
2011-08-09 06:24:12 +04:00
|
|
|
{
|
2011-09-14 06:20:04 +04:00
|
|
|
class_hints->res_name = "xfreerdp";
|
2013-04-09 01:03:21 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (xfc->instance->settings->WmClass)
|
|
|
|
class_hints->res_class = xfc->instance->settings->WmClass;
|
2013-03-26 18:47:39 +04:00
|
|
|
else
|
|
|
|
class_hints->res_class = "xfreerdp";
|
2013-04-09 01:03:21 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XSetClassHint(xfc->display, window->handle, class_hints);
|
2011-08-09 06:24:12 +04:00
|
|
|
XFree(class_hints);
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_ResizeDesktopWindow(xfc, window, width, height);
|
|
|
|
xf_SetWindowDecorations(xfc, window, decorations);
|
|
|
|
xf_SetWindowPID(xfc, window, 0);
|
2011-08-09 06:24:12 +04:00
|
|
|
|
|
|
|
input_mask =
|
|
|
|
KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
|
|
|
|
VisibilityChangeMask | FocusChangeMask | StructureNotifyMask |
|
2011-10-05 02:46:49 +04:00
|
|
|
PointerMotionMask | ExposureMask | PropertyChangeMask;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (xfc->grab_keyboard)
|
2011-10-05 02:46:49 +04:00
|
|
|
input_mask |= EnterWindowMask | LeaveWindowMask;
|
2011-08-09 06:24:12 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XChangeProperty(xfc->display, window->handle, xfc->_NET_WM_ICON, XA_CARDINAL, 32,
|
2012-11-22 05:50:28 +04:00
|
|
|
PropModeReplace, (BYTE*) xf_icon_prop, ARRAYSIZE(xf_icon_prop));
|
2011-10-22 20:55:03 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (xfc->settings->ParentWindowId)
|
|
|
|
XReparentWindow(xfc->display, window->handle, (Window) xfc->settings->ParentWindowId, 0, 0);
|
2012-05-04 22:00:28 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XSelectInput(xfc->display, window->handle, input_mask);
|
|
|
|
XClearWindow(xfc->display, window->handle);
|
|
|
|
XMapWindow(xfc->display, window->handle);
|
2012-05-04 22:00:28 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_input_init(xfc, window->handle);
|
2012-05-04 22:00:28 +04:00
|
|
|
|
2012-05-26 03:01:25 +04:00
|
|
|
/*
|
|
|
|
* NOTE: This must be done here to handle reparenting the window,
|
2013-04-09 01:03:21 +04:00
|
|
|
* so that we don't miss the event and hang waiting for the next one
|
2012-05-26 03:01:25 +04:00
|
|
|
*/
|
2012-05-04 22:00:28 +04:00
|
|
|
do
|
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
XMaskEvent(xfc->display, VisibilityChangeMask, &xevent);
|
2012-05-04 22:00:28 +04:00
|
|
|
}
|
|
|
|
while (xevent.type != VisibilityNotify);
|
2012-08-04 02:35:17 +04:00
|
|
|
|
2012-09-03 00:34:06 +04:00
|
|
|
/*
|
|
|
|
* The XCreateWindow call will start the window in the upper-left corner of our current
|
|
|
|
* monitor instead of the upper-left monitor for remote app mode(which uses all monitors).
|
|
|
|
* This extra call after the window is mapped will position the login window correctly
|
|
|
|
*/
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (xfc->instance->settings->RemoteApplicationMode)
|
2013-04-29 02:48:27 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
XMoveWindow(xfc->display, window->handle, 0, 0);
|
2013-04-29 02:48:27 +04:00
|
|
|
}
|
2013-04-29 00:27:23 +04:00
|
|
|
else if (settings->DesktopPosX || settings->DesktopPosY)
|
2013-04-29 02:48:27 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
XMoveWindow(xfc->display, window->handle, settings->DesktopPosX, settings->DesktopPosY);
|
2013-04-29 02:48:27 +04:00
|
|
|
}
|
2011-08-09 06:24:12 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_SetWindowText(xfc, window, name);
|
2012-05-08 00:07:34 +04:00
|
|
|
|
2011-08-09 06:24:12 +04:00
|
|
|
return window;
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_ResizeDesktopWindow(xfContext* xfc, xfWindow* window, int width, int height)
|
2011-09-06 12:22:53 +04:00
|
|
|
{
|
|
|
|
XSizeHints* size_hints;
|
|
|
|
|
|
|
|
size_hints = XAllocSizeHints();
|
|
|
|
|
|
|
|
if (size_hints)
|
|
|
|
{
|
|
|
|
size_hints->flags = PMinSize | PMaxSize;
|
2013-06-13 02:57:25 +04:00
|
|
|
size_hints->min_width = size_hints->max_width = xfc->width;
|
|
|
|
size_hints->min_height = size_hints->max_height = xfc->height;
|
|
|
|
XSetWMNormalHints(xfc->display, window->handle, size_hints);
|
|
|
|
XResizeWindow(xfc->display, window->handle, xfc->width, xfc->height);
|
2011-09-06 12:22:53 +04:00
|
|
|
XFree(size_hints);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_FixWindowCoordinates(xfContext* xfc, int* x, int* y, int* width, int* height)
|
2011-08-23 05:22:05 +04:00
|
|
|
{
|
2011-09-02 21:29:17 +04:00
|
|
|
int vscreen_width;
|
|
|
|
int vscreen_height;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
vscreen_width = xfc->vscreen.area.right - xfc->vscreen.area.left + 1;
|
|
|
|
vscreen_height = xfc->vscreen.area.bottom - xfc->vscreen.area.top + 1;
|
2011-09-02 21:29:17 +04:00
|
|
|
|
2011-10-31 21:55:05 +04:00
|
|
|
if (*width < 1)
|
|
|
|
{
|
|
|
|
*width = 1;
|
|
|
|
}
|
|
|
|
if (*height < 1)
|
|
|
|
{
|
|
|
|
*height = 1;
|
|
|
|
}
|
2013-06-13 02:57:25 +04:00
|
|
|
if (*x < xfc->vscreen.area.left)
|
2011-08-23 05:22:05 +04:00
|
|
|
{
|
|
|
|
*width += *x;
|
2013-06-13 02:57:25 +04:00
|
|
|
*x = xfc->vscreen.area.left;
|
2011-08-23 05:22:05 +04:00
|
|
|
}
|
2013-06-13 02:57:25 +04:00
|
|
|
if (*y < xfc->vscreen.area.top)
|
2011-08-23 05:22:05 +04:00
|
|
|
{
|
|
|
|
*height += *y;
|
2013-06-13 02:57:25 +04:00
|
|
|
*y = xfc->vscreen.area.top;
|
2011-09-02 21:29:17 +04:00
|
|
|
}
|
|
|
|
if (*width > vscreen_width)
|
|
|
|
{
|
|
|
|
*width = vscreen_width;
|
|
|
|
}
|
|
|
|
if (*height > vscreen_height)
|
|
|
|
{
|
|
|
|
*height = vscreen_height;
|
2011-08-23 05:22:05 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-22 07:54:02 +04:00
|
|
|
char rail_window_class[] = "RAIL:00000000";
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xfWindow* xf_CreateWindow(xfContext* xfc, rdpWindow* wnd, int x, int y, int width, int height, UINT32 id)
|
2011-08-17 10:14:02 +04:00
|
|
|
{
|
2012-09-03 00:34:06 +04:00
|
|
|
XGCValues gcv;
|
|
|
|
int input_mask;
|
2011-08-17 10:14:02 +04:00
|
|
|
xfWindow* window;
|
2012-09-03 00:34:06 +04:00
|
|
|
XWMHints* InputModeHint;
|
|
|
|
XClassHint* class_hints;
|
2011-08-17 10:14:02 +04:00
|
|
|
|
2012-11-20 08:49:08 +04:00
|
|
|
window = (xfWindow*) malloc(sizeof(xfWindow));
|
|
|
|
ZeroMemory(window, sizeof(xfWindow));
|
2011-08-17 10:14:02 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_FixWindowCoordinates(xfc, &x, &y, &width, &height);
|
2011-08-23 05:22:05 +04:00
|
|
|
|
|
|
|
window->left = x;
|
|
|
|
window->top = y;
|
|
|
|
window->right = x + width - 1;
|
|
|
|
window->bottom = y + height - 1;
|
2011-08-17 10:14:02 +04:00
|
|
|
window->width = width;
|
|
|
|
window->height = height;
|
|
|
|
|
2013-03-29 07:09:28 +04:00
|
|
|
/*
|
2013-03-29 07:47:39 +04:00
|
|
|
* WS_EX_DECORATIONS is used by XRDP and instructs
|
|
|
|
* the client to use local window decorations
|
2013-03-29 07:09:28 +04:00
|
|
|
*/
|
|
|
|
|
2013-03-29 07:47:39 +04:00
|
|
|
window->decorations = (wnd->extendedStyle & WS_EX_DECORATIONS) ? TRUE : FALSE;
|
2013-03-29 07:09:28 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
window->fullscreen = FALSE;
|
2011-10-31 21:55:05 +04:00
|
|
|
window->window = wnd;
|
2011-12-03 02:51:30 +04:00
|
|
|
window->local_move.state = LMS_NOT_ACTIVE;
|
2012-10-09 10:31:28 +04:00
|
|
|
window->is_mapped = FALSE;
|
|
|
|
window->is_transient = FALSE;
|
2012-08-04 02:35:17 +04:00
|
|
|
window->rail_state = 0;
|
2012-10-09 10:31:28 +04:00
|
|
|
window->rail_ignore_configure = FALSE;
|
2011-12-03 02:51:30 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
window->handle = XCreateWindow(xfc->display, RootWindowOfScreen(xfc->screen),
|
|
|
|
x, y, window->width, window->height, 0, xfc->depth, InputOutput, xfc->visual,
|
2011-12-03 02:51:30 +04:00
|
|
|
CWBackPixel | CWBackingStore | CWOverrideRedirect | CWColormap |
|
2013-06-13 02:57:25 +04:00
|
|
|
CWBorderPixel | CWWinGravity | CWBitGravity, &xfc->attribs);
|
2011-12-03 02:51:30 +04:00
|
|
|
|
2012-09-03 00:34:06 +04:00
|
|
|
DEBUG_X11_LMS("Create window=0x%X rc={l=%d t=%d r=%d b=%d} w=%d h=%d rdp=0x%X",
|
2012-10-09 11:26:39 +04:00
|
|
|
(UINT32) window->handle, window->left, window->top, window->right, window->bottom,
|
2011-12-03 02:51:30 +04:00
|
|
|
window->width, window->height, wnd->windowId);
|
2011-08-17 10:14:02 +04:00
|
|
|
|
2013-02-15 02:43:37 +04:00
|
|
|
ZeroMemory(&gcv, sizeof(gcv));
|
2013-06-13 02:57:25 +04:00
|
|
|
window->gc = XCreateGC(xfc->display, window->handle, GCGraphicsExposures, &gcv);
|
2011-08-17 10:14:02 +04:00
|
|
|
|
2011-10-31 21:55:05 +04:00
|
|
|
class_hints = XAllocClassHint();
|
2011-08-17 10:14:02 +04:00
|
|
|
|
2013-03-29 07:34:26 +04:00
|
|
|
if (class_hints)
|
2011-10-31 21:55:05 +04:00
|
|
|
{
|
2013-03-26 18:47:39 +04:00
|
|
|
char* class = NULL;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (xfc->instance->settings->WmClass != NULL)
|
2013-03-29 07:34:26 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
class_hints->res_class = xfc->instance->settings->WmClass;
|
2013-03-29 07:34:26 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-03-26 18:47:39 +04:00
|
|
|
class = malloc(sizeof(rail_window_class));
|
|
|
|
snprintf(class, sizeof(rail_window_class), "RAIL:%08X", id);
|
|
|
|
class_hints->res_class = class;
|
|
|
|
}
|
|
|
|
|
2011-10-31 21:55:05 +04:00
|
|
|
class_hints->res_name = "RAIL";
|
2013-06-13 02:57:25 +04:00
|
|
|
XSetClassHint(xfc->display, window->handle, class_hints);
|
2011-10-31 21:55:05 +04:00
|
|
|
XFree(class_hints);
|
2013-03-26 18:47:39 +04:00
|
|
|
|
|
|
|
if (class)
|
|
|
|
free(class);
|
2011-10-31 21:55:05 +04:00
|
|
|
}
|
2011-08-17 10:14:02 +04:00
|
|
|
|
2012-09-03 00:34:06 +04:00
|
|
|
/* Set the input mode hint for the WM */
|
|
|
|
InputModeHint = XAllocWMHints();
|
2012-08-04 02:35:17 +04:00
|
|
|
InputModeHint->flags = (1L << 0);
|
|
|
|
InputModeHint->input = True;
|
2013-06-13 02:57:25 +04:00
|
|
|
XSetWMHints(xfc->display, window->handle, InputModeHint);
|
2012-08-04 02:35:17 +04:00
|
|
|
XFree(InputModeHint);
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XSetWMProtocols(xfc->display, window->handle, &(xfc->WM_DELETE_WINDOW), 1);
|
2011-09-21 16:36:49 +04:00
|
|
|
|
2011-12-03 02:51:30 +04:00
|
|
|
input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask |
|
|
|
|
ButtonReleaseMask | EnterWindowMask | LeaveWindowMask |
|
|
|
|
PointerMotionMask | Button1MotionMask | Button2MotionMask |
|
|
|
|
Button3MotionMask | Button4MotionMask | Button5MotionMask |
|
|
|
|
ButtonMotionMask | KeymapStateMask | ExposureMask |
|
|
|
|
VisibilityChangeMask | StructureNotifyMask | SubstructureNotifyMask |
|
|
|
|
SubstructureRedirectMask | FocusChangeMask | PropertyChangeMask |
|
|
|
|
ColormapChangeMask | OwnerGrabButtonMask;
|
2011-08-17 10:14:02 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XSelectInput(xfc->display, window->handle, input_mask);
|
2011-08-17 10:14:02 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_SetWindowDecorations(xfc, window, window->decorations);
|
|
|
|
xf_SetWindowStyle(xfc, window, wnd->style, wnd->extendedStyle);
|
|
|
|
xf_SetWindowPID(xfc, window, 0);
|
|
|
|
xf_ShowWindow(xfc, window, WINDOW_SHOW);
|
2012-05-22 01:43:26 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XClearWindow(xfc->display, window->handle);
|
|
|
|
XMapWindow(xfc->display, window->handle);
|
2011-08-17 22:51:17 +04:00
|
|
|
|
2012-05-26 03:01:25 +04:00
|
|
|
/* Move doesn't seem to work until window is mapped. */
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_MoveWindow(xfc, window, x, y, width, height);
|
2011-08-17 10:14:02 +04:00
|
|
|
|
|
|
|
return window;
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_SetWindowMinMaxInfo(xfContext* xfc, xfWindow* window,
|
2011-09-02 21:29:17 +04:00
|
|
|
int maxWidth, int maxHeight, int maxPosX, int maxPosY,
|
|
|
|
int minTrackWidth, int minTrackHeight, int maxTrackWidth, int maxTrackHeight)
|
2011-09-01 02:02:22 +04:00
|
|
|
{
|
2011-09-02 02:08:53 +04:00
|
|
|
XSizeHints* size_hints;
|
|
|
|
|
|
|
|
size_hints = XAllocSizeHints();
|
|
|
|
|
|
|
|
if (size_hints)
|
|
|
|
{
|
|
|
|
size_hints->flags = PMinSize | PMaxSize | PResizeInc;
|
|
|
|
|
|
|
|
size_hints->min_width = minTrackWidth;
|
|
|
|
size_hints->min_height = minTrackHeight;
|
|
|
|
|
|
|
|
size_hints->max_width = maxTrackWidth;
|
|
|
|
size_hints->max_height = maxTrackHeight;
|
|
|
|
|
2011-09-02 20:39:56 +04:00
|
|
|
/* to speedup window drawing we need to select optimal value for sizing step. */
|
2011-09-04 00:38:01 +04:00
|
|
|
size_hints->width_inc = size_hints->height_inc = 1;
|
2011-09-02 02:08:53 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XSetWMNormalHints(xfc->display, window->handle, size_hints);
|
2011-09-02 02:08:53 +04:00
|
|
|
XFree(size_hints);
|
|
|
|
}
|
2011-09-01 02:02:22 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_StartLocalMoveSize(xfContext* xfc, xfWindow* window, int direction, int x, int y)
|
2011-09-01 02:22:21 +04:00
|
|
|
{
|
2011-12-17 01:09:21 +04:00
|
|
|
if (window->local_move.state != LMS_NOT_ACTIVE)
|
|
|
|
return;
|
2011-12-10 03:20:23 +04:00
|
|
|
|
2011-12-03 02:51:30 +04:00
|
|
|
DEBUG_X11_LMS("direction=%d window=0x%X rc={l=%d t=%d r=%d b=%d} w=%d h=%d "
|
|
|
|
"RDP=0x%X rc={l=%d t=%d} w=%d h=%d mouse_x=%d mouse_y=%d",
|
2012-10-09 11:26:39 +04:00
|
|
|
direction, (UINT32) window->handle,
|
2011-12-03 02:51:30 +04:00
|
|
|
window->left, window->top, window->right, window->bottom,
|
2011-12-17 01:09:21 +04:00
|
|
|
window->width, window->height, window->window->windowId,
|
|
|
|
window->window->windowOffsetX, window->window->windowOffsetY,
|
|
|
|
window->window->windowWidth, window->window->windowHeight, x, y);
|
2011-12-03 02:51:30 +04:00
|
|
|
|
2012-05-26 02:37:38 +04:00
|
|
|
/*
|
|
|
|
* Save original mouse location relative to root. This will be needed
|
|
|
|
* to end local move to RDP server and/or X server
|
|
|
|
*/
|
2011-12-03 02:51:30 +04:00
|
|
|
window->local_move.root_x = x;
|
|
|
|
window->local_move.root_y = y;
|
2011-12-07 03:42:58 +04:00
|
|
|
window->local_move.state = LMS_STARTING;
|
2012-08-04 02:35:17 +04:00
|
|
|
window->local_move.direction = direction;
|
2011-12-03 02:51:30 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XUngrabPointer(xfc->display, CurrentTime);
|
2011-12-10 03:20:23 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_SendClientEvent(xfc, window,
|
|
|
|
xfc->_NET_WM_MOVERESIZE, /* request X window manager to initiate a local move */
|
2011-12-10 03:20:23 +04:00
|
|
|
5, /* 5 arguments to follow */
|
|
|
|
x, /* x relative to root window */
|
|
|
|
y, /* y relative to root window */
|
|
|
|
direction, /* extended ICCM direction flag */
|
|
|
|
1, /* simulated mouse button 1 */
|
|
|
|
1); /* 1 == application request per extended ICCM */
|
2011-09-01 02:22:21 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_EndLocalMoveSize(xfContext* xfc, xfWindow *window)
|
2011-09-01 02:02:22 +04:00
|
|
|
{
|
|
|
|
|
2011-12-17 01:09:21 +04:00
|
|
|
DEBUG_X11_LMS("state=%d window=0x%X rc={l=%d t=%d r=%d b=%d} w=%d h=%d "
|
2011-12-03 02:51:30 +04:00
|
|
|
"RDP=0x%X rc={l=%d t=%d} w=%d h=%d",
|
2011-12-17 01:09:21 +04:00
|
|
|
window->local_move.state,
|
2012-10-09 11:26:39 +04:00
|
|
|
(UINT32) window->handle, window->left, window->top, window->right, window->bottom,
|
2011-12-17 01:09:21 +04:00
|
|
|
window->width, window->height, window->window->windowId,
|
|
|
|
window->window->windowOffsetX, window->window->windowOffsetY,
|
|
|
|
window->window->windowWidth, window->window->windowHeight);
|
2011-12-03 02:51:30 +04:00
|
|
|
|
|
|
|
if (window->local_move.state == LMS_NOT_ACTIVE)
|
2011-11-29 01:50:08 +04:00
|
|
|
return;
|
|
|
|
|
2011-12-17 01:09:21 +04:00
|
|
|
if (window->local_move.state == LMS_STARTING)
|
2011-11-29 01:50:08 +04:00
|
|
|
{
|
2011-12-10 03:20:23 +04:00
|
|
|
/*
|
2011-12-17 01:09:21 +04:00
|
|
|
* The move never was property started. This can happen due to race
|
|
|
|
* conditions between the mouse button up and the communications to the
|
|
|
|
* RDP server for local moves. We must cancel the X window manager move.
|
|
|
|
* Per ICCM, the X client can ask to cancel an active move.
|
2011-12-10 03:20:23 +04:00
|
|
|
*/
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_SendClientEvent(xfc, window,
|
|
|
|
xfc->_NET_WM_MOVERESIZE, /* request X window manager to abort a local move */
|
2011-12-10 03:20:23 +04:00
|
|
|
5, /* 5 arguments to follow */
|
|
|
|
window->local_move.root_x, /* x relative to root window */
|
|
|
|
window->local_move.root_y, /* y relative to root window */
|
|
|
|
_NET_WM_MOVERESIZE_CANCEL, /* extended ICCM direction flag */
|
|
|
|
1, /* simulated mouse button 1 */
|
|
|
|
1); /* 1 == application request per extended ICCM */
|
2011-11-29 01:50:08 +04:00
|
|
|
}
|
|
|
|
|
2011-12-03 02:51:30 +04:00
|
|
|
window->local_move.state = LMS_NOT_ACTIVE;
|
2011-09-01 02:02:22 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_MoveWindow(xfContext* xfc, xfWindow* window, int x, int y, int width, int height)
|
2011-08-18 06:50:49 +04:00
|
|
|
{
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL resize = FALSE;
|
2011-12-10 03:20:23 +04:00
|
|
|
|
2011-08-20 06:21:09 +04:00
|
|
|
if ((width * height) < 1)
|
|
|
|
return;
|
|
|
|
|
2011-09-23 05:23:01 +04:00
|
|
|
if ((window->width != width) || (window->height != height))
|
2012-10-09 10:31:28 +04:00
|
|
|
resize = TRUE;
|
2011-09-02 02:08:53 +04:00
|
|
|
|
2011-12-17 01:09:21 +04:00
|
|
|
if (window->local_move.state == LMS_STARTING ||
|
|
|
|
window->local_move.state == LMS_ACTIVE)
|
|
|
|
return;
|
|
|
|
|
|
|
|
DEBUG_X11_LMS("window=0x%X rc={l=%d t=%d r=%d b=%d} w=%u h=%u "
|
2011-12-03 02:51:30 +04:00
|
|
|
"new rc={l=%d t=%d r=%d b=%d} w=%u h=%u"
|
|
|
|
" RDP=0x%X rc={l=%d t=%d} w=%d h=%d",
|
2012-10-09 11:26:39 +04:00
|
|
|
(UINT32) window->handle, window->left, window->top,
|
2011-12-03 02:51:30 +04:00
|
|
|
window->right, window->bottom, window->width, window->height,
|
2011-12-17 01:09:21 +04:00
|
|
|
x, y, x + width -1, y + height -1, width, height,
|
|
|
|
window->window->windowId,
|
|
|
|
window->window->windowOffsetX, window->window->windowOffsetY,
|
|
|
|
window->window->windowWidth, window->window->windowHeight);
|
2011-12-03 02:51:30 +04:00
|
|
|
|
2011-08-23 05:22:05 +04:00
|
|
|
window->left = x;
|
|
|
|
window->top = y;
|
|
|
|
window->right = x + width - 1;
|
|
|
|
window->bottom = y + height - 1;
|
2011-08-19 19:12:30 +04:00
|
|
|
window->width = width;
|
|
|
|
window->height = height;
|
2011-09-04 00:38:01 +04:00
|
|
|
|
2011-12-07 03:42:58 +04:00
|
|
|
if (resize)
|
2013-06-13 02:57:25 +04:00
|
|
|
XMoveResizeWindow(xfc->display, window->handle, x, y, width, height);
|
2011-12-07 03:42:58 +04:00
|
|
|
else
|
2013-06-13 02:57:25 +04:00
|
|
|
XMoveWindow(xfc->display, window->handle, x, y);
|
2011-12-17 01:09:21 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_UpdateWindowArea(xfc, window, 0, 0, width, height);
|
2011-08-18 06:50:49 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_ShowWindow(xfContext* xfc, xfWindow* window, BYTE state)
|
2011-08-22 07:15:19 +04:00
|
|
|
{
|
|
|
|
switch (state)
|
|
|
|
{
|
|
|
|
case WINDOW_HIDE:
|
2013-06-13 02:57:25 +04:00
|
|
|
XWithdrawWindow(xfc->display, window->handle, xfc->screen_number);
|
2011-08-22 07:15:19 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case WINDOW_SHOW_MINIMIZED:
|
2013-06-13 02:57:25 +04:00
|
|
|
XIconifyWindow(xfc->display, window->handle, xfc->screen_number);
|
2011-08-22 07:15:19 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case WINDOW_SHOW_MAXIMIZED:
|
2012-09-03 00:34:06 +04:00
|
|
|
/* Set the window as maximized */
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_SendClientEvent(xfc, window, xfc->_NET_WM_STATE, 4, 1,
|
|
|
|
XInternAtom(xfc->display, "_NET_WM_STATE_MAXIMIZED_VERT", False),
|
|
|
|
XInternAtom(xfc->display, "_NET_WM_STATE_MAXIMIZED_HORZ", False), 0);
|
2012-08-04 02:35:17 +04:00
|
|
|
|
2012-09-03 00:34:06 +04:00
|
|
|
/*
|
|
|
|
* This is a workaround for the case where the window is maximized locally before the rail server is told to maximize
|
|
|
|
* the window, this appears to be a race condition where the local window with incomplete data and once the window is
|
|
|
|
* actually maximized on the server - an update of the new areas may not happen. So, we simply to do a full update of
|
|
|
|
* the entire window once the rail server notifies us that the window is now maximized.
|
|
|
|
*/
|
|
|
|
|
2012-08-04 02:35:17 +04:00
|
|
|
if (window->rail_state == WINDOW_SHOW_MAXIMIZED)
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_UpdateWindowArea(xfc, window, 0, 0, window->window->windowWidth, window->window->windowHeight);
|
2011-08-22 07:15:19 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case WINDOW_SHOW:
|
2012-09-03 00:34:06 +04:00
|
|
|
/* Ensure the window is not maximized */
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_SendClientEvent(xfc, window, xfc->_NET_WM_STATE, 4, 0,
|
|
|
|
XInternAtom(xfc->display, "_NET_WM_STATE_MAXIMIZED_VERT", False),
|
|
|
|
XInternAtom(xfc->display, "_NET_WM_STATE_MAXIMIZED_HORZ", False), 0);
|
2012-08-04 02:35:17 +04:00
|
|
|
|
2012-09-03 00:34:06 +04:00
|
|
|
/*
|
|
|
|
* Ignore configure requests until both the Maximized properties have been processed
|
|
|
|
* to prevent condition where WM overrides size of request due to one or both of these properties
|
|
|
|
* still being set - which causes a position adjustment to be sent back to the server
|
|
|
|
* thus causing the window to not return to its original size
|
|
|
|
*/
|
|
|
|
|
2012-08-04 02:35:17 +04:00
|
|
|
if (window->rail_state == WINDOW_SHOW_MAXIMIZED)
|
2012-10-09 10:31:28 +04:00
|
|
|
window->rail_ignore_configure = TRUE;
|
2012-08-04 02:35:17 +04:00
|
|
|
|
2012-05-22 01:43:26 +04:00
|
|
|
if (window->is_transient)
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_SetWindowUnlisted(xfc, window);
|
2013-03-29 07:34:26 +04:00
|
|
|
|
2011-08-22 07:15:19 +04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2012-09-03 00:34:06 +04:00
|
|
|
/* Save the current rail state of this window */
|
2012-08-04 02:35:17 +04:00
|
|
|
window->rail_state = state;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XFlush(xfc->display);
|
2011-08-22 07:15:19 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_SetWindowIcon(xfContext* xfc, xfWindow* window, rdpIcon* icon)
|
2011-08-22 01:32:18 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
|
|
|
int pixels;
|
|
|
|
int propsize;
|
|
|
|
long* propdata;
|
|
|
|
long* dstp;
|
2012-10-09 11:26:39 +04:00
|
|
|
UINT32* srcp;
|
2011-08-22 01:32:18 +04:00
|
|
|
|
2013-03-29 07:34:26 +04:00
|
|
|
if (!icon->big)
|
2011-08-22 01:32:18 +04:00
|
|
|
return;
|
|
|
|
|
|
|
|
pixels = icon->entry->width * icon->entry->height;
|
|
|
|
propsize = 2 + pixels;
|
2012-10-09 07:21:26 +04:00
|
|
|
propdata = malloc(propsize * sizeof(long));
|
2011-08-22 01:32:18 +04:00
|
|
|
|
|
|
|
propdata[0] = icon->entry->width;
|
|
|
|
propdata[1] = icon->entry->height;
|
|
|
|
dstp = &(propdata[2]);
|
2012-10-09 11:26:39 +04:00
|
|
|
srcp = (UINT32*) icon->extra;
|
2011-08-22 01:32:18 +04:00
|
|
|
|
|
|
|
for (y = 0; y < icon->entry->height; y++)
|
|
|
|
{
|
|
|
|
for (x = 0; x < icon->entry->width; x++)
|
|
|
|
{
|
|
|
|
*dstp++ = *srcp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XChangeProperty(xfc->display, window->handle, xfc->_NET_WM_ICON, XA_CARDINAL, 32,
|
2012-10-09 11:01:37 +04:00
|
|
|
PropModeReplace, (BYTE*) propdata, propsize);
|
2011-08-22 01:32:18 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XFlush(xfc->display);
|
2013-08-29 17:30:22 +04:00
|
|
|
free(propdata);
|
2011-08-22 01:32:18 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_SetWindowRects(xfContext* xfc, xfWindow* window, RECTANGLE_16* rects, int nrects)
|
2011-08-23 00:06:12 +04:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
XRectangle* xrects;
|
|
|
|
|
2012-05-15 19:21:01 +04:00
|
|
|
if (nrects == 0)
|
|
|
|
return;
|
|
|
|
|
2012-10-09 07:21:26 +04:00
|
|
|
xrects = malloc(sizeof(XRectangle) * nrects);
|
2011-08-23 00:06:12 +04:00
|
|
|
|
|
|
|
for (i = 0; i < nrects; i++)
|
|
|
|
{
|
|
|
|
xrects[i].x = rects[i].left;
|
|
|
|
xrects[i].y = rects[i].top;
|
2011-08-23 00:10:08 +04:00
|
|
|
xrects[i].width = rects[i].right - rects[i].left;
|
|
|
|
xrects[i].height = rects[i].bottom - rects[i].top;
|
2011-08-23 00:06:12 +04:00
|
|
|
}
|
|
|
|
|
2011-08-24 06:58:36 +04:00
|
|
|
#ifdef WITH_XEXT
|
2012-09-03 00:34:06 +04:00
|
|
|
/*
|
|
|
|
* This is currently unsupported with the new logic to handle window placement with VisibleOffset variables
|
2013-03-29 07:34:26 +04:00
|
|
|
*
|
|
|
|
* Marc: enabling it works, and is required for round corners.
|
2012-09-03 00:34:06 +04:00
|
|
|
*/
|
2013-06-13 02:57:25 +04:00
|
|
|
XShapeCombineRectangles(xfc->display, window->handle, ShapeBounding, 0, 0, xrects, nrects, ShapeSet, 0);
|
2011-08-24 06:58:36 +04:00
|
|
|
#endif
|
|
|
|
|
2012-10-09 07:21:26 +04:00
|
|
|
free(xrects);
|
2011-08-23 00:06:12 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_SetWindowVisibilityRects(xfContext* xfc, xfWindow* window, RECTANGLE_16* rects, int nrects)
|
2011-08-09 06:24:12 +04:00
|
|
|
{
|
2011-08-30 22:21:16 +04:00
|
|
|
int i;
|
|
|
|
XRectangle* xrects;
|
2011-08-25 01:16:57 +04:00
|
|
|
|
2012-05-15 19:21:01 +04:00
|
|
|
if (nrects == 0)
|
|
|
|
return;
|
|
|
|
|
2012-10-09 07:21:26 +04:00
|
|
|
xrects = malloc(sizeof(XRectangle) * nrects);
|
2011-08-25 01:16:57 +04:00
|
|
|
|
2011-08-30 22:21:16 +04:00
|
|
|
for (i = 0; i < nrects; i++)
|
2011-08-22 13:21:39 +04:00
|
|
|
{
|
2011-08-30 22:21:16 +04:00
|
|
|
xrects[i].x = rects[i].left;
|
|
|
|
xrects[i].y = rects[i].top;
|
|
|
|
xrects[i].width = rects[i].right - rects[i].left;
|
|
|
|
xrects[i].height = rects[i].bottom - rects[i].top;
|
2011-08-22 13:21:39 +04:00
|
|
|
}
|
2011-08-30 22:21:16 +04:00
|
|
|
|
|
|
|
#ifdef WITH_XEXT
|
2012-09-03 00:34:06 +04:00
|
|
|
/*
|
|
|
|
* This is currently unsupported with the new logic to handle window placement with VisibleOffset variables
|
2013-03-29 07:34:26 +04:00
|
|
|
*
|
|
|
|
* Marc: enabling it works, and is required for round corners.
|
2012-09-03 00:34:06 +04:00
|
|
|
*/
|
2013-06-13 02:57:25 +04:00
|
|
|
XShapeCombineRectangles(xfc->display, window->handle, ShapeBounding, 0, 0, xrects, nrects, ShapeSet, 0);
|
2011-08-30 22:21:16 +04:00
|
|
|
#endif
|
|
|
|
|
2012-10-09 07:21:26 +04:00
|
|
|
free(xrects);
|
2011-08-25 01:16:57 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_UpdateWindowArea(xfContext* xfc, xfWindow* window, int x, int y, int width, int height)
|
2011-09-23 05:23:01 +04:00
|
|
|
{
|
|
|
|
int ax, ay;
|
|
|
|
rdpWindow* wnd;
|
|
|
|
wnd = window->window;
|
2011-12-03 02:51:30 +04:00
|
|
|
|
2013-04-09 01:03:21 +04:00
|
|
|
/* RemoteApp mode uses visibleOffset instead of windowOffset */
|
2012-09-03 00:34:06 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (!xfc->remote_app)
|
2012-08-04 02:35:17 +04:00
|
|
|
{
|
|
|
|
ax = x + wnd->windowOffsetX;
|
|
|
|
ay = y + wnd->windowOffsetY;
|
2011-09-23 05:23:01 +04:00
|
|
|
|
2012-08-04 02:35:17 +04:00
|
|
|
if (ax + width > wnd->windowOffsetX + wnd->windowWidth)
|
|
|
|
width = (wnd->windowOffsetX + wnd->windowWidth - 1) - ax;
|
2011-09-23 05:23:01 +04:00
|
|
|
|
2012-08-04 02:35:17 +04:00
|
|
|
if (ay + height > wnd->windowOffsetY + wnd->windowHeight)
|
|
|
|
height = (wnd->windowOffsetY + wnd->windowHeight - 1) - ay;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ax = x + wnd->visibleOffsetX;
|
|
|
|
ay = y + wnd->visibleOffsetY;
|
|
|
|
|
|
|
|
if (ax + width > wnd->visibleOffsetX + wnd->windowWidth)
|
|
|
|
width = (wnd->visibleOffsetX + wnd->windowWidth - 1) - ax;
|
|
|
|
|
|
|
|
if (ay + height > wnd->visibleOffsetY + wnd->windowHeight)
|
|
|
|
height = (wnd->visibleOffsetY + wnd->windowHeight - 1) - ay;
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
WaitForSingleObject(xfc->mutex, INFINITE);
|
2013-02-07 06:57:49 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (xfc->settings->SoftwareGdi)
|
2011-09-23 08:06:39 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
XPutImage(xfc->display, xfc->primary, window->gc, xfc->image,
|
2011-09-23 05:23:01 +04:00
|
|
|
ax, ay, ax, ay, width, height);
|
2011-09-23 08:06:39 +04:00
|
|
|
}
|
2011-09-23 05:23:01 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XCopyArea(xfc->display, xfc->primary, window->handle, window->gc,
|
2011-09-23 05:23:01 +04:00
|
|
|
ax, ay, width, height, x, y);
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XFlush(xfc->display);
|
2013-02-07 06:57:49 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
ReleaseMutex(xfc->mutex);
|
2011-09-23 05:23:01 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
BOOL xf_IsWindowBorder(xfContext* xfc, xfWindow* xfw, int x, int y)
|
2011-09-23 05:23:01 +04:00
|
|
|
{
|
|
|
|
rdpWindow* wnd;
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL clientArea = FALSE;
|
|
|
|
BOOL windowArea = FALSE;
|
2011-09-23 05:23:01 +04:00
|
|
|
|
|
|
|
wnd = xfw->window;
|
|
|
|
|
|
|
|
if (((x > wnd->clientOffsetX) && (x < wnd->clientOffsetX + wnd->clientAreaWidth)) &&
|
|
|
|
((y > wnd->clientOffsetY) && (y < wnd->clientOffsetY + wnd->clientAreaHeight)))
|
2012-10-09 10:31:28 +04:00
|
|
|
clientArea = TRUE;
|
2011-09-23 05:23:01 +04:00
|
|
|
|
|
|
|
if (((x > wnd->windowOffsetX) && (x < wnd->windowOffsetX + wnd->windowWidth)) &&
|
|
|
|
((y > wnd->windowOffsetY) && (y < wnd->windowOffsetY + wnd->windowHeight)))
|
2012-10-09 10:31:28 +04:00
|
|
|
windowArea = TRUE;
|
2011-09-23 05:23:01 +04:00
|
|
|
|
|
|
|
return (windowArea && !(clientArea));
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_DestroyWindow(xfContext* xfc, xfWindow* window)
|
2011-08-25 01:16:57 +04:00
|
|
|
{
|
2011-09-06 00:42:18 +04:00
|
|
|
if (window == NULL)
|
|
|
|
return;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (xfc->window == window)
|
|
|
|
xfc->window = NULL;
|
2011-11-18 02:00:13 +04:00
|
|
|
|
2011-08-30 22:21:16 +04:00
|
|
|
if (window->gc)
|
2013-06-13 02:57:25 +04:00
|
|
|
XFreeGC(xfc->display, window->gc);
|
2011-08-25 01:16:57 +04:00
|
|
|
|
2011-08-30 22:21:16 +04:00
|
|
|
if (window->handle)
|
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
XUnmapWindow(xfc->display, window->handle);
|
|
|
|
XDestroyWindow(xfc->display, window->handle);
|
2011-08-30 22:21:16 +04:00
|
|
|
}
|
2011-08-25 01:16:57 +04:00
|
|
|
|
2012-10-09 07:21:26 +04:00
|
|
|
free(window);
|
2011-08-09 06:24:12 +04:00
|
|
|
}
|
2012-09-19 02:57:19 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
rdpWindow* xf_rdpWindowFromWindow(xfContext* xfc, Window wnd)
|
2012-09-19 02:57:19 +04:00
|
|
|
{
|
|
|
|
rdpRail* rail;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (xfc)
|
2012-09-19 02:57:19 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
if (wnd)
|
2012-09-19 02:57:19 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
rail = ((rdpContext*) xfc)->rail;
|
2013-02-15 02:43:37 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (rail)
|
|
|
|
return window_list_get_by_extra_id(rail->list, (void*) (long) wnd);
|
2012-09-19 02:57:19 +04:00
|
|
|
}
|
|
|
|
}
|
2013-02-15 02:43:37 +04:00
|
|
|
|
2012-09-19 02:57:19 +04:00
|
|
|
return NULL;
|
|
|
|
}
|