Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
libvncserver
Commits
018e90db
Commit
018e90db
authored
Oct 05, 2001
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed cursor functions to use screen info, not cursor
fixed copy rect.
parent
8f407f8a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
36 deletions
+38
-36
CHANGES
CHANGES
+7
-1
TODO
TODO
+1
-1
cursor.c
cursor.c
+3
-13
example.c
example.c
+3
-3
main.c
main.c
+18
-12
rfb.h
rfb.h
+2
-2
rfbserver.c
rfbserver.c
+4
-4
No files found.
CHANGES
View file @
018e90db
0.2
0.2
flag backgroundLoop in rfbScreenInfo
fixed CopyRect (was using the wrong order of rectangles...)
should also work with pthreads, because copyrects are
always sent immediately (so that two consecutive copy rects
cannot conflict).
changed rfbUndrawCursor(rfbClientPtr) to (rfbScreenInfoPtr), because
this makes more sense!
flag backgroundLoop in rfbScreenInfo (if having pthreads)
rfbCopyRect & rfbCopyRegion (really copies rectangle in frameBuffer)
rfbCopyRect & rfbCopyRegion (really copies rectangle in frameBuffer)
added flag to optionally not send XCursor updates.
added flag to optionally not send XCursor updates.
fixed java viewer on server side:
fixed java viewer on server side:
...
...
TODO
View file @
018e90db
immediate:
immediate:
----------
----------
copyRect and pthreads possible problem
.
test copyRect and pthreads
.
authentification schemes (secure vnc)
authentification schemes (secure vnc)
udp
udp
documentation
documentation
...
...
cursor.c
View file @
018e90db
...
@@ -331,9 +331,8 @@ void MakeRichCursorFromXCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor)
...
@@ -331,9 +331,8 @@ void MakeRichCursorFromXCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor)
/* functions to draw/hide cursor directly in the frame buffer */
/* functions to draw/hide cursor directly in the frame buffer */
void
rfbUndrawCursor
(
rfb
ClientPtr
cl
)
void
rfbUndrawCursor
(
rfb
ScreenInfoPtr
s
)
{
{
rfbScreenInfoPtr
s
=
cl
->
screen
;
rfbCursorPtr
c
=
s
->
cursor
;
rfbCursorPtr
c
=
s
->
cursor
;
int
j
,
x1
,
x2
,
y1
,
y2
,
bpp
=
s
->
rfbServerFormat
.
bitsPerPixel
/
8
,
int
j
,
x1
,
x2
,
y1
,
y2
,
bpp
=
s
->
rfbServerFormat
.
bitsPerPixel
/
8
,
rowstride
=
s
->
paddedWidthInBytes
;
rowstride
=
s
->
paddedWidthInBytes
;
...
@@ -372,9 +371,8 @@ void rfbUndrawCursor(rfbClientPtr cl)
...
@@ -372,9 +371,8 @@ void rfbUndrawCursor(rfbClientPtr cl)
UNLOCK
(
s
->
cursorMutex
);
UNLOCK
(
s
->
cursorMutex
);
}
}
void
rfbDrawCursor
(
rfb
ClientPtr
cl
)
void
rfbDrawCursor
(
rfb
ScreenInfoPtr
s
)
{
{
rfbScreenInfoPtr
s
=
cl
->
screen
;
rfbCursorPtr
c
=
s
->
cursor
;
rfbCursorPtr
c
=
s
->
cursor
;
int
i
,
j
,
x1
,
x2
,
y1
,
y2
,
i1
,
j1
,
bpp
=
s
->
rfbServerFormat
.
bitsPerPixel
/
8
,
int
i
,
j
,
x1
,
x2
,
y1
,
y2
,
i1
,
j1
,
bpp
=
s
->
rfbServerFormat
.
bitsPerPixel
/
8
,
rowstride
=
s
->
paddedWidthInBytes
,
rowstride
=
s
->
paddedWidthInBytes
,
...
@@ -453,16 +451,8 @@ void rfbPrintXCursor(rfbCursorPtr cursor)
...
@@ -453,16 +451,8 @@ void rfbPrintXCursor(rfbCursorPtr cursor)
extern
void
rfbSetCursor
(
rfbScreenInfoPtr
rfbScreen
,
rfbCursorPtr
c
,
Bool
freeOld
)
extern
void
rfbSetCursor
(
rfbScreenInfoPtr
rfbScreen
,
rfbCursorPtr
c
,
Bool
freeOld
)
{
{
rfbClientIteratorPtr
i
=
rfbGetClientIterator
(
rfbScreen
);
rfbClientPtr
cl
;
LOCK
(
rfbScreen
->
cursorMutex
);
LOCK
(
rfbScreen
->
cursorMutex
);
rfbUndrawCursor
(
rfbScreen
);
while
((
cl
=
rfbClientIteratorNext
(
i
)))
{
LOCK
(
cl
->
updateMutex
);
rfbUndrawCursor
(
cl
);
UNLOCK
(
cl
->
updateMutex
);
}
if
(
freeOld
&&
rfbScreen
->
cursor
)
if
(
freeOld
&&
rfbScreen
->
cursor
)
rfbFreeCursor
(
rfbScreen
->
cursor
);
rfbFreeCursor
(
rfbScreen
->
cursor
);
...
...
example.c
View file @
018e90db
...
@@ -102,7 +102,7 @@ void doptr(int buttonMask,int x,int y,rfbClientPtr cl)
...
@@ -102,7 +102,7 @@ void doptr(int buttonMask,int x,int y,rfbClientPtr cl)
ClientData
*
cd
=
cl
->
clientData
;
ClientData
*
cd
=
cl
->
clientData
;
if
(
cl
->
screen
->
cursorIsDrawn
)
if
(
cl
->
screen
->
cursorIsDrawn
)
rfbUndrawCursor
(
cl
);
rfbUndrawCursor
(
cl
->
screen
);
if
(
x
>=
0
&&
y
>=
0
&&
x
<
maxx
&&
y
<
maxy
)
{
if
(
x
>=
0
&&
y
>=
0
&&
x
<
maxx
&&
y
<
maxy
)
{
if
(
buttonMask
)
{
if
(
buttonMask
)
{
...
@@ -149,14 +149,14 @@ void dokey(Bool down,KeySym key,rfbClientPtr cl)
...
@@ -149,14 +149,14 @@ void dokey(Bool down,KeySym key,rfbClientPtr cl)
rfbCloseClient
(
cl
);
rfbCloseClient
(
cl
);
else
if
(
key
==
XK_Page_Up
)
{
else
if
(
key
==
XK_Page_Up
)
{
if
(
cl
->
screen
->
cursorIsDrawn
)
if
(
cl
->
screen
->
cursorIsDrawn
)
rfbUndrawCursor
(
cl
);
rfbUndrawCursor
(
cl
->
screen
);
initBuffer
(
cl
->
screen
->
frameBuffer
);
initBuffer
(
cl
->
screen
->
frameBuffer
);
rfbMarkRectAsModified
(
cl
->
screen
,
0
,
0
,
maxx
,
maxy
);
rfbMarkRectAsModified
(
cl
->
screen
,
0
,
0
,
maxx
,
maxy
);
}
else
if
(
key
>=
' '
&&
key
<
0x100
)
{
}
else
if
(
key
>=
' '
&&
key
<
0x100
)
{
ClientData
*
cd
=
cl
->
clientData
;
ClientData
*
cd
=
cl
->
clientData
;
int
x1
=
cd
->
oldx
,
y1
=
cd
->
oldy
,
x2
,
y2
;
int
x1
=
cd
->
oldx
,
y1
=
cd
->
oldy
,
x2
,
y2
;
if
(
cl
->
screen
->
cursorIsDrawn
)
if
(
cl
->
screen
->
cursorIsDrawn
)
rfbUndrawCursor
(
cl
);
rfbUndrawCursor
(
cl
->
screen
);
cd
->
oldx
+=
rfbDrawChar
(
cl
->
screen
,
&
radonFont
,
cd
->
oldx
,
cd
->
oldy
,
key
,
0xffffff
);
cd
->
oldx
+=
rfbDrawChar
(
cl
->
screen
,
&
radonFont
,
cd
->
oldx
,
cd
->
oldy
,
key
,
0xffffff
);
rfbFontBBox
(
&
radonFont
,
key
,
&
x1
,
&
y1
,
&
x2
,
&
y2
);
rfbFontBBox
(
&
radonFont
,
key
,
&
x1
,
&
y1
,
&
x2
,
&
y2
);
rfbMarkRectAsModified
(
cl
->
screen
,
x1
,
y1
,
x2
-
1
,
y2
-
1
);
rfbMarkRectAsModified
(
cl
->
screen
,
x1
,
y1
,
x2
-
1
,
y2
-
1
);
...
...
main.c
View file @
018e90db
...
@@ -67,23 +67,29 @@ void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,in
...
@@ -67,23 +67,29 @@ void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,in
rfbClientIteratorPtr
iterator
;
rfbClientIteratorPtr
iterator
;
rfbClientPtr
cl
;
rfbClientPtr
cl
;
iterator
=
rfbGetClientIterator
(
rfbScreen
);
rfbUndrawCursor
(
rfbScreen
);
iterator
=
rfbGetClientIterator
(
rfbScreen
);
while
((
cl
=
rfbClientIteratorNext
(
iterator
)))
{
while
((
cl
=
rfbClientIteratorNext
(
iterator
)))
{
LOCK
(
cl
->
updateMutex
);
LOCK
(
cl
->
updateMutex
);
if
(
cl
->
useCopyRect
)
{
if
(
cl
->
useCopyRect
)
{
while
(
!
sraRgnEmpty
(
cl
->
copyRegion
)
&&
(
cl
->
copyDX
!=
dx
||
cl
->
copyDY
!=
dy
))
{
#ifdef HAVE_PTHREADS
if
(
cl
->
screen
->
backgroundLoop
)
{
SIGNAL
(
cl
->
updateCond
);
UNLOCK
(
cl
->
updateMutex
);
LOCK
(
cl
->
updateMutex
);
}
else
#endif
rfbSendFramebufferUpdate
(
cl
,
cl
->
copyRegion
);
}
sraRgnOr
(
cl
->
copyRegion
,
copyRegion
);
sraRgnOr
(
cl
->
copyRegion
,
copyRegion
);
cl
->
copyDX
=
dx
;
cl
->
copyDX
=
dx
;
cl
->
copyDY
=
dy
;
cl
->
copyDY
=
dy
;
#ifdef HAVE_PTHREADS
if
(
cl
->
screen
->
backgroundLoop
)
{
SIGNAL
(
cl
->
updateCond
);
UNLOCK
(
cl
->
updateMutex
);
LOCK
(
cl
->
updateMutex
);
}
else
#endif
{
sraRegionPtr
updateRegion
=
sraRgnCreateRgn
(
cl
->
modifiedRegion
);
sraRgnOr
(
updateRegion
,
cl
->
copyRegion
);
rfbSendFramebufferUpdate
(
cl
,
updateRegion
);
sraRgnDestroy
(
updateRegion
);
}
}
else
{
}
else
{
sraRgnOr
(
cl
->
modifiedRegion
,
copyRegion
);
sraRgnOr
(
cl
->
modifiedRegion
,
copyRegion
);
}
}
...
@@ -332,7 +338,7 @@ defaultPtrAddEvent(int buttonMask, int x, int y, rfbClientPtr cl)
...
@@ -332,7 +338,7 @@ defaultPtrAddEvent(int buttonMask, int x, int y, rfbClientPtr cl)
{
{
if
(
x
!=
cl
->
screen
->
cursorX
||
y
!=
cl
->
screen
->
cursorY
)
{
if
(
x
!=
cl
->
screen
->
cursorX
||
y
!=
cl
->
screen
->
cursorY
)
{
if
(
cl
->
screen
->
cursorIsDrawn
)
if
(
cl
->
screen
->
cursorIsDrawn
)
rfbUndrawCursor
(
cl
);
rfbUndrawCursor
(
cl
->
screen
);
LOCK
(
cl
->
screen
->
cursorMutex
);
LOCK
(
cl
->
screen
->
cursorMutex
);
if
(
!
cl
->
screen
->
cursorIsDrawn
)
{
if
(
!
cl
->
screen
->
cursorIsDrawn
)
{
cl
->
screen
->
cursorX
=
x
;
cl
->
screen
->
cursorX
=
x
;
...
...
rfb.h
View file @
018e90db
...
@@ -667,8 +667,8 @@ extern char* rfbMakeMaskForXCursor(int width,int height,char* cursorString);
...
@@ -667,8 +667,8 @@ extern char* rfbMakeMaskForXCursor(int width,int height,char* cursorString);
extern
void
MakeXCursorFromRichCursor
(
rfbScreenInfoPtr
rfbScreen
,
rfbCursorPtr
cursor
);
extern
void
MakeXCursorFromRichCursor
(
rfbScreenInfoPtr
rfbScreen
,
rfbCursorPtr
cursor
);
extern
void
MakeRichCursorFromXCursor
(
rfbScreenInfoPtr
rfbScreen
,
rfbCursorPtr
cursor
);
extern
void
MakeRichCursorFromXCursor
(
rfbScreenInfoPtr
rfbScreen
,
rfbCursorPtr
cursor
);
extern
void
rfbFreeCursor
(
rfbCursorPtr
cursor
);
extern
void
rfbFreeCursor
(
rfbCursorPtr
cursor
);
extern
void
rfbDrawCursor
(
rfb
ClientPtr
cl
);
extern
void
rfbDrawCursor
(
rfb
ScreenInfoPtr
rfbScreen
);
extern
void
rfbUndrawCursor
(
rfb
ClientPtr
cl
);
extern
void
rfbUndrawCursor
(
rfb
ScreenInfoPtr
rfbScreen
);
extern
void
rfbSetCursor
(
rfbScreenInfoPtr
rfbScreen
,
rfbCursorPtr
c
,
Bool
freeOld
);
extern
void
rfbSetCursor
(
rfbScreenInfoPtr
rfbScreen
,
rfbCursorPtr
c
,
Bool
freeOld
);
/* cursor handling for the pointer */
/* cursor handling for the pointer */
...
...
rfbserver.c
View file @
018e90db
...
@@ -857,14 +857,14 @@ rfbSendFramebufferUpdate(cl, givenUpdateRegion)
...
@@ -857,14 +857,14 @@ rfbSendFramebufferUpdate(cl, givenUpdateRegion)
if
(
cl
->
enableCursorShapeUpdates
)
{
if
(
cl
->
enableCursorShapeUpdates
)
{
if
(
cl
->
screen
->
cursorIsDrawn
)
{
if
(
cl
->
screen
->
cursorIsDrawn
)
{
rfbUndrawCursor
(
cl
);
rfbUndrawCursor
(
cl
->
screen
);
}
}
if
(
!
cl
->
screen
->
cursorIsDrawn
&&
cl
->
cursorWasChanged
&&
if
(
!
cl
->
screen
->
cursorIsDrawn
&&
cl
->
cursorWasChanged
&&
cl
->
readyForSetColourMapEntries
)
cl
->
readyForSetColourMapEntries
)
sendCursorShape
=
TRUE
;
sendCursorShape
=
TRUE
;
}
else
{
}
else
{
if
(
!
cl
->
screen
->
cursorIsDrawn
)
{
if
(
!
cl
->
screen
->
cursorIsDrawn
)
{
rfbDrawCursor
(
cl
);
rfbDrawCursor
(
cl
->
screen
);
}
}
}
}
...
@@ -1093,7 +1093,7 @@ rfbSendCopyRegion(cl, reg, dx, dy)
...
@@ -1093,7 +1093,7 @@ rfbSendCopyRegion(cl, reg, dx, dy)
sraRectangleIterator
*
i
;
sraRectangleIterator
*
i
;
sraRect
rect1
;
sraRect
rect1
;
i
=
sraRgnGetReverseIterator
(
reg
,
dx
<
0
,
dy
<
0
);
i
=
sraRgnGetReverseIterator
(
reg
,
dx
>
0
,
dy
>
0
);
while
(
sraRgnIteratorNext
(
i
,
&
rect1
))
{
while
(
sraRgnIteratorNext
(
i
,
&
rect1
))
{
x
=
rect1
.
x1
;
x
=
rect1
.
x1
;
...
@@ -1113,7 +1113,7 @@ rfbSendCopyRegion(cl, reg, dx, dy)
...
@@ -1113,7 +1113,7 @@ rfbSendCopyRegion(cl, reg, dx, dy)
cr
.
srcX
=
Swap16IfLE
(
x
-
dx
);
cr
.
srcX
=
Swap16IfLE
(
x
-
dx
);
cr
.
srcY
=
Swap16IfLE
(
y
-
dy
);
cr
.
srcY
=
Swap16IfLE
(
y
-
dy
);
fprintf
(
stderr
,
"sent copyrect (%d,%d) (%d,%d) (%d,%d)
\n
"
,
x
,
y
,
w
,
h
,
x
-
dx
,
y
-
dy
);
memcpy
(
&
cl
->
updateBuf
[
cl
->
ublen
],
(
char
*
)
&
cr
,
sz_rfbCopyRect
);
memcpy
(
&
cl
->
updateBuf
[
cl
->
ublen
],
(
char
*
)
&
cr
,
sz_rfbCopyRect
);
cl
->
ublen
+=
sz_rfbCopyRect
;
cl
->
ublen
+=
sz_rfbCopyRect
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment