From 9ef0995fdae07cc0106dacf4fdee475bf42f5320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Mon, 2 Jan 2012 23:13:54 -0500 Subject: [PATCH] xfreerdp-server: add missing FindXfixes.cmake --- cmake/FindXfixes.cmake | 49 ++++++++++++++++++++++++++++++++++++++++++ server/X11/xf_peer.c | 37 +++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 cmake/FindXfixes.cmake diff --git a/cmake/FindXfixes.cmake b/cmake/FindXfixes.cmake new file mode 100644 index 000000000..f826cf056 --- /dev/null +++ b/cmake/FindXfixes.cmake @@ -0,0 +1,49 @@ +# - Find XFIXES +# Find the XFIXES libraries +# +# This module defines the following variables: +# XFIXES_FOUND - true if XFIXES_INCLUDE_DIR & XFIXES_LIBRARY are found +# XFIXES_LIBRARIES - Set when XFIXES_LIBRARY is found +# XFIXES_INCLUDE_DIRS - Set when XFIXES_INCLUDE_DIR is found +# +# XFIXES_INCLUDE_DIR - where to find Xfixes.h, etc. +# XFIXES_LIBRARY - the XFIXES library +# + +#============================================================================= +# Copyright 2011 O.S. Systems Software Ltda. +# Copyright 2011 Otavio Salvador +# Copyright 2011 Marc-Andre Moreau +# +# 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. +#============================================================================= + +find_path(XFIXES_INCLUDE_DIR NAMES Xfixes.h + PATH_SUFFIXES X11/extensions + DOC "The Xfixes include directory" +) + +find_library(XFIXES_LIBRARY NAMES Xfixes + DOC "The Xfixes library" +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(XFIXES DEFAULT_MSG XFIXES_LIBRARY XFIXES_INCLUDE_DIR) + +if(XFIXES_FOUND) + set( XFIXES_LIBRARIES ${XFIXES_LIBRARY} ) + set( XFIXES_INCLUDE_DIRS ${XFIXES_INCLUDE_DIR} ) +endif() + +mark_as_advanced(XFIXES_INCLUDE_DIR XFIXES_LIBRARY) + diff --git a/server/X11/xf_peer.c b/server/X11/xf_peer.c index 3cf4cfd39..cabb85ef3 100644 --- a/server/X11/xf_peer.c +++ b/server/X11/xf_peer.c @@ -214,6 +214,28 @@ STREAM* xf_peer_stream_init(xfPeerContext* context) return context->s; } +boolean xf_peer_event_process(xfPeerContext* xfp, XEvent* event) +{ + xfInfo* xfi = xfp->info; + + if (event->type == xfi->xdamage_notify_event) + { + int x, y, width, height; + XDamageNotifyEvent* notify; + + notify = (XDamageNotifyEvent*) event; + + x = notify->area.x; + y = notify->area.y; + width = notify->area.width; + height = notify->area.height; + + printf("XDamageNotify: x:%d y:%d width:%d height:%d\n", x, y, width, height); + } + + return true; +} + void xf_peer_live_rfx(freerdp_peer* client) { STREAM* s; @@ -222,6 +244,7 @@ void xf_peer_live_rfx(freerdp_peer* client) uint8* data; xfInfo* xfi; XImage* image; + XEvent xevent; RFX_RECT rect; uint32 seconds; uint32 useconds; @@ -240,6 +263,18 @@ void xf_peer_live_rfx(freerdp_peer* client) height = xfi->height; data = (uint8*) xmalloc(width * height * 3); + memset(&xevent, 0, sizeof(xevent)); + +#if 0 + while (XPending(xfi->display)) + { + memset(&xevent, 0, sizeof(xevent)); + XNextEvent(xfi->display, &xevent); + + if (xf_peer_event_process(xfp, &xevent) != true) + return; + } +#else while (1) { if (seconds > 0) @@ -271,6 +306,7 @@ void xf_peer_live_rfx(freerdp_peer* client) cmd->bitmapData = stream_get_head(s); update->SurfaceBits(update->context, cmd); } +#endif } static boolean xf_peer_sleep_tsdiff(uint32 *old_sec, uint32 *old_usec, uint32 new_sec, uint32 new_usec) @@ -385,6 +421,7 @@ boolean xf_peer_post_connect(freerdp_peer* client) client->settings->width = xfi->width; client->settings->height = xfi->height; + client->update->DesktopResize(client->update->context); xfp->activated = false;