Commit c70adf72 authored by Reinhard Tartler's avatar Reinhard Tartler

Imported nxcompshad-3.4.0-3.tar.gz

Summary: Imported nxcompshad-3.4.0-3.tar.gz Keywords: Imported nxcompshad-3.4.0-3.tar.gz into Git repository
parent 2208f4f9
ChangeLog: ChangeLog:
nxcompshad-3.4.0-3
- Updated copyright to year 2010.
nxcompshad-3.4.0-2
- Fixed TR08G02256. Now the Shadow session is shown correctly with
MIT-SHM extension disabled.
- Improved updateShadowFrameBuffer() and ~Poller() functions.
- Avoided memory leak.
nxcompshad-3.4.0-1 nxcompshad-3.4.0-1
- Opened the 3.4.0 branch based on nxcompshad-3.3.0-3. - Opened the 3.4.0 branch based on nxcompshad-3.3.0-3.
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
Copyright (c) 2001, 2009 NoMachine - http://www.nomachine.com/. Copyright (c) 2001, 2010 NoMachine - http://www.nomachine.com/.
NXCOMPSHAD and NX extensions to X are copyright of NoMachine. NXCOMPSHAD and NX extensions to X are copyright of NoMachine.
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMP, NX protocol compression and NX extensions to this software */ /* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMP, NX protocol compression and NX extensions to this software */ /* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
############################################################################ ############################################################################
# # # #
# Copyright (c) 2001, 2005 NoMachine, http://www.nomachine.com. # # Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. #
# # # #
# NXCOMP, NX protocol compression and NX extensions to this software # # NXCOMP, NX protocol compression and NX extensions to this software #
# are copyright of NoMachine. Redistribution and use of the present # # are copyright of NoMachine. Redistribution and use of the present #
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
...@@ -127,7 +127,7 @@ Poller::~Poller() ...@@ -127,7 +127,7 @@ Poller::~Poller()
XCloseDisplay(display_); XCloseDisplay(display_);
} }
if (tmpBuffer_ != NULL && shmExtension_ == 1 && damageExtension_ == 1) if (tmpBuffer_ != NULL && shmExtension_ != -1 && damageExtension_ == 1)
{ {
XFree(tmpBuffer_); XFree(tmpBuffer_);
...@@ -181,13 +181,21 @@ int Poller::updateShadowFrameBuffer(void) ...@@ -181,13 +181,21 @@ int Poller::updateShadowFrameBuffer(void)
return -1; return -1;
} }
return 1;
} }
else else
{ {
return 0; image_ = XGetImage(display_, DefaultRootWindow(display_), 0, 0, width_,
height_, AllPlanes, ZPixmap);
if (image_ == NULL)
{
logDebug("Poller::updateShadowFrameBuffer", "XGetImage failed!");
return -1;
}
} }
return 1;
} }
char *Poller::getRect(XRectangle r) char *Poller::getRect(XRectangle r)
...@@ -255,6 +263,8 @@ char *Poller::getRect(XRectangle r) ...@@ -255,6 +263,8 @@ char *Poller::getRect(XRectangle r)
} }
XFree(image_); XFree(image_);
image_ = NULL;
} }
return tmpBuffer_; return tmpBuffer_;
...@@ -1469,42 +1479,71 @@ void Poller::handleDamageNotify(XEvent *X) ...@@ -1469,42 +1479,71 @@ void Poller::handleDamageNotify(XEvent *X)
void Poller::updateDamagedAreas(void) void Poller::updateDamagedAreas(void)
{ {
if (shmExtension_ == 1) BOX *boxPtr;
{
BOX *boxPtr;
XRectangle rectangle; XRectangle rectangle;
int i; int i;
int y; int y;
for (i = 0; i < lastUpdatedRegion_ -> numRects; i++)
{
boxPtr = lastUpdatedRegion_ -> rects + i;
for (i = 0; i < lastUpdatedRegion_ -> numRects; i++) if (shmExtension_ == 1)
{ {
boxPtr = lastUpdatedRegion_ -> rects + i;
image_ -> width = boxPtr -> x2 - boxPtr -> x1; image_ -> width = boxPtr -> x2 - boxPtr -> x1;
image_ -> height = boxPtr -> y2 - boxPtr -> y1; image_ -> height = boxPtr -> y2 - boxPtr -> y1;
image_ -> bytes_per_line =
ROUNDUP((image_ -> bits_per_pixel * image_ -> width),
image_ -> bitmap_pad);
if (XShmGetImage(display_, DefaultRootWindow(display_), image_,
boxPtr -> x1, boxPtr -> y1, AllPlanes) == 0)
{
logDebug("Poller::updateDamagedAreas", "XShmGetImage failed!");
image_ -> bytes_per_line = ROUNDUP((image_ -> bits_per_pixel * image_ -> width), image_ -> bitmap_pad); return;
}
}
else if (shmExtension_ == 0)
{
image_ = XGetImage(display_, DefaultRootWindow(display_), boxPtr -> x1,
boxPtr -> y1, boxPtr -> x2 - boxPtr -> x1,
boxPtr -> y2 - boxPtr -> y1, AllPlanes,
ZPixmap);
if (XShmGetImage(display_, DefaultRootWindow(display_), image_, boxPtr -> x1, boxPtr -> y1, AllPlanes) == 0) if (image_ == NULL)
{ {
logDebug("Poller::getRect", "XShmGetImage failed!"); logDebug("Poller::updateDamagedAreas", "XGetImage failed!");
return; return;
} }
rectangle.height = 1; image_ -> width = boxPtr -> x2 - boxPtr -> x1;
rectangle.width = image_ -> width; image_ -> height = boxPtr -> y2 - boxPtr -> y1;
rectangle.x = boxPtr -> x1; image_ -> bytes_per_line =
rectangle.y = boxPtr -> y1; ROUNDUP((image_ -> bits_per_pixel * image_ -> width),
image_ -> bitmap_pad);
}
rectangle.height = 1;
rectangle.width = image_ -> width;
rectangle.x = boxPtr -> x1;
rectangle.y = boxPtr -> y1;
for (y = 0; y < image_ -> height; y++) for (y = 0; y < image_ -> height; y++)
{ {
update(image_ -> data + y * image_ -> bytes_per_line, rectangle); update(image_ -> data + y * image_ -> bytes_per_line, rectangle);
rectangle.y++; rectangle.y++;
} }
if (shmExtension_ != 1)
{
XDestroyImage(image_);
image_ = NULL;
} }
} }
......
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ /* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */ /* */
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */ /* are copyright of NoMachine. Redistribution and use of the present */
......
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