Unverified Commit 3a3a3373 authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'uli42-pr/various2' into 3.6.x

parents 796c8e42 085f8a4f
......@@ -4,7 +4,7 @@ backported, it rather describes what functionality level the modules
are at (roughly):
module xorg version
composite 6.9/7.0
composite 1.12 (~ 9838b70 2012-03-21 Introduce a consistent coding style [Keith Packard])
damageext 6.9/7.0
dbe 1.4.2
dix 1.3.0.0
......@@ -12,7 +12,7 @@ fb 7.1/1.1
GL 6.9/7.0
mi 7.1/1.1
miext 7.1/1.1
os 7.1/1.1
os ? 7.1/1.1 + many backports, some of them from 2017
randr 1.18.0
record 1.4.2
render 6.9/7.0
......
......@@ -407,6 +407,9 @@ Dispatch(void)
}
/* now, finally, deal with client requests */
/* Update currentTime so request time checks, such as for input
* device grabs, are calculated correctly */
UpdateCurrentTimeIf();
result = ReadRequestFromClient(client);
if (result <= 0)
{
......
......@@ -655,6 +655,7 @@ ProcListProperties(ClientPtr client)
return(client->noClientException);
}
#ifndef NXAGENT_SERVER
int
ProcDeleteProperty(register ClientPtr client)
{
......@@ -692,3 +693,4 @@ ProcDeleteProperty(register ClientPtr client)
else
return(result);
}
#endif
......@@ -41,7 +41,7 @@ extern Bool nxagentWMIsRunning;
* to the agent server.
*/
int nxagentInitAtoms(WindowPtr pWin);
void nxagentInitAtoms();
/*
* Query and create all the required atoms
......
......@@ -74,9 +74,9 @@ Atom serverCutProperty;
Atom clientCutProperty;
static Window serverWindow;
static const int nxagentPrimarySelection = 0;
static const int nxagentClipboardSelection = 1;
static const int nxagentMaxSelections = 2;
const int nxagentPrimarySelection = 0;
const int nxagentClipboardSelection = 1;
const int nxagentMaxSelections = 2;
typedef struct _SelectionOwner
{
......@@ -217,7 +217,7 @@ void nxagentPrintSelectionStat(int sel)
{
SelectionOwner lOwner = lastSelectionOwner[sel];
Selection curSel = CurrentSelections[sel];
char *s =NULL;
char *s = NULL;
#ifdef CLIENTIDS
fprintf(stderr, " lastSelectionOwner[].client [%p] index [%d] PID [%d] Cmd [%s]\n",
......@@ -304,8 +304,8 @@ void nxagentPrintClipboardStat(char *header)
fprintf(stderr, " lastClientProperty (Atom) [% 4d][%s]\n", lastClientProperty, NameForAtom(lastClientProperty));
fprintf(stderr, " lastClientSelection (Atom) [% 4d][%s]\n", lastClientSelection, NameForAtom(lastClientSelection));
fprintf(stderr, " lastClientTarget (Atom) [% 4d][%s]\n", lastClientTarget, NameForAtom(lastClientTarget));
fprintf(stderr, " lastClientTime (Time) [%u]\n", lastServerTime);
fprintf(stderr, " lastClientReqTime (Time) [%u]\n", lastServerReqTime);
fprintf(stderr, " lastClientTime (Time) [%u]\n", lastClientTime);
fprintf(stderr, " lastClientReqTime (Time) [%u]\n", lastClientReqTime);
fprintf(stderr, " lastClientPropertySize (unsigned long) [%lu]\n", lastClientPropertySize);
fprintf(stderr, " lastClientStage (ClientSelectionStage) [%d][%s]\n", lastClientStage, GetClientSelectionStageString(lastClientStage));
......@@ -617,7 +617,7 @@ FIXME: Do we need this?
}
else
{
if (lastSelectionOwner[i].client != NULL &&
if (lastSelectionOwner[i].client != NULL &&
nxagentOption(Clipboard) != ClipboardClient)
{
xEvent x;
......@@ -913,7 +913,7 @@ void nxagentCollectPropertyEvent(int resource)
SAFE_XFree(pszReturnData);
return;
}
if (resultFormat != 8 && resultFormat != 16 && resultFormat != 32)
{
#ifdef DEBUG
......@@ -1571,10 +1571,10 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
x.u.selectionNotify.selection = selection;
x.u.selectionNotify.target = target;
x.u.selectionNotify.property = property;
(void) TryClientEvents(client, &x, 1, NoEventMask,
NoEventMask , NullGrab);
return 1;
}
......
......@@ -2803,11 +2803,11 @@ Bool nxagentReconnectDisplay(void *p0)
#endif
nxagentConfineWindow = XCreateWindow(nxagentDisplay,
DefaultRootWindow(nxagentDisplay),
0, 0, 1, 1, 0, 0,
InputOnly,
CopyFromParent,
0L, NULL);
DefaultRootWindow(nxagentDisplay),
0, 0, 1, 1, 0, 0,
InputOnly,
CopyFromParent,
0L, NULL);
if (nxagentReportWindowIds) {
fprintf(stderr, "NXAGENT_WINDOW_ID: CONFINEMENT_WINDOW,WID:[0x%x]\n",
......
......@@ -1692,6 +1692,7 @@ char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution)
const char *s;
int field;
/* FIXME: use str(n)dup()? */
if ((scalableFontName = malloc(strlen(fontName) + 1)) == NULL)
{
#ifdef PANIC
......
......@@ -185,8 +185,6 @@ void nxagentApplyPlaceholder(Drawable drawable, int x, int y,
}
XFreeGC(nxagentDisplay, gc);
return;
}
#ifdef DUMP
......
......@@ -644,23 +644,23 @@ FIXME: Should use these.
pDrawable -> depth != 1 &&
nxagentOption(DeferLevel) >= 1)
{
/* -- changed by dimbor (small "bed-sheets" never need be prevented - always put) --*/
if (dstHeight > 16)
{
/* -------------------------------------------------------------------------------- */
#ifdef TEST
fprintf(stderr, "nxagentPutImage: WARNING! Prevented operation on region [%d,%d,%d,%d] "
"for drawable at [%p] with drawable pixmap.\n", pRegion -> extents.x1,
pRegion -> extents.y1, pRegion -> extents.x2, pRegion -> extents.y2,
(void *) pDrawable);
#endif
/* -- changed by dimbor (small "bed-sheets" never need be prevented - always put) --*/
if (dstHeight > 16)
{
/* -------------------------------------------------------------------------------- */
#ifdef TEST
fprintf(stderr, "nxagentPutImage: WARNING! Prevented operation on region [%d,%d,%d,%d] "
"for drawable at [%p] with drawable pixmap.\n", pRegion -> extents.x1,
pRegion -> extents.y1, pRegion -> extents.x2, pRegion -> extents.y2,
(void *) pDrawable);
#endif
nxagentMarkCorruptedRegion(pDrawable, pRegion);
nxagentMarkCorruptedRegion(pDrawable, pRegion);
goto nxagentPutImageEnd;
/* --- changed by dimbor ---*/
}
/* ------------------------- */
goto nxagentPutImageEnd;
/* --- changed by dimbor ---*/
}
/* ------------------------- */
}
if (pDrawable -> type == DRAWABLE_WINDOW &&
......
......@@ -203,18 +203,43 @@ INCLUDES = \
### NXAGENT Defines:
#
# NXAGENT_FONTCACHE_SIZE Number of cache slots
# NXAGENT_SHAPE Old shape code
# NXAGENT_GLYPHCACHE
# NXAGENT_GLYPHCACHE_SIZE Slots for glyph cache
# NXAGENT_SHAPE2 New shape code
# NXAGENT_FIXKEYS Force the release of pressed key when losing focus
# NXAGENT_EXPOSURES Manage expose events
# NXAGENT_SHAPE Old shape code
# NXAGENT_SHAPE2 New shape code
# NXAGENT_FIXKEYS Force the release of pressed key when losing focus
# NXAGENT_CLIPBOARD Enables clipboard cut and paste function between X servers.
# NXAGENT_FONTEXCLUDE Exclude some specific font names (only "-ult1mo" at this moment).
# NXAGENT FULLSCREEN Fullscreen mode
# NXAGENT_RANDR_MODE_PREFIX Use prefixed (i.e., nx_<x>x<y>) RandR modes
# NXAGENT_RANDR_MODE_PREFIX Prefix for RandR modes (i.e., nx_<x>x<y>) (default: nx_)
# NXAGENT_RANDR_XINERAMA_CLIPPING cut off invisible window parts in xinerama mode (you probably do not want this)
# NXAGENT_TIMESTAMP print duration for some routines
#
### macros not investigated yet:
#
# NXAGENT_PICTURE_ALWAYS_POINTS_TO_VIRTUAL
# NXAGENT_RENDER_CLEANUP
# NXAGENT_WAKEUP=<milliseconds>
# NXAGENT_ONSTART
# NXAGENT_SPLASH
# NXAGENT_ARTSD
#
### Debug macros:
#
# DEBUG_COLORMAP
# DEBUG_TREE
# NXAGENT_DEBUG
# NXAGENT_FIXKEYS_DEBUG
# NXAGENT_FONTCACHE_DEBUG
# NXAGENT_FONTMATCH_DEBUG
# NXAGENT_LOGO_DEBUG
# NXAGENT_RECONNECT_COLORMAP_DEBUG
# NXAGENT_RECONNECT_CURSOR_DEBUG
# NXAGENT_RECONNECT_DEBUG
# NXAGENT_RECONNECT_DISPLAY_DEBUG
# NXAGENT_RECONNECT_FONT_DEBUG
# NXAGENT_RECONNECT_PICTFORMAT_DEBUG
# NXAGENT_RECONNECT_PICTURE_DEBUG
# NXAGENT_RECONNECT_SCREEN_DEBUG
# NXAGENT_RECONNECT_WINDOW_DEBUG
# NXAGENT_XKBD_DEBUG
# NX_DEBUG_INPUT
#if nxVersion
NX_DEFINES = \
......@@ -224,34 +249,26 @@ NX_DEFINES = \
#endif
DEFINES = \
-g $(OS_DEFINES) $(EXT_DEFINES) $(NX_DEFINES) \
-g $(OS_DEFINES) $(EXT_DEFINES) $(NX_DEFINES) \
-UXF86VIDMODE -UXFreeXDGA -UXF86MISC -UXF86DRI \
-DNXAGENT_SERVER \
-DNXAGENT_CONSTRAINCURSOR \
-DNXAGENT_FONTCACHE_SIZE=50 \
-DNXAGENT_GLYPHCACHE -DNXAGENT_GLYPHCACHE_SIZE=50 \
-DNXAGENT_RENDER_CLEANUP \
-DNXAGENT_SHAPE2 \
-DNXAGENT_FIXKEYS \
-DNXAGENT_CLIPBOARD \
-DNXAGENT_EXPOSURES \
-DNXAGENT_FONTEXCLUDE \
-DNXAGENT_PACKEDIMAGES \
-DNXAGENT_VISIBILITY \
-DNXAGENT_WAKEUP=1000 \
-DNXAGENT_ONSTART \
-DNXAGENT_ARTSD \
-DNXAGENT_RANDR_MODE_PREFIX \
-UNX_DEBUG_INPUT \
-DRANDR_10_INTERFACE=1 \
-DRANDR_12_INTERFACE=1 \
-DRANDR_13_INTERFACE=1 \
-DRANDR_14_INTERFACE=1 \
-DRANDR_15_INTERFACE=1 \
-DRANDR_10_INTERFACE=1 \
-DRANDR_12_INTERFACE=1 \
-DRANDR_13_INTERFACE=1 \
-DRANDR_14_INTERFACE=1 \
-DRANDR_15_INTERFACE=1 \
-DPANORAMIX \
-UDEBUG_TREE \
-DSYSTEMFONTDIR=\"$(SYSTEMFONTDIR)\" \
$(NULL)
$(NULL)
all:: $(OBJS)
......
......@@ -71,6 +71,7 @@ is" without express or implied warranty.
#include "Millis.h"
#include "Error.h"
#include "Keystroke.h"
#include "Atoms.h"
#include <nx/NX.h>
#include "compext/Compext.h"
......@@ -148,6 +149,8 @@ extern void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data,
void *args);
#endif
extern const char *nxagentProgName;
void ddxInitGlobals(void)
{
/*
......@@ -199,8 +202,6 @@ Bool nxagentX2go;
void checkX2goAgent(void)
{
extern const char *nxagentProgName;
#ifdef TEST
fprintf(stderr, "%s: nxagentProgName [%s]\n", __func__, nxagentProgName);
#endif
......@@ -221,15 +222,6 @@ void checkX2goAgent(void)
void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[])
{
char *authority;
int i;
#ifdef __sun
char *environment;
#endif
/*
* Print our pid and version information.
*/
......@@ -295,11 +287,13 @@ void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[])
}
#endif
if ((authority = getenv("NX_XAUTHORITY")))
char *authority = getenv("NX_XAUTHORITY");
if (authority)
{
#ifdef __sun
environment = malloc(15 + strlen(authority));
char *environment = malloc(15 + strlen(authority));
sprintf(environment, "XAUTHORITY=%s", authority);
......@@ -391,7 +385,7 @@ FIXME: These variables, if not removed at all because have probably
nxagentNumScreens = 1;
}
for (i = 0; i < nxagentNumScreens; i++)
for (int i = 0; i < nxagentNumScreens; i++)
{
AddScreen(nxagentOpenScreen, argc, argv);
}
......@@ -421,6 +415,8 @@ FIXME: These variables, if not removed at all because have probably
#ifdef NXAGENT_CLIPBOARD
AddCallback(&SelectionCallback, nxagentSetSelectionCallback, NULL);
#endif
nxagentInitAtoms();
}
void
......
......@@ -188,261 +188,57 @@ static void nxagentCheckRemoteKeycodes(void);
static CARD8 nxagentConvertedKeycodes[] =
{
/* evdev pc105*/
/* 0 */ 0,
/* 1 */ 1,
/* 2 */ 2,
/* 3 */ 3,
/* 4 */ 4,
/* 5 */ 5,
/* 6 */ 6,
/* 7 */ 7,
/* 8 */ 8,
/* 9 */ 9,
/* 10 */ 10,
/* 11 */ 11,
/* 12 */ 12,
/* 13 */ 13,
/* 14 */ 14,
/* 15 */ 15,
/* 16 */ 16,
/* 17 */ 17,
/* 18 */ 18,
/* 19 */ 19,
/* 20 */ 20,
/* 21 */ 21,
/* 22 */ 22,
/* 23 */ 23,
/* 24 */ 24,
/* 25 */ 25,
/* 26 */ 26,
/* 27 */ 27,
/* 28 */ 28,
/* 29 */ 29,
/* 30 */ 30,
/* 31 */ 31,
/* 32 */ 32,
/* 33 */ 33,
/* 34 */ 34,
/* 35 */ 35,
/* 36 */ 36,
/* 37 */ 37,
/* 38 */ 38,
/* 39 */ 39,
/* 40 */ 40,
/* 41 */ 41,
/* 42 */ 42,
/* 43 */ 43,
/* 44 */ 44,
/* 45 */ 45,
/* 46 */ 46,
/* 47 */ 47,
/* 48 */ 48,
/* 49 */ 49,
/* 50 */ 50,
/* 51 */ 51,
/* 52 */ 52,
/* 53 */ 53,
/* 54 */ 54,
/* 55 */ 55,
/* 56 */ 56,
/* 57 */ 57,
/* 58 */ 58,
/* 59 */ 59,
/* 60 */ 60,
/* 61 */ 61,
/* 62 */ 62,
/* 63 */ 63,
/* 64 */ 64,
/* 65 */ 65,
/* 66 */ 66,
/* 67 */ 67,
/* 68 */ 68,
/* 69 */ 69,
/* 70 */ 70,
/* 71 */ 71,
/* 72 */ 72,
/* 73 */ 73,
/* 74 */ 74,
/* 75 */ 75,
/* 76 */ 76,
/* 77 */ 77,
/* 78 */ 78,
/* 79 */ 79,
/* 80 */ 80,
/* 81 */ 81,
/* 82 */ 82,
/* 83 */ 83,
/* 84 */ 84,
/* 85 */ 85,
/* 86 */ 86,
/* 87 */ 87,
/* 88 */ 88,
/* 89 */ 89,
/* 90 */ 90,
/* 91 */ 91,
/* 92 */ 124,
/* 93 */ 93,
/* 94 */ 94,
/* 95 */ 95,
/* 96 */ 96,
/* 97 */ 211,
/* 98 */ 98,
/* 99 */ 99,
/* 100 */ 100,
/* 101 */ 208,
/* 102 */ 102,
/* 103 */ 103,
/* 104 */ 108,
/* 105 */ 109,
/* 106 */ 112,
/* 107 */ 111,
/* 108 */ 113,
/* 109 */ 109,
/* 110 */ 97,
/* 111 */ 98,
/* 112 */ 99,
/* 113 */ 100,
/* 114 */ 102,
/* 115 */ 103,
/* 116 */ 104,
/* 117 */ 105,
/* 118 */ 106,
/* 119 */ 107,
/* 120 */ 120,
/* 121 */ 121,
/* 122 */ 122,
/* 123 */ 123,
/* 124 */ 124,
/* 125 */ 126,
/* 126 */ 126,
/* 127 */ 110,
/* 128 */ 128,
/* 129 */ 129,
/* 130 */ 130,
/* 131 */ 131,
/* 132 */ 133,
/* 133 */ 115,
/* 134 */ 116,
/* 135 */ 117,
/* 136 */ 136,
/* 137 */ 137,
/* 138 */ 138,
/* 139 */ 139,
/* 140 */ 140,
/* 141 */ 141,
/* 142 */ 142,
/* 143 */ 143,
/* 144 */ 144,
/* 145 */ 145,
/* 146 */ 146,
/* 147 */ 147,
/* 148 */ 148,
/* 149 */ 149,
/* 150 */ 150,
/* 151 */ 151,
/* 152 */ 152,
/* 153 */ 153,
/* 154 */ 154,
/* 155 */ 155,
/* 156 */ 156,
/* 157 */ 157,
/* 158 */ 158,
/* 159 */ 159,
/* 160 */ 160,
/* 161 */ 161,
/* 162 */ 162,
/* 163 */ 163,
/* 164 */ 164,
/* 165 */ 165,
/* 166 */ 166,
/* 167 */ 167,
/* 168 */ 168,
/* 169 */ 169,
/* 170 */ 170,
/* 171 */ 171,
/* 172 */ 172,
/* 173 */ 173,
/* 174 */ 174,
/* 175 */ 175,
/* 176 */ 176,
/* 177 */ 177,
/* 178 */ 178,
/* 179 */ 179,
/* 180 */ 180,
/* 181 */ 181,
/* 182 */ 182,
/* 183 */ 183,
/* 184 */ 184,
/* 185 */ 185,
/* 186 */ 186,
/* 187 */ 187,
/* 188 */ 188,
/* 189 */ 189,
/* 190 */ 190,
/* 191 */ 118,
/* 192 */ 119,
/* 193 */ 120,
/* 194 */ 121,
/* 195 */ 122,
/* 196 */ 196,
/* 197 */ 197,
/* 198 */ 198,
/* 199 */ 199,
/* 200 */ 200,
/* 201 */ 201,
/* 202 */ 202,
/* 203 */ 93,
/* 204 */ 125,
/* 205 */ 156,
/* 206 */ 127,
/* 207 */ 128,
/* 208 */ 208,
/* 209 */ 209,
/* 210 */ 210,
/* 211 */ 211,
/* 212 */ 212,
/* 213 */ 213,
/* 214 */ 214,
/* 215 */ 215,
/* 216 */ 216,
/* 217 */ 217,
/* 218 */ 218,
/* 219 */ 219,
/* 220 */ 220,
/* 221 */ 221,
/* 222 */ 222,
/* 223 */ 223,
/* 224 */ 224,
/* 225 */ 225,
/* 226 */ 226,
/* 227 */ 227,
/* 228 */ 228,
/* 229 */ 229,
/* 230 */ 230,
/* 231 */ 231,
/* 232 */ 232,
/* 233 */ 233,
/* 234 */ 234,
/* 235 */ 235,
/* 236 */ 236,
/* 237 */ 237,
/* 238 */ 238,
/* 239 */ 239,
/* 240 */ 240,
/* 241 */ 241,
/* 242 */ 242,
/* 243 */ 243,
/* 244 */ 244,
/* 245 */ 245,
/* 246 */ 246,
/* 247 */ 247,
/* 248 */ 248,
/* 249 */ 249,
/* 250 */ 250,
/* 251 */ 251,
/* 252 */ 252,
/* 253 */ 253,
/* 254 */ 254,
/* 0 */ 0, /* 1 */ 1, /* 2 */ 2, /* 3 */ 3, /* 4 */ 4,
/* 5 */ 5, /* 6 */ 6, /* 7 */ 7, /* 8 */ 8, /* 9 */ 9,
/* 10 */ 10, /* 11 */ 11, /* 12 */ 12, /* 13 */ 13, /* 14 */ 14,
/* 15 */ 15, /* 16 */ 16, /* 17 */ 17, /* 18 */ 18, /* 19 */ 19,
/* 20 */ 20, /* 21 */ 21, /* 22 */ 22, /* 23 */ 23, /* 24 */ 24,
/* 25 */ 25, /* 26 */ 26, /* 27 */ 27, /* 28 */ 28, /* 29 */ 29,
/* 30 */ 30, /* 31 */ 31, /* 32 */ 32, /* 33 */ 33, /* 34 */ 34,
/* 35 */ 35, /* 36 */ 36, /* 37 */ 37, /* 38 */ 38, /* 39 */ 39,
/* 40 */ 40, /* 41 */ 41, /* 42 */ 42, /* 43 */ 43, /* 44 */ 44,
/* 45 */ 45, /* 46 */ 46, /* 47 */ 47, /* 48 */ 48, /* 49 */ 49,
/* 50 */ 50, /* 51 */ 51, /* 52 */ 52, /* 53 */ 53, /* 54 */ 54,
/* 55 */ 55, /* 56 */ 56, /* 57 */ 57, /* 58 */ 58, /* 59 */ 59,
/* 60 */ 60, /* 61 */ 61, /* 62 */ 62, /* 63 */ 63, /* 64 */ 64,
/* 65 */ 65, /* 66 */ 66, /* 67 */ 67, /* 68 */ 68, /* 69 */ 69,
/* 70 */ 70, /* 71 */ 71, /* 72 */ 72, /* 73 */ 73, /* 74 */ 74,
/* 75 */ 75, /* 76 */ 76, /* 77 */ 77, /* 78 */ 78, /* 79 */ 79,
/* 80 */ 80, /* 81 */ 81, /* 82 */ 82, /* 83 */ 83, /* 84 */ 84,
/* 85 */ 85, /* 86 */ 86, /* 87 */ 87, /* 88 */ 88, /* 89 */ 89,
/* 90 */ 90, /* 91 */ 91, /* 92 */ 124, /* 93 */ 93, /* 94 */ 94,
/* 95 */ 95, /* 96 */ 96, /* 97 */ 211, /* 98 */ 98, /* 99 */ 99,
/* 100 */ 100, /* 101 */ 208, /* 102 */ 102, /* 103 */ 103, /* 104 */ 108,
/* 105 */ 109, /* 106 */ 112, /* 107 */ 111, /* 108 */ 113, /* 109 */ 109,
/* 110 */ 97, /* 111 */ 98, /* 112 */ 99, /* 113 */ 100, /* 114 */ 102,
/* 115 */ 103, /* 116 */ 104, /* 117 */ 105, /* 118 */ 106, /* 119 */ 107,
/* 120 */ 120, /* 121 */ 121, /* 122 */ 122, /* 123 */ 123, /* 124 */ 124,
/* 125 */ 126, /* 126 */ 126, /* 127 */ 110, /* 128 */ 128, /* 129 */ 129,
/* 130 */ 130, /* 131 */ 131, /* 132 */ 133, /* 133 */ 115, /* 134 */ 116,
/* 135 */ 117, /* 136 */ 136, /* 137 */ 137, /* 138 */ 138, /* 139 */ 139,
/* 140 */ 140, /* 141 */ 141, /* 142 */ 142, /* 143 */ 143, /* 144 */ 144,
/* 145 */ 145, /* 146 */ 146, /* 147 */ 147, /* 148 */ 148, /* 149 */ 149,
/* 150 */ 150, /* 151 */ 151, /* 152 */ 152, /* 153 */ 153, /* 154 */ 154,
/* 155 */ 155, /* 156 */ 156, /* 157 */ 157, /* 158 */ 158, /* 159 */ 159,
/* 160 */ 160, /* 161 */ 161, /* 162 */ 162, /* 163 */ 163, /* 164 */ 164,
/* 165 */ 165, /* 166 */ 166, /* 167 */ 167, /* 168 */ 168, /* 169 */ 169,
/* 170 */ 170, /* 171 */ 171, /* 172 */ 172, /* 173 */ 173, /* 174 */ 174,
/* 175 */ 175, /* 176 */ 176, /* 177 */ 177, /* 178 */ 178, /* 179 */ 179,
/* 180 */ 180, /* 181 */ 181, /* 182 */ 182, /* 183 */ 183, /* 184 */ 184,
/* 185 */ 185, /* 186 */ 186, /* 187 */ 187, /* 188 */ 188, /* 189 */ 189,
/* 190 */ 190, /* 191 */ 118, /* 192 */ 119, /* 193 */ 120, /* 194 */ 121,
/* 195 */ 122, /* 196 */ 196, /* 197 */ 197, /* 198 */ 198, /* 199 */ 199,
/* 200 */ 200, /* 201 */ 201, /* 202 */ 202, /* 203 */ 93, /* 204 */ 125,
/* 205 */ 156, /* 206 */ 127, /* 207 */ 128, /* 208 */ 208, /* 209 */ 209,
/* 210 */ 210, /* 211 */ 211, /* 212 */ 212, /* 213 */ 213, /* 214 */ 214,
/* 215 */ 215, /* 216 */ 216, /* 217 */ 217, /* 218 */ 218, /* 219 */ 219,
/* 220 */ 220, /* 221 */ 221, /* 222 */ 222, /* 223 */ 223, /* 224 */ 224,
/* 225 */ 225, /* 226 */ 226, /* 227 */ 227, /* 228 */ 228, /* 229 */ 229,
/* 230 */ 230, /* 231 */ 231, /* 232 */ 232, /* 233 */ 233, /* 234 */ 234,
/* 235 */ 235, /* 236 */ 236, /* 237 */ 237, /* 238 */ 238, /* 239 */ 239,
/* 240 */ 240, /* 241 */ 241, /* 242 */ 242, /* 243 */ 243, /* 244 */ 244,
/* 245 */ 245, /* 246 */ 246, /* 247 */ 247, /* 248 */ 248, /* 249 */ 249,
/* 250 */ 250, /* 251 */ 251, /* 252 */ 252, /* 253 */ 253, /* 254 */ 254,
/* 255 */ 255
};
......
......@@ -194,6 +194,13 @@ extern int nxagentMaxAllowedResets;
extern int nxagentFindClientResource(int, RESTYPE, void *);
#ifdef NXAGENT_CLIPBOARD
extern int nxagentPrimarySelection;
extern int nxagentClipboardSelection;
extern int nxagentMaxSelections;
#endif
extern int nxOpenFont(ClientPtr, XID, Mask, unsigned, char*);
void
InitSelections()
......@@ -206,23 +213,23 @@ InitSelections()
#ifdef NXAGENT_CLIPBOARD
{
Selection *newsels;
newsels = (Selection *)malloc(2 * sizeof(Selection));
newsels = (Selection *)malloc(nxagentMaxSelections * sizeof(Selection));
if (!newsels)
return;
NumCurrentSelections += 2;
NumCurrentSelections += nxagentMaxSelections;
CurrentSelections = newsels;
CurrentSelections[0].selection = XA_PRIMARY;
CurrentSelections[0].lastTimeChanged = ClientTimeToServerTime(0);
CurrentSelections[0].window = screenInfo.screens[0]->root->drawable.id;
CurrentSelections[0].pWin = NULL;
CurrentSelections[0].client = NullClient;
CurrentSelections[1].selection = MakeAtom("CLIPBOARD", 9, 1);
CurrentSelections[1].lastTimeChanged = ClientTimeToServerTime(0);
CurrentSelections[1].window = screenInfo.screens[0]->root->drawable.id;
CurrentSelections[1].pWin = NULL;
CurrentSelections[1].client = NullClient;
CurrentSelections[nxagentPrimarySelection].selection = XA_PRIMARY;
CurrentSelections[nxagentPrimarySelection].lastTimeChanged = ClientTimeToServerTime(0);
CurrentSelections[nxagentPrimarySelection].window = screenInfo.screens[0]->root->drawable.id;
CurrentSelections[nxagentPrimarySelection].pWin = NULL;
CurrentSelections[nxagentPrimarySelection].client = NullClient;
CurrentSelections[nxagentClipboardSelection].selection = MakeAtom("CLIPBOARD", 9, 1);
CurrentSelections[nxagentClipboardSelection].lastTimeChanged = ClientTimeToServerTime(0);
CurrentSelections[nxagentClipboardSelection].window = screenInfo.screens[0]->root->drawable.id;
CurrentSelections[nxagentClipboardSelection].pWin = NULL;
CurrentSelections[nxagentClipboardSelection].client = NullClient;
}
#endif
......@@ -769,7 +776,6 @@ ProcOpenFont(register ClientPtr client)
fontReq[stuff->nbytes]=0;
if (strchr(fontReq,'*') || strchr(fontReq,'?'))
{
extern int nxOpenFont(ClientPtr, XID, Mask, unsigned, char*);
#ifdef NXAGENT_FONTMATCH_DEBUG
fprintf(stderr, "Dispatch: ProcOpenFont try to find a common font with font pattern=%s\n",fontReq);
#endif
......
......@@ -88,13 +88,7 @@ static Bool doListFontsAndAliases(ClientPtr client, LFclosurePtr c);
#include "Agent.h"
#include "Font.h"
#ifndef NX_TRANS_SOCKET
#define NX_TRANS_SOCKET
#endif
#ifdef NX_TRANS_SOCKET
#ifdef NXAGENT_SERVER
#define NXFONTPATHLENGTH 1024
char _NXFontPath[NXFONTPATHLENGTH];
......@@ -107,8 +101,6 @@ char _NXFontPath[NXFONTPATHLENGTH];
static const char *_NXGetFontPath(const char *path)
{
const char *fontEnv;
/*
* Check the environment only once.
*/
......@@ -118,13 +110,13 @@ static const char *_NXGetFontPath(const char *path)
return _NXFontPath;
}
fontEnv = getenv("NX_FONT");
const char *fontEnv = getenv("NX_FONT");
if (fontEnv != NULL && *fontEnv != '\0')
{
if (strlen(fontEnv) + 1 > NXFONTPATHLENGTH)
{
#ifdef NX_TRANS_TEST
#ifdef TEST
fprintf(stderr, "_NXGetFontPath: WARNING! Maximum length of font path exceeded.\n");
#endif
goto _NXGetFontPathError;
......@@ -132,7 +124,7 @@ static const char *_NXGetFontPath(const char *path)
snprintf(_NXFontPath, NXFONTPATHLENGTH, "%s", fontEnv);
#ifdef NX_TRANS_TEST
#ifdef TEST
fprintf(stderr, "_NXGetFontPath: Using NX font path [%s].\n", _NXFontPath);
#endif
......@@ -143,7 +135,7 @@ _NXGetFontPathError:
snprintf(_NXFontPath, NXFONTPATHLENGTH, "%s", path);
#ifdef NX_TRANS_TEST
#ifdef TEST
fprintf(stderr, "_NXGetFontPath: Using default font path [%s].\n", _NXFontPath);
#endif
......@@ -1003,9 +995,9 @@ SetDefaultFontPath(char *path)
size = 0,
bad;
#ifdef NX_TRANS_SOCKET
#ifdef NXAGENT_SERVER
path = (char *) _NXGetFontPath(path);
#endif /* NX_TRANS_SOCKET */
#endif /* NXAGENT_SERVER */
start = path;
......
......@@ -147,6 +147,16 @@ extern Display *nxagentDisplay;
extern WindowPtr nxagentLastEnteredWindow;
#ifdef VIEWPORT_FRAME
extern void nxagentInitViewportFrame(ScreenPtr, WindowPtr);
#endif
extern int nxagentShadowInit(ScreenPtr, WindowPtr);
#ifdef NXAGENT_CLIPBOARD
extern int nxagentSendNotify(xEvent*);
#endif
void
ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab,
TimeStamp time, Bool autoGrab)
......@@ -466,11 +476,6 @@ void
DefineInitialRootWindow(register WindowPtr win)
{
register ScreenPtr pScreen = win->drawable.pScreen;
#ifdef VIEWPORT_FRAME
extern void nxagentInitViewportFrame(ScreenPtr, WindowPtr);
#endif
extern int nxagentShadowInit(ScreenPtr, WindowPtr);
sprite.hotPhys.pScreen = pScreen;
sprite.hotPhys.x = pScreen->width / 2;
sprite.hotPhys.y = pScreen->height / 2;
......@@ -537,7 +542,6 @@ ProcSendEvent(ClientPtr client)
if (stuff -> event.u.u.type == SelectionNotify)
{
extern int nxagentSendNotify(xEvent*);
if (nxagentSendNotify(&stuff->event) == 1)
return Success;
}
......
......@@ -81,6 +81,8 @@ void *nxagentMatchingFormats(PictFormatPtr pForm);
void nxagentPictureCreateDefaultFormats(ScreenPtr pScreen, FormatInitRec *formats, int *nformats);
extern int nxagentPicturePrivateIndex;
PictFormatPtr
PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp)
{
......@@ -303,8 +305,6 @@ CreateSolidPicture (Picture pid, xRenderColor *color, int *error)
static PicturePtr createSourcePicture(void)
{
extern int nxagentPicturePrivateIndex;
/*
* Compute size of entire PictureRect, plus privates.
*/
......
......@@ -93,6 +93,14 @@ nxagentWMStateRec;
#undef TEST
#undef DEBUG
#ifdef NXAGENT_CLIPBOARD
extern WindowPtr nxagentGetClipboardWindow(Atom, WindowPtr);
#endif
#ifdef NXAGENT_ARTSD
extern Atom mcop_local_atom;
#endif
int
ProcChangeProperty(ClientPtr client)
{
......@@ -127,11 +135,7 @@ ProcChangeProperty(ClientPtr client)
REQUEST_FIXED_SIZE(xChangePropertyReq, totalSize);
#ifdef NXAGENT_CLIPBOARD
{
extern WindowPtr nxagentGetClipboardWindow(Atom, WindowPtr);
pWin = nxagentGetClipboardWindow(stuff->property, NULL);
}
pWin = nxagentGetClipboardWindow(stuff->property, NULL);
if (pWin == NULL)
#endif
......@@ -168,7 +172,6 @@ ProcChangeProperty(ClientPtr client)
they are already set reflecting the server side settings.
Just return success.
*/
extern Atom mcop_local_atom;
if (stuff->property == mcop_local_atom)
return client->noClientException;
}
......@@ -549,14 +552,17 @@ ProcGetProperty(ClientPtr client)
#ifdef NXAGENT_CLIPBOARD
/* GetWindowProperty clipboard use only */
/* FIXME: that's wrong, it is also called in Window.c and Events. */
/* FIXME: should be moved to a different file, is not derived from
dix */
int
GetWindowProperty(pWin, property, longOffset, longLength, delete,
type, actualType, format, nItems, bytesAfter, propData )
WindowPtr pWin;
Atom property;
long longOffset;
long longLength;
Bool delete;
long longOffset;
long longLength;
Bool delete;
Atom type;
Atom *actualType;
int *format;
......@@ -569,24 +575,24 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
if (!pWin)
{
#ifdef DEBUG
#ifdef DEBUG
fprintf(stderr, "%s: invalid window\n", __func__);
#endif
#endif
return BadWindow;
}
if (!ValidAtom(property))
{
#ifdef DEBUG
#ifdef DEBUG
fprintf(stderr, "%s: invalid atom [%d]\n", __func__, property);
#endif
#endif
return(BadAtom);
}
if ((type != AnyPropertyType) && !ValidAtom(type))
{
#ifdef DEBUG
#ifdef DEBUG
fprintf(stderr, "%s: invalid type [%d]\n", __func__, type);
#endif
#endif
return(BadAtom);
}
......@@ -604,14 +610,14 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
if (!pProp)
{
#ifdef DEBUG
#ifdef DEBUG
fprintf(stderr, "%s: property not found [%d]\n", __func__, property);
#endif
#endif
return (BadAtom);
}
/* If the request type and actual type don't match. Return the
property information, but not the data. */
property information, but not the data. */
if (((type != pProp->type) &&
(type != AnyPropertyType))
......@@ -624,20 +630,20 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
return(Success);
}
/*
* Return type, format, value to client
*/
/*
* Return type, format, value to client
*/
n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */
ind = longOffset << 2;
/* If longOffset is invalid such that it causes "len" to
be negative, it's a value error. */
/* If longOffset is invalid such that it causes "len" to
be negative, it's a value error. */
if (n < ind)
{
#ifdef DEBUG
#ifdef DEBUG
fprintf(stderr, "%s: negative property len\n", __func__);
#endif
#endif
return BadValue;
}
......@@ -650,9 +656,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
if (delete && (*bytesAfter == 0))
{ /* send the event */
xEvent event;
memset(&event, 0, sizeof(xEvent));
xEvent event = {0};
event.u.u.type = PropertyNotify;
event.u.property.window = pWin->drawable.id;
event.u.property.state = PropertyDelete;
......@@ -663,7 +667,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
if (len)
{
*propData = (unsigned char *)(pProp->data) + ind;
*propData = (unsigned char *)(pProp->data) + ind;
}
if (delete && (*bytesAfter == 0))
......@@ -681,3 +685,50 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
return(Success);
}
#endif
int
ProcDeleteProperty(register ClientPtr client)
{
WindowPtr pWin;
REQUEST(xDeletePropertyReq);
int result;
REQUEST_SIZE_MATCH(xDeletePropertyReq);
UpdateCurrentTime();
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
DixWriteAccess);
if (!pWin)
return(BadWindow);
if (!ValidAtom(stuff->property))
{
client->errorValue = stuff->property;
return (BadAtom);
}
#ifdef XCSECURITY
switch(SecurityCheckPropertyAccess(client, pWin, stuff->property,
DixDestroyAccess))
{
case SecurityErrorOperation:
client->errorValue = stuff->property;
return BadAtom;;
case SecurityIgnoreOperation:
return Success;
}
#endif
#ifdef NXAGENT_SERVER
/* prevent clients from deleting the NX_AGENT_VERSION property */
{
Atom prop = MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True);
if (stuff->property == prop)
return client->noClientException;
}
#endif
result = DeleteProperty(pWin, stuff->property);
if (client->noClientException != Success)
return(client->noClientException);
else
return(result);
}
......@@ -90,7 +90,7 @@ void miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box);
extern int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr);
extern void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int);
extern int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr);
extern void nxagentRenderRealizeCursor(ScreenPtr, CursorPtr);
extern int nxagentCreatePicture(PicturePtr, Mask);
extern void nxagentChangePicture(PicturePtr, Mask);
extern int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int);
......@@ -124,6 +124,8 @@ extern void nxagentRenderCreateConicalGradient(PicturePtr pPicture,
xFixed *stops,
xRenderColor *colors);
extern int nxagentAlphaEnabled;
/*
* The void pointer is actually a XGlyphElt8.
*/
......@@ -184,7 +186,6 @@ ProcRenderQueryPictFormats (ClientPtr client)
int numScreens;
int numSubpixel;
extern int nxagentAlphaEnabled;
/* REQUEST(xRenderQueryPictFormatsReq); */
REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq);
......@@ -715,6 +716,9 @@ ProcRenderTrapezoids (ClientPtr client)
{
if (pFormat != NULL)
{
if (nxagentTrapezoidExtents && nxagentTrapezoidExtents != NullBox)
free(nxagentTrapezoidExtents);
nxagentTrapezoidExtents = (BoxPtr) malloc(sizeof(BoxRec));
miTrapezoidBounds (ntraps, (xTrapezoid *) &stuff[1], nxagentTrapezoidExtents);
......
......@@ -81,6 +81,8 @@ extern void fbPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth,
int x, int y, int w, int h, int leftPad, int format,
char *pImage);
extern int nxagentImageLength(int, int, int, int, int);
void
ShmExtensionInit(void)
{
......@@ -228,7 +230,6 @@ fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
#ifdef NXAGENT_SERVER
int length;
char *newdata;
extern int nxagentImageLength(int, int, int, int, int);
#ifdef TEST
fprintf(stderr, "fbShmPutImage: Called with drawable at [%p] GC at [%p] data at [%p].\n",
......
......@@ -106,7 +106,6 @@ Equipment Corporation.
#include "Screen.h"
#include "Options.h"
#include "Atoms.h"
#include "Clipboard.h"
#include "Splash.h"
#include "Rootless.h"
......@@ -204,8 +203,6 @@ InitRootWindow(WindowPtr pWin)
fprintf(stderr, "InitRootWindow: Mapping default windows.\n");
#endif
nxagentInitAtoms(pWin);
nxagentInitClipboard(pWin);
nxagentMapDefaultWindows();
......@@ -215,9 +212,7 @@ InitRootWindow(WindowPtr pWin)
#ifdef NXAGENT_ARTSD
{
char artsd_port[10];
short int nPort;
extern void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port);
nPort = atoi(display) + 7000;
short int nPort = atoi(display) + 7000;
sprintf(artsd_port,"%d", nPort);
nxagentPropagateArtsdProperties(pScreen, artsd_port);
}
......
......@@ -133,7 +133,6 @@ void nxagentInitOptions(void)
nxagentOptions.Xdmcp = 0;
nxagentOptions.DisplayLatency = 0;
nxagentOptions.DisplayBuffer = UNDEFINED;
nxagentOptions.DisplayCoalescence = 0;
......
......@@ -295,16 +295,6 @@ typedef struct _AgentOptions
int Xdmcp;
/*
* Latency of the link. It is simply set
* to a reference value, calculated based
* on the time required to complete the
* query of the agent's atoms at session
* startup.
*/
int DisplayLatency;
/*
* Size of the Xlib display buffer. The
* default is set according to the link
* type.
......
......@@ -63,10 +63,6 @@ int nxagentUniquePixels(XImage *image)
int elements = PIXEL_ELEMENTS;
int unique = 0;
int total;
int ratio;
int step;
int last = -1;
const char *next = image -> data;
......@@ -80,9 +76,9 @@ int nxagentUniquePixels(XImage *image)
* Take at most 256 pixels from the image.
*/
total = image -> width * image -> height;
int total = image -> width * image -> height;
step = total / elements;
int step = total / elements;
if (step < PIXEL_STEP)
{
......@@ -231,7 +227,7 @@ int nxagentUniquePixels(XImage *image)
#endif
}
ratio = unique * 100 / elements;
int ratio = unique * 100 / elements;
#ifdef TEST
fprintf(stderr, "nxagentUniquePixels: Found [%d] unique pixels out of [%d] with ratio [%d%%].\n",
......@@ -267,13 +263,11 @@ unsigned int Get16(const char *buffer, int order)
unsigned int Get24(const char *buffer, int order)
{
int i;
const char *next = (order == MSBFirst ? buffer : buffer + 2);
unsigned int result = 0;
for (i = 0; i < 3; i++)
for (int i = 0; i < 3; i++)
{
result <<= 8;
......@@ -294,13 +288,11 @@ unsigned int Get24(const char *buffer, int order)
unsigned int Get32(const char *buffer, int order)
{
int i;
const char *next = (order == MSBFirst ? buffer : buffer + 3);
unsigned int result = 0;
for (i = 0; i < 4; i++)
for (int i = 0; i < 4; i++)
{
result <<= 8;
......@@ -341,13 +333,11 @@ void Put16(unsigned int value, char *buffer, int order)
void Put24(unsigned int value, char *buffer, int order)
{
int i;
if (order == MSBFirst)
{
buffer += 2;
for (i = 3; i > 0; i--)
for (int i = 3; i > 0; i--)
{
*buffer-- = (unsigned char) (value & 0xff);
......@@ -356,7 +346,7 @@ void Put24(unsigned int value, char *buffer, int order)
}
else
{
for (i = 3; i > 0; i--)
for (int i = 3; i > 0; i--)
{
*buffer++ = (unsigned char) (value & 0xff);
......@@ -367,13 +357,11 @@ void Put24(unsigned int value, char *buffer, int order)
void Put32(unsigned int value, char *buffer, int order)
{
int i;
if (order == MSBFirst)
{
buffer += 3;
for (i = 4; i > 0; i--)
for (int i = 4; i > 0; i--)
{
*buffer-- = (unsigned char) (value & 0xff);
......@@ -382,7 +370,7 @@ void Put32(unsigned int value, char *buffer, int order)
}
else
{
for (i = 4; i > 0; i--)
for (int i = 4; i > 0; i--)
{
*buffer++ = (unsigned char) (value & 0xff);
......
......@@ -104,7 +104,7 @@ while (0)
void nxagentRenderExtensionInit(void);
Bool nxagentPictureInit(ScreenPtr, PictFormatPtr, int);
int nxagentRenderRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
void nxagentRenderRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi,
int nglyphs, CARD8 *images, int sizeImages);
......
......@@ -136,6 +136,8 @@ void nxagentSetWMNormalHintsMaxsize(ScreenPtr, int, int);
void nxagentShadowSetRatio(float, float);
void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port);
/*
* Change window settings to adapt to a ratio.
*/
......
......@@ -792,11 +792,11 @@ void nxagentWaitDrawable(DrawablePtr pDrawable)
else
{
fprintf(stderr, "nxagentWaitDrawable: Drawable at [%p] can now be restarted.\n",
(void *) pDrawable);
(void *) pDrawable);
}
#endif
return;
}
......
......@@ -27,91 +27,68 @@
#define __Traps_H__
/*
* Set if we are dispatching a render
* extension request. Used to avoid
* Set if we are dispatching a render extension request. Used to avoid
* reentrancy in GC operations.
*/
extern int nxagentGCTrap;
/*
* Set if we are enqueing an internal
* operation, CreateWindow and Reparent-
* Window. Used to remove any screen operation.
* Set if we are enqueing an internal operation, CreateWindow and
* Reparent- Window. Used to remove any screen operation.
*/
extern int nxagentScreenTrap;
/*
* Set if we are executing a GC operation
* only on the X side. Used to avoid
* reentrancy in FB layer.
* Set if we are executing a GC operation only on the X side. Used to
* avoid reentrancy in FB layer.
*/
extern int nxagentFBTrap;
/*
* Set if we are dispatching a shared
* memory extension request.
* Set if we are dispatching a shared memory extension request.
*/
extern int nxagentShmTrap;
/*
* Set if a shared pixmap operation is
* requested by the client.
* Set if a shared pixmap operation is requested by the client.
*/
extern int nxagentShmPixmapTrap;
/*
* Set if we are dispatching a XVideo
* extension request.
* Set if we are dispatching a XVideo extension request.
*/
extern int nxagentXvTrap;
/*
* Set if we are dispatching a GLX
* extension request.
* Set if we are dispatching a GLX extension request.
*/
extern int nxagentGlxTrap;
/*
* Set while we are resuming the session.
*/
extern int nxagentReconnectTrap;
/*
* Set if we need to realize a drawable
* by using a lossless encoding.
* Set if we need to realize a drawable by using a lossless encoding.
*/
extern int nxagentLosslessTrap;
/*
* Set to force the synchronization of
* a drawable.
* Set to force the synchronization of a drawable.
*/
extern int nxagentSplitTrap;
/*
* Set to avoid CapsLock synchronization
* problems when CapsLock is the first
* key to be pressed in the session.
* Set to avoid CapsLock synchronization problems when CapsLock is the
* first key to be pressed in the session.
*/
extern int nxagentXkbCapsTrap;
/*
* Set to avoid NumLock synchronization
* problems when NumLock is the first
* key to be pressed in the session.
* Set to avoid NumLock synchronization problems when NumLock is the
* first key to be pressed in the session.
*/
extern int nxagentXkbNumTrap;
/*
......@@ -119,7 +96,6 @@ extern int nxagentXkbNumTrap;
* the real X server. This is used to avoid endless loops if callbacks
* would trigger another event by the real X server
*/
extern int nxagentExternalClipboardEventTrap;
#endif /* __Trap_H__ */
......@@ -47,4 +47,8 @@ static inline const char * validateString(const char *str) {
#define SAFE_XFree(what) do {if (what) {XFree(what); what = NULL;}} while (0)
#define SAFE_free(what) do {free(what); what = NULL;} while (0)
/* some helper macros to produce a quoted string from other macros */
#define QUOTEEXP(str) #str
#define QUOTE(str) QUOTEEXP(str)
#endif /* __Utils_H__ */
......@@ -2671,7 +2671,7 @@ void nxagentDisconnectWindow(void * p0, XID x1, void * p2)
nxagentCursorPriv(pCursor, pScreen) &&
nxagentCursor(pCursor, pScreen))
{
#ifdef NXAGENT_RECONNECT_CURSOR_DEBUG_disabled
#ifdef NXAGENT_RECONNECT_CURSOR_DEBUG
char msg[] = "nxagentDisconnectWindow:";
nxagentPrintCursorInfo(pCursor, msg);
......
......@@ -271,6 +271,14 @@ long Memory_fail = 0;
char *dev_tty_from_init = NULL; /* since we need to parse it anyway */
#endif
#ifdef NXAGENT_SERVER
extern const char *nxagentProgName;
#endif
#ifdef NX_TRANS_SOCKET
extern char **environ;
#endif
extern char dispatchExceptionAtReset;
/* Extension enable/disable in miinitext.c */
......@@ -554,7 +562,6 @@ AdjustWaitForDelay (void * waitTime, unsigned long newdelay)
void UseMsg(void)
{
#ifdef NXAGENT_SERVER
extern const char *nxagentProgName;
ErrorF("Usage: %s [<options>] [:<display>]\n\n", nxagentProgName);
#else
ErrorF("use: X [:<display>] [option]\n");
......@@ -1731,8 +1738,6 @@ Popen(char *command, char *type)
#else
extern char **environ;
char **ep = environ;
ep = environ;
......
......@@ -62,7 +62,7 @@
$(NULL)
INCLUDES = -I../include -I../mi \
-I../fb -I../hw/kdrive -I$(EXTINCSRC) -I$(XINCLUDESRC) \
-I../fb -I$(EXTINCSRC) -I$(XINCLUDESRC) \
-I../render \
`pkg-config --cflags-only-I pixman-1`
......
......@@ -44,7 +44,7 @@ NXAGENT_SKIP_OBJS = \
$(NULL)
INCLUDES = -I. -I../include -I../mi \
-I../fb -I../hw/kdrive -I$(EXTINCSRC) -I$(XINCLUDESRC) \
-I../fb -I$(EXTINCSRC) -I$(XINCLUDESRC) \
-I../Xext \
`pkg-config --cflags-only-I pixman-1`
LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln
......
......@@ -411,7 +411,7 @@ static XkbSymInterpretRec dfltSI[69]= {
255,
{ XkbSA_LockControls, { 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00 } } },
#ifndef NX_TRANS_SOCKET
#ifndef NXAGENT_SERVER
/*
* Make sure that the server can't be killed
......
......@@ -216,7 +216,7 @@ int CorePoller::isChanged(int (*checkIfInputCallback)(void *), void *arg, int *s
// In order to allow this function to
// be suspended and resumed later, we
// need to save these two status vars.
//
//
static int idxIlace = 0;
static int curLine = 0;
......
......@@ -41,14 +41,11 @@
Logger logger;
void Logger::user(const char *format, ...)
void Logger::user(const char *format, va_list arguments)
{
char string[1024];
va_list arguments;
va_start(arguments, format);
vsnprintf(string, 1024, format, arguments);
va_end(arguments);
fprintf(stderr, "%s\n", string);
}
......@@ -59,26 +56,20 @@ void Logger::error(const char *name, int error)
name, error, strerror(error));
}
void Logger::warning(const char *name, const char *format, ...)
void Logger::warning(const char *name, const char *format, va_list arguments)
{
char string[1024];
va_list arguments;
va_start(arguments, format);
vsnprintf(string, 1024, format, arguments);
va_end(arguments);
fprintf(stderr, "%s: WARNING! %s\n", name, string);
}
void Logger::test(const char *name, const char *format, ...)
void Logger::test(const char *name, const char *format, va_list arguments)
{
char string[1024];
va_list arguments;
va_start(arguments, format);
vsnprintf(string, 1024, format, arguments);
va_end(arguments);
fprintf(stderr, "%s: %s\n", name, string);
}
......@@ -88,14 +79,11 @@ void Logger::trace(const char *name)
fprintf(stderr, "%s\n", name);
}
void Logger::debug(const char *name, const char *format, ...)
void Logger::debug(const char *name, const char *format, va_list arguments)
{
char string[1024];
va_list arguments;
va_start(arguments, format);
vsnprintf(string, 1024, format, arguments);
va_end(arguments);
fprintf(stderr, "%s: %s\n", name, string);
}
......
......@@ -43,17 +43,17 @@ class Logger
{
public:
void user(const char *format, ...) __attribute__((format(printf, 2, 0)));
void user(const char *format, va_list arguments) __attribute__((format(printf, 2, 0)));
void error(const char *name, int error);
void warning(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0)));
void warning(const char *name, const char *format, va_list arguments) __attribute__((format(printf, 3, 0)));
void test(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0)));
void test(const char *name, const char *format, va_list arguments) __attribute__((format(printf, 3, 0)));
void trace(const char *name);
void debug(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0)));
void debug(const char *name, const char *format, va_list arguments) __attribute__((format(printf, 3, 0)));
void dump(const char *name, const char *data, int size);
};
......
......@@ -236,7 +236,7 @@ char *Poller::getRect(XRectangle r)
else
{
image_ -> width = r.width;
image_ -> height = r.height;
image_ -> height = r.height;
image_ -> bytes_per_line = ROUNDUP((image_ -> bits_per_pixel * image_ -> width), image_ -> bitmap_pad);
......@@ -1155,11 +1155,11 @@ SendKeycode:
if (XKeysymToKeycode(event -> xkey.display, XK_A) != keycode)
{
KeySym keysym = XKeycodeToKeysym(event -> xkey.display, event -> xkey.keycode, 0);
if (keysym == XK_Mode_switch || keysym == XK_ISO_Level3_Shift)
{
logUser("Poller::handleKeyboardEvent: keysym [%x].\n", (unsigned int)keysym);
if (XKeycodeToKeysym(display_, 113, 0) == XK_ISO_Level3_Shift ||
(XKeycodeToKeysym(display_, 124, 0) == XK_ISO_Level3_Shift))
{
......@@ -1169,7 +1169,7 @@ SendKeycode:
{
event -> xkey.keycode = XKeysymToKeycode(display_, XK_Mode_switch);
}
logUser("Poller::handleKeyboardEvent: keycode translated to [%x].\n", (unsigned int)event -> xkey.keycode);
}
else
......@@ -1503,7 +1503,7 @@ void Poller::updateDamagedAreas(void)
int i;
int y;
for (i = 0; i < lastUpdatedRegion_ -> numRects; i++)
{
boxPtr = lastUpdatedRegion_ -> rects + i;
......@@ -1515,7 +1515,7 @@ void Poller::updateDamagedAreas(void)
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)
{
......@@ -1554,7 +1554,7 @@ void Poller::updateDamagedAreas(void)
{
update(image_ -> data + y * image_ -> bytes_per_line, rectangle);
rectangle.y++;
rectangle.y++;
}
if (shmExtension_ != 1)
......
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