[X2Go-Commits] [x2gokdrive] 02/05: x2gokdrive{.c, remote.c, init.{c, h}}: patch for X.Org 1.18.x compatibility, merging in the content from patches.legacy/osuse_42.3.patch via preprocessor defines.
git-admin at x2go.org
git-admin at x2go.org
Mon Jan 20 14:33:23 CET 2020
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository x2gokdrive.
commit 24a40d4ffd9c53b0de152f0d3ab48d32547fe48c
Author: Mihai Moldovan <ionic at ionic.de>
Date: Mon Jan 20 14:12:07 2020 +0100
x2gokdrive{.c,remote.c,init.{c,h}}: patch for X.Org 1.18.x compatibility, merging in the content from patches.legacy/osuse_42.3.patch via preprocessor defines.
---
debian/changelog | 3 +++
x2gokdrive.c | 23 ++++++++++++++++++++---
x2gokdriveinit.c | 3 +++
x2gokdriveremote.c | 27 +++++++++++++++++++++++++++
x2gokdriveremote.h | 8 ++++++++
5 files changed, 61 insertions(+), 3 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 5f057da..5e8fdeb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -49,6 +49,9 @@ x2gokdrive (0.0.0.1-0x2go1) UNRELEASED; urgency=medium
- patches.xorg/1.20.3: add actual (rebased) patches and potentially
missing files.
- patches.xorg/1.18.4: refresh against Ubuntu 16.04/xenial version.
+ - x2gokdrive{.c,remote.c,init.{c,h}}: patch for X.Org 1.18.x
+ compatibility, merging in the content from
+ patches.legacy/osuse_42.3.patch via preprocessor defines.
* debian/control:
+ Grammar fix.
+ Remove dependencies that refer to disabled features.
diff --git a/x2gokdrive.c b/x2gokdrive.c
index 91d0dd3..3789fee 100644
--- a/x2gokdrive.c
+++ b/x2gokdrive.c
@@ -234,7 +234,12 @@ ephyrMapFramebuffer(KdScreenInfo * screen)
buffer_height = ephyrBufferHeight(screen);
priv->base =
- remote_screen_init(screen, screen->x, screen->y,
+ remote_screen_init(screen,
+#if XORG_VERSION_CURRENT < 11900000
+ 0, 0,
+#else /* XORG_VERSION_CURRENT */
+ screen->x, screen->y,
+#endif /* XORG_VERSION_CURRENT */
screen->width, screen->height, buffer_height,
&priv->bytes_per_line, &screen->fb.bitsPerPixel);
@@ -346,14 +351,22 @@ ephyrInternalDamageRedisplay(ScreenPtr pScreen)
static void
-ephyrScreenBlockHandler(ScreenPtr pScreen, void *timeout)
+ephyrScreenBlockHandler(ScreenPtr pScreen, void *timeout
+#if XORG_VERSION_CURRENT < 11900000
+ , void *pReadMask
+#endif /* XORG_VERSION_CURRENT */
+ )
{
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
pScreen->BlockHandler = scrpriv->BlockHandler;
- (*pScreen->BlockHandler)(pScreen, timeout);
+ (*pScreen->BlockHandler)(pScreen, timeout
+#if XORG_VERSION_CURRENT < 11900000
+ , pReadMask
+#endif /* XORG_VERSION_CURRENT */
+ );
scrpriv->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = ephyrScreenBlockHandler;
@@ -1069,11 +1082,15 @@ ScreenPtr ephyrCursorScreen; /* screen containing the cursor */
static void
ephyrWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
+#if XORG_VERSION_CURRENT < 11900000
input_lock();
+#endif /* XORG_VERSION_CURRENT */
ephyrCursorScreen = pScreen;
miPointerWarpCursor(inputInfo.pointer, pScreen, x, y);
+#if XORG_VERSION_CURRENT < 11900000
input_unlock();
+#endif /* XORG_VERSION_CURRENT */
}
miPointerScreenFuncRec ephyrPointerScreenFuncs = {
diff --git a/x2gokdriveinit.c b/x2gokdriveinit.c
index 89fabb6..bfad59f 100644
--- a/x2gokdriveinit.c
+++ b/x2gokdriveinit.c
@@ -333,5 +333,8 @@ ephyrInitFake(void) { return 1; }
KdOsFuncs EphyrOsFuncs = {
.Init = ephyrInitFake,
+#if XORG_VERSION_CURRENT < 11900000
+ .pollEvents = pollEvents,
+#endif /* XORG_VERSION_CURRENT */
};
#endif /* XORG_VERSION_CURRENT */
diff --git a/x2gokdriveremote.c b/x2gokdriveremote.c
index 7ed24cd..17aaa61 100644
--- a/x2gokdriveremote.c
+++ b/x2gokdriveremote.c
@@ -1436,7 +1436,9 @@ void *send_frame_thread (void *threadid)
//only accept one client, close server socket
shutdown(remoteVars.serversock, SHUT_RDWR);
close(remoteVars.serversock);
+#if XORG_VERSION_CURRENT < 11900000
SetNotifyFd(remoteVars.clientsock, clientReadNotify, X_NOTIFY_READ, NULL);
+#endif /* XORG_VERSION_CURRENT */
remoteVars.client_connected=TRUE;
if(remoteVars.checkConnectionTimer)
{
@@ -1457,7 +1459,9 @@ void *send_frame_thread (void *threadid)
if(!remoteVars.client_connected)
{
EPHYR_DBG ("TCP connection closed\n");
+#if XORG_VERSION_CURRENT < 11900000
RemoveNotifyFd(remoteVars.clientsock);
+#endif /* XORG_VERSION_CURRENT */
shutdown(remoteVars.clientsock, SHUT_RDWR);
close(remoteVars.clientsock);
pthread_mutex_unlock(&remoteVars.sendqueue_mutex);
@@ -2094,6 +2098,29 @@ clientReadNotify(int fd, int ready, void *data)
}
+#if XORG_VERSION_CURRENT < 11900000
+void pollEvents(void)
+{
+ //EPHYR_DBG("polling events");
+ struct pollfd fds[2];
+ int nfds = 1;
+ BOOL con;
+ pthread_mutex_lock(&remoteVars.sendqueue_mutex);
+ con=remoteVars.client_connected;
+ pthread_mutex_unlock(&remoteVars.sendqueue_mutex);
+ if(!con)
+ return;
+
+ memset(fds, 0 , sizeof(fds));
+ fds[0].fd = remoteVars.clientsock;
+ fds[0].events = POLLIN;
+ if(poll(fds, nfds, 0))
+ {
+ clientReadNotify(remoteVars.clientsock, 0, NULL);
+ }
+}
+#endif /* XORG_VERSION_CURRENT */
+
unsigned int checkSocketConnection(OsTimerPtr timer, CARD32 time, void* args)
{
EPHYR_DBG("CHECKING ACCEPTED CONNECTION");
diff --git a/x2gokdriveremote.h b/x2gokdriveremote.h
index 9a23b69..728edb5 100644
--- a/x2gokdriveremote.h
+++ b/x2gokdriveremote.h
@@ -87,6 +87,10 @@
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
+#if XORG_VERSION_CURRENT < 11900000
+#include <poll.h>
+#endif /* XORG_VERSION_CURRENT */
+
#define EPHYR_WANT_DEBUG 1
// #warning DEBUG ENABLED
@@ -372,6 +376,10 @@ struct _remoteHostVars
int send_selection(int sel, char* data, uint32_t length, uint32_t mimeData);
+#if XORG_VERSION_CURRENT < 11900000
+void clientReadNotify(int fd, int ready, void *data);
+void pollEvents(void);
+#endif /* XORG_VERSION_CURRENT */
void clear_cache_data(uint32_t maxsize);
void clear_frame_cache(uint32_t max_elements);
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gokdrive.git
More information about the x2go-commits
mailing list