diff options
author | Pierre Ossman <ossman@cendio.se> | 2016-10-05 13:46:01 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2016-10-05 13:46:01 +0200 |
commit | b192107b302098864358cd54b6323129c23e271e (patch) | |
tree | e93fd818a053a595b9c814238811bda043331b21 /unix/xserver/hw/vnc/XserverDesktop.h | |
parent | 574dc64dfe1e2c8b52348f95619a845172282238 (diff) | |
download | tigervnc-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/XserverDesktop.h')
-rw-r--r-- | unix/xserver/hw/vnc/XserverDesktop.h | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/unix/xserver/hw/vnc/XserverDesktop.h b/unix/xserver/hw/vnc/XserverDesktop.h index 9e776274..07bd3995 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.h +++ b/unix/xserver/hw/vnc/XserverDesktop.h @@ -38,13 +38,12 @@ #include <rfb/VNCServerST.h> #include <rdr/SubstitutingInStream.h> #include "Input.h" -#include "xorg-version.h" namespace rfb { class VNCServerST; } -namespace network { class TcpListener; class Socket; } +namespace network { class TcpListener; class Socket; class SocketServer; } class XserverDesktop : public rfb::SDesktop, public rfb::FullFramePixelBuffer, public rdr::Substitutor, @@ -70,16 +69,8 @@ public: const unsigned char *rgbaData); void add_changed(const rfb::Region ®ion); void add_copied(const rfb::Region &dest, const rfb::Point &delta); -#if XORG >= 119 - void handleListenFd(int fd); - void handleSocketFd(int fd, int xevents); + void handleSocketEvent(int fd, bool read, bool write); void blockHandler(int* timeout); -#else - void readBlockHandler(fd_set* fds, struct timeval ** timeout); - void readWakeupHandler(fd_set* fds, int nfds); - void writeBlockHandler(fd_set* fds, struct timeval ** timeout); - void writeWakeupHandler(fd_set* fds, int nfds); -#endif void addClient(network::Socket* sock, bool reverse); void disconnectClients(); @@ -114,6 +105,14 @@ public: const char* userName, char** reason); +protected: + bool handleListenerEvent(int fd, + std::list<network::TcpListener*>* sockets, + network::SocketServer* sockserv); + bool handleSocketEvent(int fd, + network::SocketServer* sockserv, + bool read, bool write); + private: rfb::ScreenSet computeScreenLayout(); @@ -124,7 +123,6 @@ private: std::list<network::TcpListener*> httpListeners; bool deferredUpdateTimerSet; bool directFbptr; - struct timeval dixTimeout; uint32_t queryConnectId; network::Socket* queryConnectSocket; |