2011-08-07 17:52:40 +04:00
|
|
|
/**
|
2012-10-09 07:02:04 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2011-08-07 17:52:40 +04:00
|
|
|
* X11 Event Handling
|
|
|
|
*
|
|
|
|
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
*
|
|
|
|
* 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-10-27 21:29:16 +04:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xutil.h>
|
|
|
|
|
2012-02-18 02:43:00 +04:00
|
|
|
#include <freerdp/locale/keyboard.h>
|
2011-08-07 17:52:40 +04:00
|
|
|
|
2011-08-22 07:39:56 +04:00
|
|
|
#include "xf_rail.h"
|
2011-12-03 02:51:30 +04:00
|
|
|
#include "xf_window.h"
|
2011-09-23 07:37:17 +04:00
|
|
|
#include "xf_cliprdr.h"
|
2013-05-09 05:51:16 +04:00
|
|
|
#include "xf_input.h"
|
2014-06-13 00:13:12 +04:00
|
|
|
#include "xf_gfx.h"
|
2011-08-22 07:39:56 +04:00
|
|
|
|
2011-08-07 17:52:40 +04:00
|
|
|
#include "xf_event.h"
|
2013-04-26 03:52:17 +04:00
|
|
|
#include "xf_input.h"
|
2011-08-07 17:52:40 +04:00
|
|
|
|
2014-01-22 18:16:14 +04:00
|
|
|
#define CLAMP_COORDINATES(x, y) if (x < 0) x = 0; if (y < 0) y = 0
|
|
|
|
|
2013-04-02 23:13:10 +04:00
|
|
|
const char* const X11_EVENT_STRINGS[] =
|
2011-08-19 19:12:30 +04:00
|
|
|
{
|
|
|
|
"", "",
|
|
|
|
"KeyPress",
|
|
|
|
"KeyRelease",
|
|
|
|
"ButtonPress",
|
|
|
|
"ButtonRelease",
|
|
|
|
"MotionNotify",
|
|
|
|
"EnterNotify",
|
|
|
|
"LeaveNotify",
|
|
|
|
"FocusIn",
|
|
|
|
"FocusOut",
|
|
|
|
"KeymapNotify",
|
|
|
|
"Expose",
|
|
|
|
"GraphicsExpose",
|
|
|
|
"NoExpose",
|
|
|
|
"VisibilityNotify",
|
|
|
|
"CreateNotify",
|
|
|
|
"DestroyNotify",
|
|
|
|
"UnmapNotify",
|
|
|
|
"MapNotify",
|
|
|
|
"MapRequest",
|
|
|
|
"ReparentNotify",
|
|
|
|
"ConfigureNotify",
|
|
|
|
"ConfigureRequest",
|
|
|
|
"GravityNotify",
|
|
|
|
"ResizeRequest",
|
|
|
|
"CirculateNotify",
|
|
|
|
"CirculateRequest",
|
|
|
|
"PropertyNotify",
|
|
|
|
"SelectionClear",
|
|
|
|
"SelectionRequest",
|
|
|
|
"SelectionNotify",
|
|
|
|
"ColormapNotify",
|
|
|
|
"ClientMessage",
|
|
|
|
"MappingNotify",
|
|
|
|
"GenericEvent",
|
|
|
|
};
|
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__)
|
2012-03-23 00:30:15 +04:00
|
|
|
#endif
|
2011-08-19 19:12:30 +04:00
|
|
|
|
2014-03-23 01:12:50 +04:00
|
|
|
int xf_event_action_script_init(xfContext* xfc)
|
|
|
|
{
|
|
|
|
int exitCode;
|
|
|
|
char* xevent;
|
|
|
|
FILE* actionScript;
|
|
|
|
char buffer[1024] = { 0 };
|
|
|
|
char command[1024] = { 0 };
|
|
|
|
|
|
|
|
xfc->xevents = ArrayList_New(TRUE);
|
|
|
|
ArrayList_Object(xfc->xevents)->fnObjectFree = free;
|
|
|
|
|
|
|
|
sprintf_s(command, sizeof(command), "%s xevent", xfc->actionScript);
|
|
|
|
|
|
|
|
actionScript = popen(command, "r");
|
|
|
|
|
|
|
|
if (actionScript < 0)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
while (fgets(buffer, sizeof(buffer), actionScript) != NULL)
|
|
|
|
{
|
|
|
|
strtok(buffer, "\n");
|
|
|
|
xevent = _strdup(buffer);
|
|
|
|
ArrayList_Add(xfc->xevents, xevent);
|
|
|
|
}
|
|
|
|
|
|
|
|
exitCode = pclose(actionScript);
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void xf_event_action_script_free(xfContext* xfc)
|
|
|
|
{
|
|
|
|
if (xfc->xevents)
|
|
|
|
{
|
|
|
|
ArrayList_Free(xfc->xevents);
|
|
|
|
xfc->xevents = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int xf_event_execute_action_script(xfContext* xfc, XEvent* event)
|
|
|
|
{
|
|
|
|
int index;
|
|
|
|
int count;
|
|
|
|
char* name;
|
|
|
|
int exitCode;
|
|
|
|
FILE* actionScript;
|
|
|
|
BOOL match = FALSE;
|
|
|
|
const char* xeventName;
|
|
|
|
char buffer[1024] = { 0 };
|
|
|
|
char command[1024] = { 0 };
|
|
|
|
|
2014-03-24 17:40:01 +04:00
|
|
|
if (!xfc->actionScript)
|
|
|
|
return 1;
|
|
|
|
|
2014-03-23 01:12:50 +04:00
|
|
|
if (event->type > (sizeof(X11_EVENT_STRINGS) / sizeof(const char*)))
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
xeventName = X11_EVENT_STRINGS[event->type];
|
|
|
|
|
|
|
|
count = ArrayList_Count(xfc->xevents);
|
|
|
|
|
|
|
|
for (index = 0; index < count; index++)
|
|
|
|
{
|
|
|
|
name = (char*) ArrayList_GetItem(xfc->xevents, index);
|
|
|
|
|
|
|
|
if (_stricmp(name, xeventName) == 0)
|
|
|
|
{
|
|
|
|
match = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!match)
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
sprintf_s(command, sizeof(command), "%s xevent %s %d",
|
|
|
|
xfc->actionScript, xeventName, (int) xfc->window->handle);
|
|
|
|
|
|
|
|
actionScript = popen(command, "r");
|
|
|
|
|
|
|
|
if (actionScript < 0)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
while (fgets(buffer, sizeof(buffer), actionScript) != NULL)
|
|
|
|
{
|
|
|
|
strtok(buffer, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
exitCode = pclose(actionScript);
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
static BOOL xf_event_Expose(xfContext* xfc, XEvent* event, BOOL app)
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
2011-08-18 09:16:49 +04:00
|
|
|
int x, y;
|
2011-09-23 05:23:01 +04:00
|
|
|
int w, h;
|
2013-07-23 22:47:40 +04:00
|
|
|
|
2011-09-23 05:23:01 +04:00
|
|
|
x = event->xexpose.x;
|
|
|
|
y = event->xexpose.y;
|
|
|
|
w = event->xexpose.width;
|
|
|
|
h = event->xexpose.height;
|
2014-06-05 20:36:01 +04:00
|
|
|
|
2014-06-13 00:13:12 +04:00
|
|
|
if (xfc->gfx)
|
|
|
|
{
|
|
|
|
xf_OutputExpose(xfc, x, y, w, h);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2013-02-10 22:17:08 +04:00
|
|
|
if (!app)
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
2013-06-27 22:24:46 +04:00
|
|
|
if ((xfc->settings->ScalingFactor != 1.0) || (xfc->offset_x) || (xfc->offset_y))
|
2013-05-05 05:23:24 +04:00
|
|
|
{
|
2013-06-26 04:41:32 +04:00
|
|
|
xf_draw_screen_scaled(xfc, x - xfc->offset_x,
|
2013-07-23 22:47:40 +04:00
|
|
|
y - xfc->offset_y, w, h, FALSE);
|
2013-08-04 00:13:39 +04:00
|
|
|
}
|
|
|
|
else
|
2013-05-05 05:23:24 +04:00
|
|
|
{
|
2014-06-05 20:36:01 +04:00
|
|
|
XCopyArea(xfc->display, xfc->primary, xfc->window->handle, xfc->gc, x, y, w, h, x, y);
|
2013-05-05 05:23:24 +04:00
|
|
|
}
|
2013-08-04 00:13:39 +04:00
|
|
|
}
|
|
|
|
else
|
2011-08-18 09:16:49 +04:00
|
|
|
{
|
|
|
|
xfWindow* xfw;
|
|
|
|
rdpWindow* window;
|
2013-06-13 02:57:25 +04:00
|
|
|
rdpRail* rail = ((rdpContext*) xfc)->rail;
|
2013-07-23 22:47:40 +04:00
|
|
|
|
2013-05-30 17:27:20 +04:00
|
|
|
window = window_list_get_by_extra_id(rail->list,
|
2013-07-23 22:47:40 +04:00
|
|
|
(void*) event->xexpose.window);
|
|
|
|
|
2013-08-04 00:13:39 +04:00
|
|
|
if (window)
|
2011-08-18 09:16:49 +04:00
|
|
|
{
|
|
|
|
xfw = (xfWindow*) window->extra;
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_UpdateWindowArea(xfc, xfw, x, y, w, h);
|
2011-08-18 09:16:49 +04:00
|
|
|
}
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
2013-07-23 22:47:40 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
static BOOL xf_event_VisibilityNotify(xfContext* xfc, XEvent* event, BOOL app)
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->unobscured = event->xvisibility.state == VisibilityUnobscured;
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
|
|
|
|
2013-06-18 05:54:38 +04:00
|
|
|
BOOL xf_generic_MotionNotify(xfContext* xfc, int x, int y, int state, Window window, BOOL app)
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
2013-05-15 03:26:01 +04:00
|
|
|
rdpInput* input;
|
2012-05-07 23:50:47 +04:00
|
|
|
Window childWindow;
|
2011-08-07 17:52:40 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
input = xfc->instance->input;
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (!xfc->settings->MouseMotion)
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
2013-06-18 05:54:38 +04:00
|
|
|
if ((state & (Button1Mask | Button2Mask | Button3Mask)) == 0)
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2013-06-18 05:54:38 +04:00
|
|
|
}
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2012-05-07 23:50:47 +04:00
|
|
|
if (app)
|
2011-08-25 01:41:45 +04:00
|
|
|
{
|
2012-09-19 02:57:19 +04:00
|
|
|
/* make sure window exists */
|
2013-06-18 05:54:38 +04:00
|
|
|
if (xf_rdpWindowFromWindow(xfc, window) == 0)
|
2012-09-19 02:57:19 +04:00
|
|
|
{
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2012-09-19 02:57:19 +04:00
|
|
|
}
|
2013-03-29 07:09:28 +04:00
|
|
|
|
2012-11-21 04:34:52 +04:00
|
|
|
/* Translate to desktop coordinates */
|
2013-06-18 05:54:38 +04:00
|
|
|
XTranslateCoordinates(xfc->display, window,
|
2013-06-13 02:57:25 +04:00
|
|
|
RootWindowOfScreen(xfc->screen),
|
2012-05-07 23:50:47 +04:00
|
|
|
x, y, &x, &y, &childWindow);
|
|
|
|
}
|
2013-05-05 00:29:22 +04:00
|
|
|
|
|
|
|
/* Take scaling in to consideration */
|
2013-06-27 22:24:46 +04:00
|
|
|
if ( (xfc->settings->ScalingFactor != 1.0) || (xfc->offset_x) || (xfc->offset_y) )
|
2013-05-05 00:29:22 +04:00
|
|
|
{
|
2013-06-27 22:24:46 +04:00
|
|
|
x = (int)((x - xfc->offset_x) * (1.0 / xfc->settings->ScalingFactor) );
|
|
|
|
y = (int)((y - xfc->offset_y) * (1.0 / xfc->settings->ScalingFactor) );
|
2013-05-05 00:29:22 +04:00
|
|
|
}
|
2014-01-22 18:16:14 +04:00
|
|
|
CLAMP_COORDINATES(x,y);
|
2011-10-16 08:50:10 +04:00
|
|
|
|
2012-05-07 23:50:47 +04:00
|
|
|
input->MouseEvent(input, PTR_FLAGS_MOVE, x, y);
|
2011-08-25 01:41:45 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (xfc->fullscreen)
|
2012-05-07 23:50:47 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
XSetInputFocus(xfc->display, xfc->window->handle, RevertToPointerRoot, CurrentTime);
|
2011-08-25 01:41:45 +04:00
|
|
|
}
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-07 17:52:40 +04:00
|
|
|
}
|
|
|
|
|
2013-06-18 05:54:38 +04:00
|
|
|
static BOOL xf_event_MotionNotify(xfContext* xfc, XEvent* event, BOOL app)
|
|
|
|
{
|
2013-06-28 21:46:58 +04:00
|
|
|
if (xfc->use_xinput)
|
|
|
|
return TRUE;
|
|
|
|
|
2013-06-18 05:54:38 +04:00
|
|
|
return xf_generic_MotionNotify(xfc, event->xmotion.x, event->xmotion.y,
|
|
|
|
event->xmotion.state, event->xmotion.window, app);
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL xf_generic_ButtonPress(xfContext* xfc, int x, int y, int button, Window window, BOOL app)
|
2011-08-07 17:52:40 +04:00
|
|
|
{
|
2012-05-07 23:50:47 +04:00
|
|
|
int flags;
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL wheel;
|
|
|
|
BOOL extended;
|
2011-08-07 21:41:54 +04:00
|
|
|
rdpInput* input;
|
2013-05-15 03:26:01 +04:00
|
|
|
Window childWindow;
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2011-08-18 00:00:09 +04:00
|
|
|
flags = 0;
|
2012-10-09 10:31:28 +04:00
|
|
|
wheel = FALSE;
|
|
|
|
extended = FALSE;
|
2013-06-18 05:54:38 +04:00
|
|
|
input = xfc->instance->input;
|
2011-08-18 00:00:09 +04:00
|
|
|
|
2013-06-18 05:54:38 +04:00
|
|
|
switch (button)
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
2011-08-18 00:00:09 +04:00
|
|
|
case 1:
|
|
|
|
flags = PTR_FLAGS_DOWN | PTR_FLAGS_BUTTON1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
flags = PTR_FLAGS_DOWN | PTR_FLAGS_BUTTON3;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
flags = PTR_FLAGS_DOWN | PTR_FLAGS_BUTTON2;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 4:
|
2012-10-09 10:31:28 +04:00
|
|
|
wheel = TRUE;
|
2011-08-18 00:00:09 +04:00
|
|
|
flags = PTR_FLAGS_WHEEL | 0x0078;
|
|
|
|
break;
|
2011-08-07 17:52:40 +04:00
|
|
|
|
2011-08-18 00:00:09 +04:00
|
|
|
case 5:
|
2012-10-09 10:31:28 +04:00
|
|
|
wheel = TRUE;
|
2011-08-23 05:22:05 +04:00
|
|
|
flags = PTR_FLAGS_WHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x0088;
|
2011-08-18 00:00:09 +04:00
|
|
|
break;
|
|
|
|
|
2012-11-21 04:34:52 +04:00
|
|
|
case 6: /* wheel left or back */
|
|
|
|
case 8: /* back */
|
|
|
|
case 97: /* Xming */
|
2012-10-09 10:31:28 +04:00
|
|
|
extended = TRUE;
|
2012-04-01 17:35:11 +04:00
|
|
|
flags = PTR_XFLAGS_DOWN | PTR_XFLAGS_BUTTON1;
|
|
|
|
break;
|
|
|
|
|
2012-11-21 04:34:52 +04:00
|
|
|
case 7: /* wheel right or forward */
|
|
|
|
case 9: /* forward */
|
|
|
|
case 112: /* Xming */
|
2012-10-09 10:31:28 +04:00
|
|
|
extended = TRUE;
|
2012-04-01 17:35:11 +04:00
|
|
|
flags = PTR_XFLAGS_DOWN | PTR_XFLAGS_BUTTON2;
|
|
|
|
break;
|
|
|
|
|
2011-08-18 00:00:09 +04:00
|
|
|
default:
|
|
|
|
x = 0;
|
|
|
|
y = 0;
|
|
|
|
flags = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (flags != 0)
|
|
|
|
{
|
|
|
|
if (wheel)
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
2011-08-18 00:00:09 +04:00
|
|
|
input->MouseEvent(input, flags, 0, 0);
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
2011-08-18 00:00:09 +04:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (app)
|
|
|
|
{
|
2012-09-19 02:57:19 +04:00
|
|
|
/* make sure window exists */
|
2013-06-18 05:54:38 +04:00
|
|
|
if (xf_rdpWindowFromWindow(xfc, window) == 0)
|
2012-09-19 02:57:19 +04:00
|
|
|
{
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2012-09-19 02:57:19 +04:00
|
|
|
}
|
2012-11-21 04:34:52 +04:00
|
|
|
/* Translate to desktop coordinates */
|
2013-06-18 05:54:38 +04:00
|
|
|
XTranslateCoordinates(xfc->display, window,
|
2013-06-13 02:57:25 +04:00
|
|
|
RootWindowOfScreen(xfc->screen),
|
2012-05-07 23:50:47 +04:00
|
|
|
x, y, &x, &y, &childWindow);
|
2013-05-05 00:29:22 +04:00
|
|
|
|
2011-08-18 00:00:09 +04:00
|
|
|
}
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2013-06-27 22:24:46 +04:00
|
|
|
if ((xfc->settings->ScalingFactor != 1.0) || (xfc->offset_x)
|
2013-07-23 22:47:40 +04:00
|
|
|
|| (xfc->offset_y))
|
2013-05-30 17:27:20 +04:00
|
|
|
{
|
2013-06-26 04:41:32 +04:00
|
|
|
x = (int) ((x - xfc->offset_x)
|
2013-07-23 22:47:40 +04:00
|
|
|
* (1.0 / xfc->settings->ScalingFactor));
|
2013-06-26 04:41:32 +04:00
|
|
|
y = (int) ((y - xfc->offset_y)
|
2013-07-23 22:47:40 +04:00
|
|
|
* (1.0 / xfc->settings->ScalingFactor));
|
2013-05-30 17:27:20 +04:00
|
|
|
}
|
2013-05-05 00:29:22 +04:00
|
|
|
|
2014-01-22 18:16:14 +04:00
|
|
|
CLAMP_COORDINATES(x,y);
|
2012-04-01 17:35:11 +04:00
|
|
|
if (extended)
|
|
|
|
input->ExtendedMouseEvent(input, flags, x, y);
|
|
|
|
else
|
|
|
|
input->MouseEvent(input, flags, x, y);
|
2011-08-18 00:00:09 +04:00
|
|
|
}
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-07 17:52:40 +04:00
|
|
|
}
|
|
|
|
|
2013-06-18 05:54:38 +04:00
|
|
|
static BOOL xf_event_ButtonPress(xfContext* xfc, XEvent* event, BOOL app)
|
|
|
|
{
|
2013-06-28 21:46:58 +04:00
|
|
|
if (xfc->use_xinput)
|
|
|
|
return TRUE;
|
|
|
|
|
2013-06-18 05:54:38 +04:00
|
|
|
return xf_generic_ButtonPress(xfc, event->xbutton.x, event->xbutton.y,
|
|
|
|
event->xbutton.button, event->xbutton.window, app);
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL xf_generic_ButtonRelease(xfContext* xfc, int x, int y, int button, Window window, BOOL app)
|
2011-08-07 17:52:40 +04:00
|
|
|
{
|
2012-05-07 23:50:47 +04:00
|
|
|
int flags;
|
2013-06-18 05:54:38 +04:00
|
|
|
BOOL wheel;
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL extended;
|
2011-08-07 21:41:54 +04:00
|
|
|
rdpInput* input;
|
2013-05-15 03:26:01 +04:00
|
|
|
Window childWindow;
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2013-06-28 21:46:58 +04:00
|
|
|
|
2011-08-18 00:00:09 +04:00
|
|
|
flags = 0;
|
2013-06-18 05:54:38 +04:00
|
|
|
wheel = FALSE;
|
2012-10-09 10:31:28 +04:00
|
|
|
extended = FALSE;
|
2013-06-18 05:54:38 +04:00
|
|
|
input = xfc->instance->input;
|
2011-08-18 00:00:09 +04:00
|
|
|
|
2013-06-18 05:54:38 +04:00
|
|
|
switch (button)
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
2011-08-18 00:00:09 +04:00
|
|
|
case 1:
|
|
|
|
flags = PTR_FLAGS_BUTTON1;
|
|
|
|
break;
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2011-08-18 00:00:09 +04:00
|
|
|
case 2:
|
|
|
|
flags = PTR_FLAGS_BUTTON3;
|
|
|
|
break;
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2011-08-18 00:00:09 +04:00
|
|
|
case 3:
|
|
|
|
flags = PTR_FLAGS_BUTTON2;
|
|
|
|
break;
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2012-04-01 17:35:11 +04:00
|
|
|
case 6:
|
|
|
|
case 8:
|
|
|
|
case 97:
|
2012-10-09 10:31:28 +04:00
|
|
|
extended = TRUE;
|
2012-04-01 17:35:11 +04:00
|
|
|
flags = PTR_XFLAGS_BUTTON1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 7:
|
|
|
|
case 9:
|
|
|
|
case 112:
|
2012-10-09 10:31:28 +04:00
|
|
|
extended = TRUE;
|
2012-04-01 17:35:11 +04:00
|
|
|
flags = PTR_XFLAGS_BUTTON2;
|
|
|
|
break;
|
|
|
|
|
2011-08-18 00:00:09 +04:00
|
|
|
default:
|
|
|
|
flags = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (flags != 0)
|
|
|
|
{
|
|
|
|
if (app)
|
|
|
|
{
|
2012-09-19 02:57:19 +04:00
|
|
|
/* make sure window exists */
|
2013-06-18 05:54:38 +04:00
|
|
|
if (xf_rdpWindowFromWindow(xfc, window) == NULL)
|
2012-09-19 02:57:19 +04:00
|
|
|
{
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2012-09-19 02:57:19 +04:00
|
|
|
}
|
2012-11-21 04:34:52 +04:00
|
|
|
/* Translate to desktop coordinates */
|
2013-06-18 05:54:38 +04:00
|
|
|
XTranslateCoordinates(xfc->display, window,
|
2013-06-13 02:57:25 +04:00
|
|
|
RootWindowOfScreen(xfc->screen),
|
2012-05-07 23:50:47 +04:00
|
|
|
x, y, &x, &y, &childWindow);
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
|
|
|
|
2013-05-29 00:28:13 +04:00
|
|
|
|
2013-06-27 22:24:46 +04:00
|
|
|
if ((xfc->settings->ScalingFactor != 1.0) || (xfc->offset_x) || (xfc->offset_y))
|
2013-05-09 05:51:16 +04:00
|
|
|
{
|
2013-06-27 22:24:46 +04:00
|
|
|
x = (int) ((x - xfc->offset_x) * (1.0 / xfc->settings->ScalingFactor));
|
|
|
|
y = (int) ((y - xfc->offset_y) * (1.0 / xfc->settings->ScalingFactor));
|
2013-05-09 05:51:16 +04:00
|
|
|
}
|
2013-05-05 00:29:22 +04:00
|
|
|
|
2014-01-22 18:16:14 +04:00
|
|
|
CLAMP_COORDINATES(x,y);
|
|
|
|
|
2012-04-01 17:35:11 +04:00
|
|
|
if (extended)
|
|
|
|
input->ExtendedMouseEvent(input, flags, x, y);
|
|
|
|
else
|
|
|
|
input->MouseEvent(input, flags, x, y);
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
|
|
|
|
2013-06-18 05:54:38 +04:00
|
|
|
static BOOL xf_event_ButtonRelease(xfContext* xfc, XEvent* event, BOOL app)
|
|
|
|
{
|
2013-06-28 21:46:58 +04:00
|
|
|
if (xfc->use_xinput)
|
|
|
|
return TRUE;
|
|
|
|
|
2013-06-18 05:54:38 +04:00
|
|
|
return xf_generic_ButtonRelease(xfc, event->xbutton.x, event->xbutton.y,
|
|
|
|
event->xbutton.button, event->xbutton.window, app);
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
static BOOL xf_event_KeyPress(xfContext* xfc, XEvent* event, BOOL app)
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
|
|
|
KeySym keysym;
|
|
|
|
char str[256];
|
|
|
|
|
|
|
|
XLookupString((XKeyEvent*) event, str, sizeof(str), &keysym, NULL);
|
|
|
|
|
2014-03-14 05:10:22 +04:00
|
|
|
xf_keyboard_key_press(xfc, event->xkey.keycode, keysym);
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
static BOOL xf_event_KeyRelease(xfContext* xfc, XEvent* event, BOOL app)
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
2014-03-14 08:11:44 +04:00
|
|
|
XEvent nextEvent;
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (XPending(xfc->display))
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
2014-03-14 08:11:44 +04:00
|
|
|
ZeroMemory(&nextEvent, sizeof(nextEvent));
|
|
|
|
XPeekEvent(xfc->display, &nextEvent);
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2014-03-14 08:11:44 +04:00
|
|
|
if (nextEvent.type == KeyPress)
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
2014-03-14 08:11:44 +04:00
|
|
|
if (nextEvent.xkey.keycode == event->xkey.keycode)
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-14 05:10:22 +04:00
|
|
|
xf_keyboard_key_release(xfc, event->xkey.keycode);
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
2011-08-07 17:52:40 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
static BOOL xf_event_FocusIn(xfContext* xfc, XEvent* event, BOOL app)
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
|
|
|
if (event->xfocus.mode == NotifyGrab)
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->focused = TRUE;
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (xfc->mouse_active && (!app))
|
|
|
|
XGrabKeyboard(xfc->display, xfc->window->handle, TRUE, GrabModeAsync, GrabModeAsync, CurrentTime);
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2011-12-20 23:51:44 +04:00
|
|
|
if (app)
|
2012-08-04 02:35:17 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_rail_send_activate(xfc, event->xany.window, TRUE);
|
2012-08-04 02:35:17 +04:00
|
|
|
|
|
|
|
rdpWindow* window;
|
2013-06-13 02:57:25 +04:00
|
|
|
rdpRail* rail = ((rdpContext*) xfc)->rail;
|
2012-08-04 02:35:17 +04:00
|
|
|
|
|
|
|
window = window_list_get_by_extra_id(rail->list, (void*) event->xany.window);
|
|
|
|
|
2012-11-21 04:34:52 +04:00
|
|
|
/* Update the server with any window changes that occured while the window was not focused. */
|
2012-08-04 02:35:17 +04:00
|
|
|
if (window != NULL)
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_rail_adjust_position(xfc, window);
|
2012-08-04 02:35:17 +04:00
|
|
|
}
|
2013-02-12 05:38:19 +04:00
|
|
|
|
2014-03-14 05:10:22 +04:00
|
|
|
xf_keyboard_focus_in(xfc);
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
static BOOL xf_event_FocusOut(xfContext* xfc, XEvent* event, BOOL app)
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
|
|
|
if (event->xfocus.mode == NotifyUngrab)
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->focused = FALSE;
|
2011-08-07 21:41:54 +04:00
|
|
|
|
|
|
|
if (event->xfocus.mode == NotifyWhileGrabbed)
|
2013-06-13 02:57:25 +04:00
|
|
|
XUngrabKeyboard(xfc->display, CurrentTime);
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2014-03-14 05:10:22 +04:00
|
|
|
xf_keyboard_clear(xfc);
|
2012-08-03 00:45:03 +04:00
|
|
|
|
2011-12-20 23:51:44 +04:00
|
|
|
if (app)
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_rail_send_activate(xfc, event->xany.window, FALSE);
|
2011-08-25 02:22:06 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
static BOOL xf_event_MappingNotify(xfContext* xfc, XEvent* event, BOOL app)
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
|
|
|
if (event->xmapping.request == MappingModifier)
|
|
|
|
{
|
2014-03-14 05:10:22 +04:00
|
|
|
if (xfc->modifierMap)
|
|
|
|
XFreeModifiermap(xfc->modifierMap);
|
2013-11-01 07:35:24 +04:00
|
|
|
|
2014-03-14 05:10:22 +04:00
|
|
|
xfc->modifierMap = XGetModifierMapping(xfc->display);
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
static BOOL xf_event_ClientMessage(xfContext* xfc, XEvent* event, BOOL app)
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
if ((event->xclient.message_type == xfc->WM_PROTOCOLS)
|
|
|
|
&& ((Atom) event->xclient.data.l[0] == xfc->WM_DELETE_WINDOW))
|
2011-09-21 16:36:49 +04:00
|
|
|
{
|
|
|
|
if (app)
|
|
|
|
{
|
2012-03-23 00:30:15 +04:00
|
|
|
DEBUG_X11("RAIL window closed");
|
2011-09-21 16:36:49 +04:00
|
|
|
rdpWindow* window;
|
2013-06-13 02:57:25 +04:00
|
|
|
rdpRail* rail = ((rdpContext*) xfc)->rail;
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2011-10-16 08:50:10 +04:00
|
|
|
window = window_list_get_by_extra_id(rail->list, (void*) event->xclient.window);
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2011-09-21 16:36:49 +04:00
|
|
|
if (window != NULL)
|
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_rail_send_client_system_command(xfc, window->windowId, SC_CLOSE);
|
2011-09-21 16:36:49 +04:00
|
|
|
}
|
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-09-21 16:36:49 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-03-23 00:30:15 +04:00
|
|
|
DEBUG_X11("Main window closed");
|
2012-10-09 10:31:28 +04:00
|
|
|
return FALSE;
|
2011-09-21 16:36:49 +04:00
|
|
|
}
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-07 17:52:40 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
static BOOL xf_event_EnterNotify(xfContext* xfc, XEvent* event, BOOL app)
|
2011-08-07 17:52:40 +04:00
|
|
|
{
|
2013-02-10 22:17:08 +04:00
|
|
|
if (!app)
|
2011-08-18 09:16:49 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->mouse_active = TRUE;
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (xfc->fullscreen)
|
|
|
|
XSetInputFocus(xfc->display, xfc->window->handle, RevertToPointerRoot, CurrentTime);
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (xfc->focused)
|
|
|
|
XGrabKeyboard(xfc->display, xfc->window->handle, TRUE, GrabModeAsync, GrabModeAsync, CurrentTime);
|
2011-12-20 23:42:22 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* keep track of which window has focus so that we can apply pointer updates */
|
|
|
|
|
2011-11-15 02:36:25 +04:00
|
|
|
xfWindow* xfw;
|
|
|
|
rdpWindow* window;
|
2013-06-13 02:57:25 +04:00
|
|
|
rdpRail* rail = ((rdpContext*) xfc)->rail;
|
2011-11-15 02:36:25 +04:00
|
|
|
window = window_list_get_by_extra_id(rail->list, (void*) event->xexpose.window);
|
2011-12-20 23:42:22 +04:00
|
|
|
|
2011-11-15 02:36:25 +04:00
|
|
|
if (window != NULL)
|
|
|
|
{
|
|
|
|
xfw = (xfWindow*) window->extra;
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->window = xfw;
|
2011-11-15 02:36:25 +04:00
|
|
|
}
|
2011-08-18 09:16:49 +04:00
|
|
|
}
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-07 17:52:40 +04:00
|
|
|
}
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
static BOOL xf_event_LeaveNotify(xfContext* xfc, XEvent* event, BOOL app)
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
2013-02-10 22:17:08 +04:00
|
|
|
if (!app)
|
2011-08-19 19:12:30 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->mouse_active = FALSE;
|
|
|
|
XUngrabKeyboard(xfc->display, CurrentTime);
|
2011-08-19 19:12:30 +04:00
|
|
|
}
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
2011-08-18 00:00:09 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
static BOOL xf_event_ConfigureNotify(xfContext* xfc, XEvent* event, BOOL app)
|
2011-08-18 09:16:49 +04:00
|
|
|
{
|
2011-11-19 03:46:22 +04:00
|
|
|
rdpWindow* window;
|
2013-06-13 02:57:25 +04:00
|
|
|
rdpRail* rail = ((rdpContext*) xfc)->rail;
|
2011-11-19 03:46:22 +04:00
|
|
|
|
2013-05-04 03:04:47 +04:00
|
|
|
|
2013-05-15 18:41:14 +04:00
|
|
|
/* This is for resizing the window by dragging the border
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (xfc->width != event->xconfigure.width)
|
2013-05-09 05:51:16 +04:00
|
|
|
{
|
2013-06-27 22:24:46 +04:00
|
|
|
xfc->settings->ScalingFactor = (double) event->xconfigure.width / (double) xfc->originalWidth;
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->currentWidth = event->xconfigure.width;
|
|
|
|
xfc->currentHeight = event->xconfigure.width;
|
2013-05-04 03:04:47 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_draw_screen_scaled(xfc);
|
2013-05-09 05:51:16 +04:00
|
|
|
}
|
2013-05-15 18:41:14 +04:00
|
|
|
*/
|
2011-11-19 03:46:22 +04:00
|
|
|
window = window_list_get_by_extra_id(rail->list, (void*) event->xconfigure.window);
|
|
|
|
|
|
|
|
if (window != NULL)
|
|
|
|
{
|
|
|
|
xfWindow* xfw;
|
2011-12-20 23:51:44 +04:00
|
|
|
Window childWindow;
|
2011-11-19 03:46:22 +04:00
|
|
|
xfw = (xfWindow*) window->extra;
|
|
|
|
|
2011-12-20 23:51:44 +04:00
|
|
|
/*
|
|
|
|
* ConfigureNotify coordinates are expressed relative to the window parent.
|
|
|
|
* Translate these to root window coordinates.
|
|
|
|
*/
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XTranslateCoordinates(xfc->display, xfw->handle,
|
|
|
|
RootWindowOfScreen(xfc->screen),
|
2011-11-19 03:46:22 +04:00
|
|
|
0, 0, &xfw->left, &xfw->top, &childWindow);
|
|
|
|
|
2013-05-04 03:04:47 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
2011-11-19 03:46:22 +04:00
|
|
|
xfw->width = event->xconfigure.width;
|
|
|
|
xfw->height = event->xconfigure.height;
|
|
|
|
xfw->right = xfw->left + xfw->width - 1;
|
|
|
|
xfw->bottom = xfw->top + xfw->height - 1;
|
|
|
|
|
2011-12-17 01:09:21 +04:00
|
|
|
DEBUG_X11_LMS("window=0x%X rc={l=%d t=%d r=%d b=%d} w=%u h=%u send_event=%d",
|
2012-10-09 11:26:39 +04:00
|
|
|
(UINT32) xfw->handle, xfw->left, xfw->top, xfw->right, xfw->bottom,
|
2011-12-17 01:09:21 +04:00
|
|
|
xfw->width, xfw->height, event->xconfigure.send_event);
|
2011-11-29 01:50:08 +04:00
|
|
|
|
2012-11-21 04:34:52 +04:00
|
|
|
/*
|
|
|
|
* Additonal checks for not in a local move and not ignoring configure to send
|
2012-09-19 02:57:19 +04:00
|
|
|
* position update to server, also should the window not be focused then do not
|
|
|
|
* send to server yet(ie. resizing using window decoration).
|
2012-11-21 04:34:52 +04:00
|
|
|
* The server will be updated when the window gets refocused.
|
|
|
|
*/
|
2012-09-19 02:57:19 +04:00
|
|
|
if (app && xfw->decorations)
|
|
|
|
{
|
|
|
|
/* moving resizing using window decoration */
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_rail_adjust_position(xfc, window);
|
2012-09-19 02:57:19 +04:00
|
|
|
window->windowOffsetX = xfw->left;
|
|
|
|
window->visibleOffsetX = window->windowOffsetX;
|
|
|
|
window->windowOffsetY = xfw->top;
|
|
|
|
window->visibleOffsetY = window->windowOffsetY;
|
|
|
|
window->windowWidth = xfw->width;
|
|
|
|
window->windowHeight = xfw->height;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
if (app && (!event->xconfigure.send_event || xfc->window->local_move.state == LMS_NOT_ACTIVE)
|
|
|
|
&& !xfw->rail_ignore_configure && xfc->focused)
|
|
|
|
xf_rail_adjust_position(xfc, window);
|
2012-09-19 02:57:19 +04:00
|
|
|
}
|
|
|
|
|
2011-11-19 03:46:22 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return True;
|
2011-08-18 09:16:49 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
static BOOL xf_event_MapNotify(xfContext* xfc, XEvent* event, BOOL app)
|
2011-08-22 07:15:19 +04:00
|
|
|
{
|
2012-05-28 16:21:56 +04:00
|
|
|
RECTANGLE_16 rect;
|
2011-08-22 07:15:19 +04:00
|
|
|
rdpWindow* window;
|
2013-06-13 02:57:25 +04:00
|
|
|
rdpUpdate* update = xfc->instance->update;
|
|
|
|
rdpRail* rail = ((rdpContext*) xfc)->rail;
|
2011-08-22 07:15:19 +04:00
|
|
|
|
2013-02-10 22:17:08 +04:00
|
|
|
if (!app)
|
2011-08-22 07:15:19 +04:00
|
|
|
{
|
2013-02-12 05:38:19 +04:00
|
|
|
rect.left = 0;
|
|
|
|
rect.top = 0;
|
2013-06-13 02:57:25 +04:00
|
|
|
rect.right = xfc->width;
|
|
|
|
rect.bottom = xfc->height;
|
2013-02-12 05:38:19 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
update->SuppressOutput((rdpContext*) xfc, 1, &rect);
|
2012-05-28 16:21:56 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
window = window_list_get_by_extra_id(rail->list, (void*) event->xany.window);
|
|
|
|
|
|
|
|
if (window != NULL)
|
|
|
|
{
|
|
|
|
/* local restore event */
|
2012-11-21 04:34:52 +04:00
|
|
|
|
|
|
|
/* This is now handled as part of the PropertyNotify
|
|
|
|
* Doing this here would inhibit the ability to restore a maximized window
|
|
|
|
* that is minimized back to the maximized state
|
|
|
|
*/
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
//xf_rail_send_client_system_command(xfc, window->windowId, SC_RESTORE);
|
2013-03-29 07:09:28 +04:00
|
|
|
xfWindow* xfw = (xfWindow*) window->extra;
|
2012-10-09 10:31:28 +04:00
|
|
|
xfw->is_mapped = TRUE;
|
2012-05-28 16:21:56 +04:00
|
|
|
}
|
2011-11-29 01:50:08 +04:00
|
|
|
}
|
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-11-29 01:50:08 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
static BOOL xf_event_UnmapNotify(xfContext* xfc, XEvent* event, BOOL app)
|
2011-11-29 01:50:08 +04:00
|
|
|
{
|
|
|
|
rdpWindow* window;
|
2013-06-13 02:57:25 +04:00
|
|
|
rdpUpdate* update = xfc->instance->update;
|
|
|
|
rdpRail* rail = ((rdpContext*) xfc)->rail;
|
2011-11-29 01:50:08 +04:00
|
|
|
|
2014-03-14 05:10:22 +04:00
|
|
|
xf_keyboard_release_all_keypress(xfc);
|
2012-04-11 08:37:47 +04:00
|
|
|
|
2013-02-10 22:17:08 +04:00
|
|
|
if (!app)
|
2011-11-29 01:50:08 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
update->SuppressOutput((rdpContext*) xfc, 0, NULL);
|
2012-05-28 16:21:56 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
window = window_list_get_by_extra_id(rail->list, (void*) event->xany.window);
|
|
|
|
|
|
|
|
if (window != NULL)
|
|
|
|
{
|
2013-02-12 05:38:19 +04:00
|
|
|
xfWindow* xfw = (xfWindow*) window->extra;
|
2012-10-09 10:31:28 +04:00
|
|
|
xfw->is_mapped = FALSE;
|
2012-05-28 16:21:56 +04:00
|
|
|
}
|
2011-08-22 07:15:19 +04:00
|
|
|
}
|
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-08-22 07:15:19 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
static BOOL xf_event_PropertyNotify(xfContext* xfc, XEvent* event, BOOL app)
|
2011-09-23 07:37:17 +04:00
|
|
|
{
|
2012-11-21 04:34:52 +04:00
|
|
|
/*
|
|
|
|
* This section handles sending the appropriate commands to the rail server
|
|
|
|
* when the window has been minimized, maximized, restored locally
|
|
|
|
* ie. not using the buttons on the rail window itself
|
|
|
|
*/
|
|
|
|
|
2013-02-12 05:38:19 +04:00
|
|
|
if (app)
|
2012-08-04 02:35:17 +04:00
|
|
|
{
|
|
|
|
rdpWindow* window;
|
2012-09-19 02:57:19 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
window = xf_rdpWindowFromWindow(xfc, event->xproperty.window);
|
2013-02-10 22:17:08 +04:00
|
|
|
|
2012-09-19 02:57:19 +04:00
|
|
|
if (window == NULL)
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2012-08-04 02:35:17 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if ((((Atom) event->xproperty.atom == xfc->_NET_WM_STATE) && (event->xproperty.state != PropertyDelete)) ||
|
|
|
|
(((Atom) event->xproperty.atom == xfc->WM_STATE) && (event->xproperty.state != PropertyDelete)))
|
2012-08-04 02:35:17 +04:00
|
|
|
{
|
2013-03-29 07:09:28 +04:00
|
|
|
int i;
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL status;
|
|
|
|
BOOL maxVert = FALSE;
|
|
|
|
BOOL maxHorz = FALSE;
|
|
|
|
BOOL minimized = FALSE;
|
2012-08-04 02:35:17 +04:00
|
|
|
unsigned long nitems;
|
|
|
|
unsigned long bytes;
|
|
|
|
unsigned char* prop;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if ((Atom) event->xproperty.atom == xfc->_NET_WM_STATE)
|
2013-02-10 22:17:08 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_GetWindowProperty(xfc, event->xproperty.window,
|
|
|
|
xfc->_NET_WM_STATE, 12, &nitems, &bytes, &prop);
|
2012-08-04 02:35:17 +04:00
|
|
|
|
2013-03-29 07:09:28 +04:00
|
|
|
if (!status)
|
|
|
|
{
|
|
|
|
DEBUG_X11_LMS("No return _NET_WM_STATE, window is not maximized");
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < nitems; i++)
|
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
if ((Atom) ((UINT16**) prop)[i] == XInternAtom(xfc->display, "_NET_WM_STATE_MAXIMIZED_VERT", False))
|
2013-03-29 07:09:28 +04:00
|
|
|
{
|
|
|
|
maxVert = TRUE;
|
|
|
|
}
|
2012-08-04 02:35:17 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if ((Atom) ((UINT16**) prop)[i] == XInternAtom(xfc->display, "_NET_WM_STATE_MAXIMIZED_HORZ", False))
|
2013-03-29 07:09:28 +04:00
|
|
|
{
|
|
|
|
maxHorz = TRUE;
|
|
|
|
}
|
|
|
|
}
|
2012-08-04 02:35:17 +04:00
|
|
|
|
2013-03-29 07:09:28 +04:00
|
|
|
XFree(prop);
|
2012-08-04 02:35:17 +04:00
|
|
|
}
|
2013-03-29 07:09:28 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if ((Atom) event->xproperty.atom == xfc->WM_STATE)
|
2012-08-04 02:35:17 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_GetWindowProperty(xfc, event->xproperty.window, xfc->WM_STATE, 1, &nitems, &bytes, &prop);
|
2013-03-29 07:09:28 +04:00
|
|
|
|
|
|
|
if (!status)
|
|
|
|
{
|
|
|
|
DEBUG_X11_LMS("No return WM_STATE, window is not minimized");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* If the window is in the iconic state */
|
|
|
|
if (((UINT32) *prop == 3))
|
|
|
|
minimized = TRUE;
|
|
|
|
else
|
|
|
|
minimized = FALSE;
|
|
|
|
|
|
|
|
XFree(prop);
|
|
|
|
}
|
|
|
|
}
|
2012-08-04 02:35:17 +04:00
|
|
|
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (maxVert && maxHorz && !minimized && (xfc->window->rail_state != WINDOW_SHOW_MAXIMIZED))
|
2013-03-29 07:09:28 +04:00
|
|
|
{
|
|
|
|
DEBUG_X11_LMS("Send SC_MAXIMIZE command to rail server.");
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->window->rail_state = WINDOW_SHOW_MAXIMIZED;
|
|
|
|
xf_rail_send_client_system_command(xfc, window->windowId, SC_MAXIMIZE);
|
2013-03-29 07:09:28 +04:00
|
|
|
}
|
2013-06-13 02:57:25 +04:00
|
|
|
else if (minimized && (xfc->window->rail_state != WINDOW_SHOW_MINIMIZED))
|
2013-03-29 07:09:28 +04:00
|
|
|
{
|
|
|
|
DEBUG_X11_LMS("Send SC_MINIMIZE command to rail server.");
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->window->rail_state = WINDOW_SHOW_MINIMIZED;
|
|
|
|
xf_rail_send_client_system_command(xfc, window->windowId, SC_MINIMIZE);
|
2013-03-29 07:09:28 +04:00
|
|
|
}
|
2013-06-13 02:57:25 +04:00
|
|
|
else if (!minimized && !maxVert && !maxHorz && (xfc->window->rail_state != WINDOW_SHOW))
|
2013-03-29 07:09:28 +04:00
|
|
|
{
|
|
|
|
DEBUG_X11_LMS("Send SC_RESTORE command to rail server");
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->window->rail_state = WINDOW_SHOW;
|
|
|
|
xf_rail_send_client_system_command(xfc, window->windowId, SC_RESTORE);
|
2013-03-29 07:09:28 +04:00
|
|
|
}
|
2012-08-04 02:35:17 +04:00
|
|
|
}
|
|
|
|
}
|
2011-09-23 07:37:17 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-09-23 07:37:17 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
static BOOL xf_event_suppress_events(xfContext* xfc, rdpWindow* window, XEvent*event)
|
2011-08-07 21:41:54 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
if (!xfc->remote_app)
|
2012-10-09 10:31:28 +04:00
|
|
|
return FALSE;
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
switch (xfc->window->local_move.state)
|
2011-08-18 09:16:49 +04:00
|
|
|
{
|
2011-12-07 03:42:58 +04:00
|
|
|
case LMS_NOT_ACTIVE:
|
2012-11-21 04:34:52 +04:00
|
|
|
/* No local move in progress, nothing to do */
|
|
|
|
|
|
|
|
/* Prevent Configure from happening during indeterminant state of Horz or Vert Max only */
|
2012-08-04 02:35:17 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if ( (event->type == ConfigureNotify) && xfc->window->rail_ignore_configure)
|
2012-08-04 02:35:17 +04:00
|
|
|
{
|
|
|
|
DEBUG_X11_LMS("ConfigureNotify Event Ignored");
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->window->rail_ignore_configure = FALSE;
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2012-08-04 02:35:17 +04:00
|
|
|
}
|
|
|
|
|
2011-12-07 03:42:58 +04:00
|
|
|
break;
|
2012-11-21 04:34:52 +04:00
|
|
|
|
2011-12-07 03:42:58 +04:00
|
|
|
case LMS_STARTING:
|
2012-11-21 04:34:52 +04:00
|
|
|
/* Local move initiated by RDP server, but we have not yet seen any updates from the X server */
|
2011-12-07 03:42:58 +04:00
|
|
|
switch(event->type)
|
2011-12-03 02:51:30 +04:00
|
|
|
{
|
2011-12-07 03:42:58 +04:00
|
|
|
case ConfigureNotify:
|
2012-11-21 04:34:52 +04:00
|
|
|
/* Starting to see move events from the X server. Local move is now in progress. */
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->window->local_move.state = LMS_ACTIVE;
|
2011-12-07 03:42:58 +04:00
|
|
|
|
2012-11-21 04:34:52 +04:00
|
|
|
/* Allow these events to be processed during move to keep our state up to date. */
|
2011-12-07 03:42:58 +04:00
|
|
|
break;
|
2011-12-03 02:51:30 +04:00
|
|
|
case ButtonPress:
|
|
|
|
case ButtonRelease:
|
|
|
|
case KeyPress:
|
|
|
|
case KeyRelease:
|
|
|
|
case UnmapNotify:
|
2012-11-21 04:34:52 +04:00
|
|
|
/*
|
|
|
|
* A button release event means the X window server did not grab the
|
|
|
|
* mouse before the user released it. In this case we must cancel the
|
|
|
|
* local move. The event will be processed below as normal, below.
|
|
|
|
*/
|
2011-12-07 03:42:58 +04:00
|
|
|
break;
|
2011-12-03 02:51:30 +04:00
|
|
|
case VisibilityNotify:
|
2011-12-07 03:42:58 +04:00
|
|
|
case PropertyNotify:
|
2011-12-10 00:25:56 +04:00
|
|
|
case Expose:
|
2012-11-21 04:34:52 +04:00
|
|
|
/* Allow these events to pass */
|
2011-12-10 00:25:56 +04:00
|
|
|
break;
|
2011-12-07 03:42:58 +04:00
|
|
|
default:
|
2012-11-21 04:34:52 +04:00
|
|
|
/* Eat any other events */
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-12-07 03:42:58 +04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LMS_ACTIVE:
|
2012-11-21 04:34:52 +04:00
|
|
|
/* Local move is in progress */
|
2011-12-07 03:42:58 +04:00
|
|
|
switch(event->type)
|
|
|
|
{
|
2011-12-03 02:51:30 +04:00
|
|
|
case ConfigureNotify:
|
2011-12-07 03:42:58 +04:00
|
|
|
case VisibilityNotify:
|
2011-12-03 02:51:30 +04:00
|
|
|
case PropertyNotify:
|
2011-12-10 00:25:56 +04:00
|
|
|
case Expose:
|
2012-08-04 02:35:17 +04:00
|
|
|
case GravityNotify:
|
2012-11-21 04:34:52 +04:00
|
|
|
/* Keep us up to date on position */
|
2011-12-03 02:51:30 +04:00
|
|
|
break;
|
|
|
|
default:
|
2012-08-04 02:35:17 +04:00
|
|
|
DEBUG_X11_LMS("Event Type to break LMS: %s", X11_EVENT_STRINGS[event->type]);
|
2012-11-21 04:34:52 +04:00
|
|
|
/* Any other event terminates move */
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_rail_end_local_move(xfc, window);
|
2011-12-07 03:42:58 +04:00
|
|
|
break;
|
2011-12-03 02:51:30 +04:00
|
|
|
}
|
2011-12-07 03:42:58 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case LMS_TERMINATING:
|
2012-11-21 04:34:52 +04:00
|
|
|
/* Already sent RDP end move to server. Allow events to pass. */
|
2011-12-07 03:42:58 +04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
return FALSE;
|
2011-12-07 03:42:58 +04:00
|
|
|
}
|
|
|
|
|
2011-12-03 02:51:30 +04:00
|
|
|
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL xf_event_process(freerdp* instance, XEvent* event)
|
2011-12-07 03:42:58 +04:00
|
|
|
{
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL status = TRUE;
|
2011-12-07 03:42:58 +04:00
|
|
|
rdpWindow* window;
|
2013-06-13 02:57:25 +04:00
|
|
|
xfContext* xfc = (xfContext*) instance->context;
|
|
|
|
rdpRail* rail = ((rdpContext*) xfc)->rail;
|
2011-12-07 03:42:58 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (xfc->remote_app)
|
2011-12-07 03:42:58 +04:00
|
|
|
{
|
2012-11-21 04:34:52 +04:00
|
|
|
window = window_list_get_by_extra_id(rail->list, (void*) event->xexpose.window);
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (window)
|
2011-12-07 03:42:58 +04:00
|
|
|
{
|
2012-11-21 04:34:52 +04:00
|
|
|
/* Update "current" window for cursor change orders */
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->window = (xfWindow*) window->extra;
|
2011-12-07 03:42:58 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
if (xf_event_suppress_events(xfc, window, event))
|
2012-10-09 10:31:28 +04:00
|
|
|
return TRUE;
|
2011-12-03 02:51:30 +04:00
|
|
|
}
|
|
|
|
}
|
2011-09-03 20:50:26 +04:00
|
|
|
|
2014-03-23 01:12:50 +04:00
|
|
|
xf_event_execute_action_script(xfc, event);
|
|
|
|
|
2011-08-19 19:12:30 +04:00
|
|
|
if (event->type != MotionNotify)
|
2012-10-09 11:26:39 +04:00
|
|
|
DEBUG_X11("%s Event(%d): wnd=0x%04X", X11_EVENT_STRINGS[event->type], event->type, (UINT32) event->xany.window);
|
2011-08-19 19:12:30 +04:00
|
|
|
|
2011-08-07 21:41:54 +04:00
|
|
|
switch (event->type)
|
|
|
|
{
|
|
|
|
case Expose:
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_event_Expose(xfc, event, xfc->remote_app);
|
2011-08-07 21:41:54 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case VisibilityNotify:
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_event_VisibilityNotify(xfc, event, xfc->remote_app);
|
2011-08-07 21:41:54 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case MotionNotify:
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_event_MotionNotify(xfc, event, xfc->remote_app);
|
2011-08-07 21:41:54 +04:00
|
|
|
break;
|
|
|
|
case ButtonPress:
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_event_ButtonPress(xfc, event, xfc->remote_app);
|
2011-08-07 21:41:54 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ButtonRelease:
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_event_ButtonRelease(xfc, event, xfc->remote_app);
|
2011-08-07 21:41:54 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case KeyPress:
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_event_KeyPress(xfc, event, xfc->remote_app);
|
2011-08-07 21:41:54 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case KeyRelease:
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_event_KeyRelease(xfc, event, xfc->remote_app);
|
2011-08-07 21:41:54 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FocusIn:
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_event_FocusIn(xfc, event, xfc->remote_app);
|
2011-08-07 21:41:54 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FocusOut:
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_event_FocusOut(xfc, event, xfc->remote_app);
|
2011-08-07 21:41:54 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case EnterNotify:
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_event_EnterNotify(xfc, event, xfc->remote_app);
|
2011-08-07 21:41:54 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case LeaveNotify:
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_event_LeaveNotify(xfc, event, xfc->remote_app);
|
2011-08-07 21:41:54 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case NoExpose:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GraphicsExpose:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ConfigureNotify:
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_event_ConfigureNotify(xfc, event, xfc->remote_app);
|
2011-08-07 21:41:54 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case MapNotify:
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_event_MapNotify(xfc, event, xfc->remote_app);
|
2011-08-07 21:41:54 +04:00
|
|
|
break;
|
|
|
|
|
2011-11-29 01:50:08 +04:00
|
|
|
case UnmapNotify:
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_event_UnmapNotify(xfc, event, xfc->remote_app);
|
2011-11-29 01:50:08 +04:00
|
|
|
break;
|
|
|
|
|
2011-08-07 21:41:54 +04:00
|
|
|
case ReparentNotify:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case MappingNotify:
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_event_MappingNotify(xfc, event, xfc->remote_app);
|
2011-08-07 21:41:54 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ClientMessage:
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_event_ClientMessage(xfc, event, xfc->remote_app);
|
2011-08-07 21:41:54 +04:00
|
|
|
break;
|
|
|
|
|
2011-09-23 07:37:17 +04:00
|
|
|
case PropertyNotify:
|
2013-06-13 02:57:25 +04:00
|
|
|
status = xf_event_PropertyNotify(xfc, event, xfc->remote_app);
|
2011-09-23 07:37:17 +04:00
|
|
|
break;
|
2013-04-25 01:59:53 +04:00
|
|
|
|
2011-08-07 21:41:54 +04:00
|
|
|
}
|
|
|
|
|
2014-07-07 22:26:41 +04:00
|
|
|
if (!xfc->remote_app)
|
|
|
|
{
|
|
|
|
xf_cliprdr_handle_xevent(xfc, event);
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_input_handle_event(xfc, event);
|
2013-04-26 03:52:17 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XSync(xfc->display, FALSE);
|
2013-02-11 20:40:35 +04:00
|
|
|
|
2011-08-07 21:41:54 +04:00
|
|
|
return status;
|
|
|
|
}
|