aboutsummaryrefslogtreecommitdiffstats
path: root/unix/xserver/hw/vnc/vncExtInit.cc
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2016-10-05 13:46:01 +0200
committerPierre Ossman <ossman@cendio.se>2016-10-05 13:46:01 +0200
commitb192107b302098864358cd54b6323129c23e271e (patch)
treee93fd818a053a595b9c814238811bda043331b21 /unix/xserver/hw/vnc/vncExtInit.cc
parent574dc64dfe1e2c8b52348f95619a845172282238 (diff)
downloadtigervnc-b192107b302098864358cd54b6323129c23e271e.tar.gz
tigervnc-b192107b302098864358cd54b6323129c23e271e.zip
Merge X server block handling code paths
Use the new X server API as the reference system and emulate it on the older API. Avoids a lot of code duplication.
Diffstat (limited to 'unix/xserver/hw/vnc/vncExtInit.cc')
-rw-r--r--unix/xserver/hw/vnc/vncExtInit.cc38
1 files changed, 5 insertions, 33 deletions
diff --git a/unix/xserver/hw/vnc/vncExtInit.cc b/unix/xserver/hw/vnc/vncExtInit.cc
index 9d70e44b..57bf6d8d 100644
--- a/unix/xserver/hw/vnc/vncExtInit.cc
+++ b/unix/xserver/hw/vnc/vncExtInit.cc
@@ -40,6 +40,7 @@
#include "vncBlockHandler.h"
#include "vncSelection.h"
#include "XorgGlue.h"
+#include "xorg-version.h"
using namespace rfb;
@@ -249,47 +250,18 @@ int vncExtensionIsActive(int scrIdx)
return (desktop[scrIdx] != NULL);
}
-#if XORG >= 119
-
-void vncCallBlockHandlers(int* timeout)
-{
- for (int scr = 0; scr < vncGetScreenCount(); scr++)
- if (desktop[scr])
- desktop[scr]->blockHandler(timeout);
-}
-
-#else
-
-void vncCallReadBlockHandlers(fd_set * fds, struct timeval ** timeout)
-{
- for (int scr = 0; scr < vncGetScreenCount(); scr++)
- if (desktop[scr])
- desktop[scr]->readBlockHandler(fds, timeout);
-}
-
-void vncCallReadWakeupHandlers(fd_set * fds, int nfds)
-{
- for (int scr = 0; scr < vncGetScreenCount(); scr++)
- if (desktop[scr])
- desktop[scr]->readWakeupHandler(fds, nfds);
-}
-
-void vncCallWriteBlockHandlers(fd_set * fds, struct timeval ** timeout)
+void vncHandleSocketEvent(int fd, int scrIdx, int read, int write)
{
- for (int scr = 0; scr < vncGetScreenCount(); scr++)
- if (desktop[scr])
- desktop[scr]->writeBlockHandler(fds, timeout);
+ desktop[scrIdx]->handleSocketEvent(fd, read, write);
}
-void vncCallWriteWakeupHandlers(fd_set * fds, int nfds)
+void vncCallBlockHandlers(int* timeout)
{
for (int scr = 0; scr < vncGetScreenCount(); scr++)
if (desktop[scr])
- desktop[scr]->writeWakeupHandler(fds, nfds);
+ desktop[scr]->blockHandler(timeout);
}
-#endif
-
int vncGetAvoidShiftNumLock(void)
{
return (bool)avoidShiftNumLock;