Commit 9b934a44 authored by Mike Gabriel's avatar Mike Gabriel

nxagent: Use SetNotifyFd to receive events.

Inspired by X.org commit: commit 55c2e1a3aa587c58a74066724e11e30b3df267b8 Author: Keith Packard <keithp@keithp.com> Date: Mon Dec 7 15:11:33 2015 -0800 xnest: Use SetNotifyFd to receive events Signed-off-by: 's avatarKeith Packard <keithp@keithp.com> Reviewed-by: 's avatarAdam Jackson <ajax@redhat.com>
parent 86110d6e
...@@ -2877,7 +2877,7 @@ void nxagentAddXConnection() ...@@ -2877,7 +2877,7 @@ void nxagentAddXConnection()
"to the device set.\n", nxagentXConnectionNumber); "to the device set.\n", nxagentXConnectionNumber);
#endif #endif
AddEnabledDevice(nxagentXConnectionNumber); SetNotifyFd(XConnectionNumber(nxagentDisplay), nxagentNotifyConnection, X_NOTIFY_READ, NULL);
} }
void nxagentRemoveXConnection() void nxagentRemoveXConnection()
...@@ -2887,7 +2887,7 @@ void nxagentRemoveXConnection() ...@@ -2887,7 +2887,7 @@ void nxagentRemoveXConnection()
"from the device set.\n", nxagentXConnectionNumber); "from the device set.\n", nxagentXConnectionNumber);
#endif #endif
RemoveEnabledDevice(nxagentXConnectionNumber); RemoveNotifyFd(nxagentXConnectionNumber);
} }
/* /*
......
...@@ -58,6 +58,7 @@ is" without express or implied warranty. ...@@ -58,6 +58,7 @@ is" without express or implied warranty.
#include "Pointer.h" #include "Pointer.h"
#include "Keyboard.h" #include "Keyboard.h"
#include "Handlers.h" #include "Handlers.h"
#include "Events.h"
#include "Init.h" #include "Init.h"
#include "Args.h" #include "Args.h"
#include "Client.h" #include "Client.h"
...@@ -407,6 +408,12 @@ FIXME: These variables, if not removed at all because have probably ...@@ -407,6 +408,12 @@ FIXME: These variables, if not removed at all because have probably
blackRoot = TRUE; blackRoot = TRUE;
} }
void
nxagentNotifyConnection(int fd, int ready, void *data)
{
nxagentDispatchEvents(NULL);
}
void InitInput(argc, argv) void InitInput(argc, argv)
int argc; int argc;
char *argv[]; char *argv[];
......
...@@ -49,4 +49,6 @@ extern int nxagentX2go; ...@@ -49,4 +49,6 @@ extern int nxagentX2go;
extern ServerGrabInfoRec nxagentGrabServerInfo; extern ServerGrabInfoRec nxagentGrabServerInfo;
void nxagentNotifyConnection(int fd, int ready, void *data);
#endif /* __Init_H__ */ #endif /* __Init_H__ */
...@@ -2781,7 +2781,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) ...@@ -2781,7 +2781,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
"to the device set.\n", fd); "to the device set.\n", fd);
#endif #endif
AddEnabledDevice(nxagentShadowXConnectionNumber); SetNotifyFd(nxagentShadowXConnectionNumber, nxagentNotifyConnection, X_NOTIFY_READ, NULL);
accessPixmapID = FakeClientID(serverClient -> index); accessPixmapID = FakeClientID(serverClient -> index);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment