Skip to content

Commit

Permalink
DAMAGE is mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
gschwind committed Sep 3, 2019
1 parent a87aab0 commit 14b810a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
8 changes: 3 additions & 5 deletions unix/spawnvncserver/XDesktop.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,13 @@ XDesktop::XDesktop(char const * displayName)
auto r = xcb_damage_query_version_reply(xcb, c, &e);
if (r != nullptr and e == nullptr) {
vlog.info("DAMAGE extension present - version %d.%d",r->major_version,r->minor_version);
haveDamage = true;
}
free(r);
} else {
#endif
vlog.info("DAMAGE extension not present");
vlog.info("Will have to poll screen for changes");
throw Exception("DAMAGE extension is mandatory");
#ifdef HAVE_XDAMAGE
}
#endif
Expand Down Expand Up @@ -344,8 +344,6 @@ XDesktop::~XDesktop() {


void XDesktop::poll() {
if (pb and not haveDamage)
pb->poll(server);
if (running) {
int x, y;
xcb_generic_error_t * e;
Expand Down Expand Up @@ -395,7 +393,7 @@ void XDesktop::start(VNCServer* vs) {
server->setPixelBuffer(pb, computeScreenLayout());

#ifdef HAVE_XDAMAGE
if (haveDamage) {
{
damage = xcb_generate_id(xcb);
auto c = xcb_damage_create_checked(xcb, damage, default_root, XCB_DAMAGE_REPORT_LEVEL_RAW_RECTANGLES);
auto e = xcb_request_check(xcb, c);
Expand All @@ -418,7 +416,7 @@ void XDesktop::stop() {
running = false;

#ifdef HAVE_XDAMAGE
if (haveDamage) {
{
xcb_damage_destroy(xcb, damage);
vlog.debug("destroy damage %d", damage);
}
Expand Down
1 change: 0 additions & 1 deletion unix/spawnvncserver/XDesktop.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ class XDesktop : public rfb::SDesktop,
network::Socket* queryConnectSock;
int oldButtonMask;
bool haveXtest;
bool haveDamage;
int maxButtons;
std::map<KeySym, KeyCode> pressedKeys;
bool running;
Expand Down

0 comments on commit 14b810a

Please sign in to comment.