Contents of /trunk/vnc/patches/vnc-server-selections.patch
Parent Directory | Revision Log
Revision 639 -
(show annotations)
(download)
Tue Jun 3 20:56:41 2008 UTC (16 years, 4 months ago) by niro
File size: 2761 byte(s)
Tue Jun 3 20:56:41 2008 UTC (16 years, 4 months ago) by niro
File size: 2761 byte(s)
-renamed patch
1 | diff -up vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/hw/vnc/vncExtInit.cc.selections vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/hw/vnc/vncExtInit.cc |
2 | --- vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/hw/vnc/vncExtInit.cc.selections 2008-03-10 15:34:24.000000000 +0100 |
3 | +++ vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/hw/vnc/vncExtInit.cc 2008-03-11 10:55:44.000000000 +0100 |
4 | @@ -62,11 +62,9 @@ extern "C" { |
5 | static void SendSelectionChangeEvent(Atom selection); |
6 | static int ProcVncExtDispatch(ClientPtr client); |
7 | static int SProcVncExtDispatch(ClientPtr client); |
8 | + static void vncSelectionCallback(CallbackListPtr *callbacks, pointer data, pointer args); |
9 | |
10 | extern char *display; |
11 | - |
12 | - extern Selection *CurrentSelections; |
13 | - extern int NumCurrentSelections; |
14 | } |
15 | |
16 | using namespace rfb; |
17 | @@ -99,7 +97,6 @@ struct VncInputSelect { |
18 | VncInputSelect* next; |
19 | }; |
20 | |
21 | -static int nPrevSelections = 0; |
22 | static TimeStamp* prevSelectionTimes = 0; |
23 | |
24 | static int vncErrorBase = 0; |
25 | @@ -147,6 +144,10 @@ void vncExtensionInit() |
26 | FatalError("AddCallback failed\n"); |
27 | } |
28 | |
29 | + if (!AddCallback(&SelectionCallback, vncSelectionCallback, 0)) { |
30 | + FatalError("Add selection callback failed\n"); |
31 | + } |
32 | + |
33 | try { |
34 | if (!initialised) { |
35 | rfb::initStdIOLoggers(); |
36 | @@ -212,6 +213,14 @@ static void vncResetProc(ExtensionEntry* |
37 | { |
38 | } |
39 | |
40 | +static void vncSelectionCallback(CallbackListPtr *callbacks, pointer data, pointer args) |
41 | +{ |
42 | + SelectionInfoRec *info = (SelectionInfoRec *) args; |
43 | + Selection *selection = info->selection; |
44 | + |
45 | + SendSelectionChangeEvent(selection->selection); |
46 | +} |
47 | + |
48 | // |
49 | // vncBlockHandler - called just before the X server goes into select(). Call |
50 | // on to the block handler for each desktop. Then check whether any of the |
51 | @@ -227,27 +236,6 @@ static void vncBlockHandler(pointer data |
52 | desktop[scr]->blockHandler(fds); |
53 | } |
54 | } |
55 | - |
56 | - if (nPrevSelections != NumCurrentSelections) { |
57 | - prevSelectionTimes |
58 | - = (TimeStamp*)xnfrealloc(prevSelectionTimes, |
59 | - NumCurrentSelections * sizeof(TimeStamp)); |
60 | - for (int i = nPrevSelections; i < NumCurrentSelections; i++) { |
61 | - prevSelectionTimes[i].months = 0; |
62 | - prevSelectionTimes[i].milliseconds = 0; |
63 | - } |
64 | - nPrevSelections = NumCurrentSelections; |
65 | - } |
66 | - for (int i = 0; i < NumCurrentSelections; i++) { |
67 | - if (CurrentSelections[i].lastTimeChanged.months |
68 | - != prevSelectionTimes[i].months || |
69 | - CurrentSelections[i].lastTimeChanged.milliseconds |
70 | - != prevSelectionTimes[i].milliseconds) |
71 | - { |
72 | - SendSelectionChangeEvent(CurrentSelections[i].selection); |
73 | - prevSelectionTimes[i] = CurrentSelections[i].lastTimeChanged; |
74 | - } |
75 | - } |
76 | } |
77 | |
78 | static void vncWakeupHandler(pointer data, int nfds, pointer readmask) |