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:
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
- 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 */
/* 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 */
/* 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 */
/* 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 */
/* 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.
......
/**************************************************************************/
/* */
/* 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 */
/* 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 */
/* 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 #
# 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 */
/* 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 */
/* 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 */
/* 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 */
/* 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 */
/* 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 */
/* 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 */
/* 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 */
/* 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 */
/* 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 */
/* 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 */
/* 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 */
/* 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 */
/* are copyright of NoMachine. Redistribution and use of the present */
......@@ -127,7 +127,7 @@ Poller::~Poller()
XCloseDisplay(display_);
}
if (tmpBuffer_ != NULL && shmExtension_ == 1 && damageExtension_ == 1)
if (tmpBuffer_ != NULL && shmExtension_ != -1 && damageExtension_ == 1)
{
XFree(tmpBuffer_);
......@@ -181,13 +181,21 @@ int Poller::updateShadowFrameBuffer(void)
return -1;
}
return 1;
}
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)
......@@ -255,6 +263,8 @@ char *Poller::getRect(XRectangle r)
}
XFree(image_);
image_ = NULL;
}
return tmpBuffer_;
......@@ -1469,8 +1479,6 @@ void Poller::handleDamageNotify(XEvent *X)
void Poller::updateDamagedAreas(void)
{
if (shmExtension_ == 1)
{
BOX *boxPtr;
XRectangle rectangle;
......@@ -1482,18 +1490,43 @@ void Poller::updateDamagedAreas(void)
{
boxPtr = lastUpdatedRegion_ -> rects + i;
if (shmExtension_ == 1)
{
image_ -> width = boxPtr -> x2 - boxPtr -> x1;
image_ -> height = boxPtr -> y2 - boxPtr -> y1;
image_ -> bytes_per_line =
ROUNDUP((image_ -> bits_per_pixel * image_ -> width),
image_ -> bitmap_pad);
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!");
if (XShmGetImage(display_, DefaultRootWindow(display_), image_, boxPtr -> x1, boxPtr -> y1, AllPlanes) == 0)
return;
}
}
else if (shmExtension_ == 0)
{
logDebug("Poller::getRect", "XShmGetImage failed!");
image_ = XGetImage(display_, DefaultRootWindow(display_), boxPtr -> x1,
boxPtr -> y1, boxPtr -> x2 - boxPtr -> x1,
boxPtr -> y2 - boxPtr -> y1, AllPlanes,
ZPixmap);
if (image_ == NULL)
{
logDebug("Poller::updateDamagedAreas", "XGetImage failed!");
return;
}
image_ -> width = boxPtr -> x2 - boxPtr -> x1;
image_ -> height = boxPtr -> y2 - boxPtr -> y1;
image_ -> bytes_per_line =
ROUNDUP((image_ -> bits_per_pixel * image_ -> width),
image_ -> bitmap_pad);
}
rectangle.height = 1;
rectangle.width = image_ -> width;
rectangle.x = boxPtr -> x1;
......@@ -1505,6 +1538,12 @@ void Poller::updateDamagedAreas(void)
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 */
/* 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