Lines 116-137
rfbBool ItalcVncConnection::hookNewClient( rfbClient *cl )
|
Link Here
|
---|
|
116 |
|
116 |
|
117 |
const int size = (int) cl->width * cl->height * |
117 |
const int size = (int) cl->width * cl->height * |
118 |
( cl->format.bitsPerPixel / 8 ); |
118 |
( cl->format.bitsPerPixel / 8 ); |
119 |
if( t->m_frameBuffer ) |
119 |
if (t->m_image.width() != cl->width && t->m_image.height() != cl->height) { |
120 |
{ |
120 |
if( t->m_frameBuffer ) |
121 |
// do not leak if we get a new framebuffer size |
121 |
{ |
122 |
delete [] t->m_frameBuffer; |
122 |
// do not leak if we get a new framebuffer size |
123 |
} |
123 |
delete [] t->m_frameBuffer; |
124 |
t->m_frameBuffer = new uint8_t[size]; |
124 |
} |
125 |
t->m_framebufferInitialized = false; |
125 |
t->m_frameBuffer = new uint8_t[size]; |
126 |
cl->frameBuffer = t->m_frameBuffer; |
126 |
t->m_framebufferInitialized = false; |
127 |
memset( cl->frameBuffer, '\0', size ); |
127 |
cl->frameBuffer = t->m_frameBuffer; |
128 |
cl->format.bitsPerPixel = 32; |
128 |
memset( cl->frameBuffer, '\0', size ); |
129 |
cl->format.redShift = 16; |
129 |
cl->format.bitsPerPixel = 32; |
130 |
cl->format.greenShift = 8; |
130 |
cl->format.redShift = 16; |
131 |
cl->format.blueShift = 0; |
131 |
cl->format.greenShift = 8; |
132 |
cl->format.redMax = 0xff; |
132 |
cl->format.blueShift = 0; |
133 |
cl->format.greenMax = 0xff; |
133 |
cl->format.redMax = 0xff; |
134 |
cl->format.blueMax = 0xff; |
134 |
cl->format.greenMax = 0xff; |
|
|
135 |
cl->format.blueMax = 0xff; |
136 |
} |
135 |
|
137 |
|
136 |
// only use remote cursor for remote control |
138 |
// only use remote cursor for remote control |
137 |
cl->appData.useRemoteCursor = false; |
139 |
cl->appData.useRemoteCursor = false; |