Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
dimbor
nx-libs
Commits
67599026
Unverified
Commit
67599026
authored
Jan 06, 2020
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/various3' into 3.6.x
Attributes GH PR #880:
https://github.com/ArcticaProject/nx-libs/pull/880
parents
5a8f1e92
cf8797c3
Hide whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
526 additions
and
1187 deletions
+526
-1187
xf86bigfont.c
nx-X11/programs/Xserver/Xext/xf86bigfont.c
+1
-1
xvdisp.c
nx-X11/programs/Xserver/Xext/xvdisp.c
+27
-23
Imakefile
nx-X11/programs/Xserver/dix/Imakefile
+0
-7
devices.c
nx-X11/programs/Xserver/dix/devices.c
+0
-2
dispatch.c
nx-X11/programs/Xserver/dix/dispatch.c
+0
-2
dixfonts.c
nx-X11/programs/Xserver/dix/dixfonts.c
+20
-27
globals.c
nx-X11/programs/Xserver/dix/globals.c
+0
-1
main.c
nx-X11/programs/Xserver/dix/main.c
+0
-3
property.c
nx-X11/programs/Xserver/dix/property.c
+7
-1
xpstubs.c
nx-X11/programs/Xserver/dix/xpstubs.c
+0
-50
Atoms.c
nx-X11/programs/Xserver/hw/nxagent/Atoms.c
+46
-11
Display.c
nx-X11/programs/Xserver/hw/nxagent/Display.c
+81
-75
Error.c
nx-X11/programs/Xserver/hw/nxagent/Error.c
+24
-19
Events.c
nx-X11/programs/Xserver/hw/nxagent/Events.c
+26
-8
Font.c
nx-X11/programs/Xserver/hw/nxagent/Font.c
+0
-3
Handlers.c
nx-X11/programs/Xserver/hw/nxagent/Handlers.c
+0
-39
Image.c
nx-X11/programs/Xserver/hw/nxagent/Image.c
+5
-6
Imakefile
nx-X11/programs/Xserver/hw/nxagent/Imakefile
+0
-3
Init.h
nx-X11/programs/Xserver/hw/nxagent/Init.h
+1
-1
Keyboard.c
nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
+2
-2
Keystroke.c
nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
+1
-1
NXdispatch.c
nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
+36
-10
NXpicture.c
nx-X11/programs/Xserver/hw/nxagent/NXpicture.c
+4
-1
NXproperty.c
nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
+4
-109
Options.c
nx-X11/programs/Xserver/hw/nxagent/Options.c
+0
-8
Pointer.c
nx-X11/programs/Xserver/hw/nxagent/Pointer.c
+9
-9
Reconnect.c
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
+1
-1
Rootless.c
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
+1
-1
Screen.c
nx-X11/programs/Xserver/hw/nxagent/Screen.c
+201
-337
Window.c
nx-X11/programs/Xserver/hw/nxagent/Window.c
+9
-15
dix.h
nx-X11/programs/Xserver/include/dix.h
+0
-1
scrnintstr.h
nx-X11/programs/Xserver/include/scrnintstr.h
+1
-1
xkbsrv.h
nx-X11/programs/Xserver/include/xkbsrv.h
+1
-5
mibstore.c
nx-X11/programs/Xserver/mi/mibstore.c
+0
-1
miwideline.c
nx-X11/programs/Xserver/mi/miwideline.c
+3
-3
WaitFor.c
nx-X11/programs/Xserver/os/WaitFor.c
+0
-48
access.c
nx-X11/programs/Xserver/os/access.c
+6
-56
auth.c
nx-X11/programs/Xserver/os/auth.c
+0
-3
connection.c
nx-X11/programs/Xserver/os/connection.c
+0
-144
io.c
nx-X11/programs/Xserver/os/io.c
+1
-36
log.c
nx-X11/programs/Xserver/os/log.c
+0
-10
osdep.h
nx-X11/programs/Xserver/os/osdep.h
+0
-18
osinit.c
nx-X11/programs/Xserver/os/osinit.c
+4
-7
utils.c
nx-X11/programs/Xserver/os/utils.c
+3
-65
xdmcp.c
nx-X11/programs/Xserver/os/xdmcp.c
+0
-12
xkbActions.c
nx-X11/programs/Xserver/xkb/xkbActions.c
+1
-1
No files found.
nx-X11/programs/Xserver/Xext/xf86bigfont.c
View file @
67599026
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
#ifdef SVR4
#ifdef SVR4
#include <sys/sysmacros.h>
#include <sys/sysmacros.h>
#endif
#endif
#if defined(
ISC) || defined(
__CYGWIN__) || defined(__SCO__)
#if defined(__CYGWIN__) || defined(__SCO__)
#include <sys/param.h>
#include <sys/param.h>
#include <sys/sysmacros.h>
#include <sys/sysmacros.h>
#endif
#endif
...
...
nx-X11/programs/Xserver/Xext/xvdisp.c
View file @
67599026
...
@@ -387,6 +387,7 @@ ProcXvQueryAdaptors(ClientPtr client)
...
@@ -387,6 +387,7 @@ ProcXvQueryAdaptors(ClientPtr client)
xvAdaptorInfo
ainfo
;
xvAdaptorInfo
ainfo
;
xvQueryAdaptorsReply
rep
;
xvQueryAdaptorsReply
rep
;
int
totalSize
,
na
,
nf
;
int
totalSize
,
na
,
nf
;
int
nameSize
;
XvAdaptorPtr
pa
;
XvAdaptorPtr
pa
;
XvFormatPtr
pf
;
XvFormatPtr
pf
;
WindowPtr
pWin
;
WindowPtr
pWin
;
...
@@ -450,12 +451,12 @@ ProcXvQueryAdaptors(ClientPtr client)
...
@@ -450,12 +451,12 @@ ProcXvQueryAdaptors(ClientPtr client)
ainfo
.
base_id
=
pa
->
base_id
;
ainfo
.
base_id
=
pa
->
base_id
;
ainfo
.
num_ports
=
pa
->
nPorts
;
ainfo
.
num_ports
=
pa
->
nPorts
;
ainfo
.
type
=
pa
->
type
;
ainfo
.
type
=
pa
->
type
;
ainfo
.
name_size
=
strlen
(
pa
->
name
);
ainfo
.
name_size
=
nameSize
=
strlen
(
pa
->
name
);
ainfo
.
num_formats
=
pa
->
nFormats
;
ainfo
.
num_formats
=
pa
->
nFormats
;
_WriteAdaptorInfo
(
client
,
&
ainfo
);
_WriteAdaptorInfo
(
client
,
&
ainfo
);
WriteToClient
(
client
,
ainfo
.
name_s
ize
,
pa
->
name
);
WriteToClient
(
client
,
nameS
ize
,
pa
->
name
);
nf
=
pa
->
nFormats
;
nf
=
pa
->
nFormats
;
pf
=
pa
->
pFormats
;
pf
=
pa
->
pFormats
;
...
@@ -481,6 +482,7 @@ ProcXvQueryEncodings(ClientPtr client)
...
@@ -481,6 +482,7 @@ ProcXvQueryEncodings(ClientPtr client)
xvEncodingInfo
einfo
;
xvEncodingInfo
einfo
;
xvQueryEncodingsReply
rep
;
xvQueryEncodingsReply
rep
;
int
totalSize
;
int
totalSize
;
int
nameSize
;
XvPortPtr
pPort
;
XvPortPtr
pPort
;
int
ne
;
int
ne
;
XvEncodingPtr
pe
;
XvEncodingPtr
pe
;
...
@@ -525,13 +527,13 @@ ProcXvQueryEncodings(ClientPtr client)
...
@@ -525,13 +527,13 @@ ProcXvQueryEncodings(ClientPtr client)
while
(
ne
--
)
while
(
ne
--
)
{
{
einfo
.
encoding
=
pe
->
id
;
einfo
.
encoding
=
pe
->
id
;
einfo
.
name_size
=
strlen
(
pe
->
name
);
einfo
.
name_size
=
nameSize
=
strlen
(
pe
->
name
);
einfo
.
width
=
pe
->
width
;
einfo
.
width
=
pe
->
width
;
einfo
.
height
=
pe
->
height
;
einfo
.
height
=
pe
->
height
;
einfo
.
rate
.
numerator
=
pe
->
rate
.
numerator
;
einfo
.
rate
.
numerator
=
pe
->
rate
.
numerator
;
einfo
.
rate
.
denominator
=
pe
->
rate
.
denominator
;
einfo
.
rate
.
denominator
=
pe
->
rate
.
denominator
;
_WriteEncodingInfo
(
client
,
&
einfo
);
_WriteEncodingInfo
(
client
,
&
einfo
);
WriteToClient
(
client
,
einfo
.
name_s
ize
,
pe
->
name
);
WriteToClient
(
client
,
nameS
ize
,
pe
->
name
);
pe
++
;
pe
++
;
}
}
...
@@ -1011,19 +1013,20 @@ ProcXvQueryPortAttributes(ClientPtr client)
...
@@ -1011,19 +1013,20 @@ ProcXvQueryPortAttributes(ClientPtr client)
rep
.
num_attributes
=
pPort
->
pAdaptor
->
nAttributes
;
rep
.
num_attributes
=
pPort
->
pAdaptor
->
nAttributes
;
rep
.
text_size
=
0
;
rep
.
text_size
=
0
;
for
(
i
=
0
,
pAtt
=
pPort
->
pAdaptor
->
pAttributes
;
for
(
i
=
0
,
pAtt
=
pPort
->
pAdaptor
->
pAttributes
;
i
<
rep
.
num_attributes
;
i
++
,
pAtt
++
)
i
<
pPort
->
pAdaptor
->
nAttributes
;
i
++
,
pAtt
++
)
{
{
rep
.
text_size
+=
(
strlen
(
pAtt
->
name
)
+
1
+
3
)
&
~
3L
;
rep
.
text_size
+=
(
strlen
(
pAtt
->
name
)
+
1
+
3
)
&
~
3L
;
}
}
rep
.
length
=
(
rep
.
num_attributes
*
sz_xvAttributeInfo
)
+
rep
.
text_size
;
rep
.
length
=
(
pPort
->
pAdaptor
->
nAttributes
*
sz_xvAttributeInfo
)
+
rep
.
text_size
;
rep
.
length
>>=
2
;
rep
.
length
>>=
2
;
_WriteQueryPortAttributesReply
(
client
,
&
rep
);
_WriteQueryPortAttributesReply
(
client
,
&
rep
);
for
(
i
=
0
,
pAtt
=
pPort
->
pAdaptor
->
pAttributes
;
for
(
i
=
0
,
pAtt
=
pPort
->
pAdaptor
->
pAttributes
;
i
<
rep
.
num_attributes
;
i
++
,
pAtt
++
)
i
<
pPort
->
pAdaptor
->
nAttributes
;
i
++
,
pAtt
++
)
{
{
size
=
strlen
(
pAtt
->
name
)
+
1
;
/* pass the NULL */
size
=
strlen
(
pAtt
->
name
)
+
1
;
/* pass the NULL */
Info
.
flags
=
pAtt
->
flags
;
Info
.
flags
=
pAtt
->
flags
;
...
@@ -1233,6 +1236,7 @@ ProcXvQueryImageAttributes(ClientPtr client)
...
@@ -1233,6 +1236,7 @@ ProcXvQueryImageAttributes(ClientPtr client)
XvPortPtr
pPort
;
XvPortPtr
pPort
;
int
*
offsets
;
int
*
offsets
;
int
*
pitches
;
int
*
pitches
;
int
planeLength
;
REQUEST
(
xvQueryImageAttributesReq
);
REQUEST
(
xvQueryImageAttributesReq
);
REQUEST_SIZE_MATCH
(
xvQueryImageAttributesReq
);
REQUEST_SIZE_MATCH
(
xvQueryImageAttributesReq
);
...
@@ -1272,7 +1276,7 @@ ProcXvQueryImageAttributes(ClientPtr client)
...
@@ -1272,7 +1276,7 @@ ProcXvQueryImageAttributes(ClientPtr client)
rep
.
type
=
X_Reply
;
rep
.
type
=
X_Reply
;
rep
.
sequenceNumber
=
client
->
sequence
;
rep
.
sequenceNumber
=
client
->
sequence
;
rep
.
length
=
num_planes
<<
1
;
rep
.
length
=
planeLength
=
num_planes
<<
1
;
rep
.
num_planes
=
num_planes
;
rep
.
num_planes
=
num_planes
;
rep
.
width
=
width
;
rep
.
width
=
width
;
rep
.
height
=
height
;
rep
.
height
=
height
;
...
@@ -1280,8 +1284,8 @@ ProcXvQueryImageAttributes(ClientPtr client)
...
@@ -1280,8 +1284,8 @@ ProcXvQueryImageAttributes(ClientPtr client)
_WriteQueryImageAttributesReply
(
client
,
&
rep
);
_WriteQueryImageAttributesReply
(
client
,
&
rep
);
if
(
client
->
swapped
)
if
(
client
->
swapped
)
SwapLongs
((
CARD32
*
)
offsets
,
rep
.
l
ength
);
SwapLongs
((
CARD32
*
)
offsets
,
planeL
ength
);
WriteToClient
(
client
,
rep
.
l
ength
<<
2
,
offsets
);
WriteToClient
(
client
,
planeL
ength
<<
2
,
offsets
);
free
(
offsets
);
free
(
offsets
);
...
@@ -1309,13 +1313,13 @@ ProcXvListImageFormats(ClientPtr client)
...
@@ -1309,13 +1313,13 @@ ProcXvListImageFormats(ClientPtr client)
rep
.
type
=
X_Reply
;
rep
.
type
=
X_Reply
;
rep
.
sequenceNumber
=
client
->
sequence
;
rep
.
sequenceNumber
=
client
->
sequence
;
rep
.
num_formats
=
pPort
->
pAdaptor
->
nImages
;
rep
.
num_formats
=
pPort
->
pAdaptor
->
nImages
;
rep
.
length
=
rep
.
num_format
s
*
sz_xvImageFormatInfo
>>
2
;
rep
.
length
=
pPort
->
pAdaptor
->
nImage
s
*
sz_xvImageFormatInfo
>>
2
;
_WriteListImageFormatsReply
(
client
,
&
rep
);
_WriteListImageFormatsReply
(
client
,
&
rep
);
pImage
=
pPort
->
pAdaptor
->
pImages
;
pImage
=
pPort
->
pAdaptor
->
pImages
;
for
(
i
=
0
;
i
<
rep
.
num_format
s
;
i
++
,
pImage
++
)
{
for
(
i
=
0
;
i
<
pPort
->
pAdaptor
->
nImage
s
;
i
++
,
pImage
++
)
{
info
.
id
=
pImage
->
id
;
info
.
id
=
pImage
->
id
;
info
.
type
=
pImage
->
type
;
info
.
type
=
pImage
->
type
;
info
.
byte_order
=
pImage
->
byte_order
;
info
.
byte_order
=
pImage
->
byte_order
;
...
@@ -1642,7 +1646,7 @@ SWriteQueryExtensionReply(
...
@@ -1642,7 +1646,7 @@ SWriteQueryExtensionReply(
swaps
(
&
rep
->
version
);
swaps
(
&
rep
->
version
);
swaps
(
&
rep
->
revision
);
swaps
(
&
rep
->
revision
);
WriteToClient
(
client
,
sz_xvQueryExtensionReply
,
&
rep
);
WriteToClient
(
client
,
sz_xvQueryExtensionReply
,
rep
);
return
Success
;
return
Success
;
}
}
...
@@ -1656,7 +1660,7 @@ SWriteQueryAdaptorsReply(
...
@@ -1656,7 +1660,7 @@ SWriteQueryAdaptorsReply(
swapl
(
&
rep
->
length
);
swapl
(
&
rep
->
length
);
swaps
(
&
rep
->
num_adaptors
);
swaps
(
&
rep
->
num_adaptors
);
WriteToClient
(
client
,
sz_xvQueryAdaptorsReply
,
&
rep
);
WriteToClient
(
client
,
sz_xvQueryAdaptorsReply
,
rep
);
return
Success
;
return
Success
;
}
}
...
@@ -1670,7 +1674,7 @@ SWriteQueryEncodingsReply(
...
@@ -1670,7 +1674,7 @@ SWriteQueryEncodingsReply(
swapl
(
&
rep
->
length
);
swapl
(
&
rep
->
length
);
swaps
(
&
rep
->
num_encodings
);
swaps
(
&
rep
->
num_encodings
);
WriteToClient
(
client
,
sz_xvQueryEncodingsReply
,
&
rep
);
WriteToClient
(
client
,
sz_xvQueryEncodingsReply
,
rep
);
return
Success
;
return
Success
;
}
}
...
@@ -1765,7 +1769,7 @@ SWriteGrabPortReply(
...
@@ -1765,7 +1769,7 @@ SWriteGrabPortReply(
swaps
(
&
rep
->
sequenceNumber
);
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
swapl
(
&
rep
->
length
);
WriteToClient
(
client
,
sz_xvGrabPortReply
,
&
rep
);
WriteToClient
(
client
,
sz_xvGrabPortReply
,
rep
);
return
Success
;
return
Success
;
}
}
...
@@ -1779,7 +1783,7 @@ SWriteGetPortAttributeReply(
...
@@ -1779,7 +1783,7 @@ SWriteGetPortAttributeReply(
swapl
(
&
rep
->
length
);
swapl
(
&
rep
->
length
);
swapl
(
&
rep
->
value
);
swapl
(
&
rep
->
value
);
WriteToClient
(
client
,
sz_xvGetPortAttributeReply
,
&
rep
);
WriteToClient
(
client
,
sz_xvGetPortAttributeReply
,
rep
);
return
Success
;
return
Success
;
}
}
...
@@ -1794,7 +1798,7 @@ SWriteQueryBestSizeReply(
...
@@ -1794,7 +1798,7 @@ SWriteQueryBestSizeReply(
swaps
(
&
rep
->
actual_width
);
swaps
(
&
rep
->
actual_width
);
swaps
(
&
rep
->
actual_height
);
swaps
(
&
rep
->
actual_height
);
WriteToClient
(
client
,
sz_xvQueryBestSizeReply
,
&
rep
);
WriteToClient
(
client
,
sz_xvQueryBestSizeReply
,
rep
);
return
Success
;
return
Success
;
}
}
...
@@ -1809,7 +1813,7 @@ SWriteQueryPortAttributesReply(
...
@@ -1809,7 +1813,7 @@ SWriteQueryPortAttributesReply(
swapl
(
&
rep
->
num_attributes
);
swapl
(
&
rep
->
num_attributes
);
swapl
(
&
rep
->
text_size
);
swapl
(
&
rep
->
text_size
);
WriteToClient
(
client
,
sz_xvQueryPortAttributesReply
,
&
rep
);
WriteToClient
(
client
,
sz_xvQueryPortAttributesReply
,
rep
);
return
Success
;
return
Success
;
}
}
...
@@ -1826,7 +1830,7 @@ SWriteQueryImageAttributesReply(
...
@@ -1826,7 +1830,7 @@ SWriteQueryImageAttributesReply(
swaps
(
&
rep
->
width
);
swaps
(
&
rep
->
width
);
swaps
(
&
rep
->
height
);
swaps
(
&
rep
->
height
);
WriteToClient
(
client
,
sz_xvQueryImageAttributesReply
,
&
rep
);
WriteToClient
(
client
,
sz_xvQueryImageAttributesReply
,
rep
);
return
Success
;
return
Success
;
}
}
...
@@ -1841,7 +1845,7 @@ SWriteListImageFormatsReply(
...
@@ -1841,7 +1845,7 @@ SWriteListImageFormatsReply(
swapl
(
&
rep
->
length
);
swapl
(
&
rep
->
length
);
swapl
(
&
rep
->
num_formats
);
swapl
(
&
rep
->
num_formats
);
WriteToClient
(
client
,
sz_xvListImageFormatsReply
,
&
rep
);
WriteToClient
(
client
,
sz_xvListImageFormatsReply
,
rep
);
return
Success
;
return
Success
;
}
}
...
...
nx-X11/programs/Xserver/dix/Imakefile
View file @
67599026
...
@@ -2,9 +2,6 @@ NULL =
...
@@ -2,9 +2,6 @@ NULL =
#include <Server.tmpl>
#include <Server.tmpl>
XPSRC = xpstubs.c
XPOBJ = xpstubs.o
#if !HasFfs
#if !HasFfs
FFS_SRC = ffs.c
FFS_SRC = ffs.c
FFS_OBJ = ffs.o
FFS_OBJ = ffs.o
...
@@ -129,8 +126,6 @@ VENDOR_DEFINES = $(VENDOR_STRING) $(VENDOR_RELEASE) $(QUARTZ_DEFINES)
...
@@ -129,8 +126,6 @@ VENDOR_DEFINES = $(VENDOR_STRING) $(VENDOR_RELEASE) $(QUARTZ_DEFINES)
NormalLibraryObjectRule()
NormalLibraryObjectRule()
NormalLibraryTarget(dix,$(OBJS))
NormalLibraryTarget(dix,$(OBJS))
LintLibraryTarget(dix,$(SRCS) $(XPSRC))
NormalLintTarget($(SRCS) $(XPSRC))
SpecialCObjectRule(globals,$(ICONFIGFILES),$(SITE_DEFINES) $(EXT_DEFINES))
SpecialCObjectRule(globals,$(ICONFIGFILES),$(SITE_DEFINES) $(EXT_DEFINES))
SpecialCObjectRule(main,$(ICONFIGFILES),$(VENDOR_DEFINES))
SpecialCObjectRule(main,$(ICONFIGFILES),$(VENDOR_DEFINES))
...
@@ -138,6 +133,4 @@ SpecialCObjectRule(pixmap,$(ICONFIGFILES),$(_NOOP_))
...
@@ -138,6 +133,4 @@ SpecialCObjectRule(pixmap,$(ICONFIGFILES),$(_NOOP_))
SpecialCObjectRule(privates,$(ICONFIGFILES),$(_NOOP_))
SpecialCObjectRule(privates,$(ICONFIGFILES),$(_NOOP_))
SpecialCObjectRule(window,$(ICONFIGFILES),$(QUARTZ_DEFINES))
SpecialCObjectRule(window,$(ICONFIGFILES),$(QUARTZ_DEFINES))
NormalLibraryTarget(xpstubs,$(XPOBJ))
DependTarget()
DependTarget()
nx-X11/programs/Xserver/dix/devices.c
View file @
67599026
...
@@ -73,8 +73,6 @@ SOFTWARE.
...
@@ -73,8 +73,6 @@ SOFTWARE.
#include "swaprep.h"
#include "swaprep.h"
#include "dixevents.h"
#include "dixevents.h"
extern
void
XkbFreePrivates
(
DeviceIntPtr
device
);
DeviceIntPtr
DeviceIntPtr
AddInputDevice
(
DeviceProc
deviceProc
,
Bool
autoStart
)
AddInputDevice
(
DeviceProc
deviceProc
,
Bool
autoStart
)
{
{
...
...
nx-X11/programs/Xserver/dix/dispatch.c
View file @
67599026
...
@@ -391,7 +391,6 @@ Dispatch(void)
...
@@ -391,7 +391,6 @@ Dispatch(void)
}
}
isItTimeToYield
=
FALSE
;
isItTimeToYield
=
FALSE
;
requestingClient
=
client
;
start_tick
=
SmartScheduleTime
;
start_tick
=
SmartScheduleTime
;
while
(
!
isItTimeToYield
)
while
(
!
isItTimeToYield
)
{
{
...
@@ -447,7 +446,6 @@ Dispatch(void)
...
@@ -447,7 +446,6 @@ Dispatch(void)
client
=
clients
[
clientReady
[
nready
]];
client
=
clients
[
clientReady
[
nready
]];
if
(
client
)
if
(
client
)
client
->
smart_stop_tick
=
SmartScheduleTime
;
client
->
smart_stop_tick
=
SmartScheduleTime
;
requestingClient
=
NULL
;
}
}
dispatchException
&=
~
DE_PRIORITYCHANGE
;
dispatchException
&=
~
DE_PRIORITYCHANGE
;
}
}
...
...
nx-X11/programs/Xserver/dix/dixfonts.c
View file @
67599026
...
@@ -2178,34 +2178,27 @@ FontResolutionPtr
...
@@ -2178,34 +2178,27 @@ FontResolutionPtr
GetClientResolutions
(
int
*
num
)
GetClientResolutions
(
int
*
num
)
#endif
/* HAS_XFONT2 */
#endif
/* HAS_XFONT2 */
{
{
if
(
requestingClient
&&
requestingClient
->
fontResFunc
!=
NULL
&&
static
struct
_FontResolution
res
;
!
requestingClient
->
clientGone
)
ScreenPtr
pScreen
;
{
return
(
*
requestingClient
->
fontResFunc
)(
requestingClient
,
num
);
}
else
{
static
struct
_FontResolution
res
;
ScreenPtr
pScreen
;
pScreen
=
screenInfo
.
screens
[
0
];
pScreen
=
screenInfo
.
screens
[
0
];
res
.
x_resolution
=
(
pScreen
->
width
*
25
.
4
)
/
pScreen
->
mmWidth
;
res
.
x_resolution
=
(
pScreen
->
width
*
25
.
4
)
/
pScreen
->
mmWidth
;
/*
/*
* XXX - we'll want this as long as bitmap instances are prevalent
* XXX - we'll want this as long as bitmap instances are prevalent
so that we can match them from scalable fonts
so that we can match them from scalable fonts
*/
*/
if
(
res
.
x_resolution
<
88
)
if
(
res
.
x_resolution
<
88
)
res
.
x_resolution
=
75
;
res
.
x_resolution
=
75
;
else
else
res
.
x_resolution
=
100
;
res
.
x_resolution
=
100
;
res
.
y_resolution
=
(
pScreen
->
height
*
25
.
4
)
/
pScreen
->
mmHeight
;
res
.
y_resolution
=
(
pScreen
->
height
*
25
.
4
)
/
pScreen
->
mmHeight
;
if
(
res
.
y_resolution
<
88
)
if
(
res
.
y_resolution
<
88
)
res
.
y_resolution
=
75
;
res
.
y_resolution
=
75
;
else
else
res
.
y_resolution
=
100
;
res
.
y_resolution
=
100
;
res
.
point_size
=
120
;
res
.
point_size
=
120
;
*
num
=
1
;
*
num
=
1
;
return
&
res
;
return
&
res
;
}
}
}
#ifndef HAS_XFONT2
#ifndef HAS_XFONT2
...
...
nx-X11/programs/Xserver/dix/globals.c
View file @
67599026
...
@@ -141,7 +141,6 @@ Bool loadableFonts = FALSE;
...
@@ -141,7 +141,6 @@ Bool loadableFonts = FALSE;
CursorPtr
rootCursor
;
CursorPtr
rootCursor
;
Bool
blackRoot
=
FALSE
;
Bool
blackRoot
=
FALSE
;
Bool
whiteRoot
=
FALSE
;
Bool
whiteRoot
=
FALSE
;
ClientPtr
requestingClient
;
/* XXX this should be obsolete now, remove? */
TimeStamp
currentTime
;
TimeStamp
currentTime
;
TimeStamp
lastDeviceEventTime
;
TimeStamp
lastDeviceEventTime
;
...
...
nx-X11/programs/Xserver/dix/main.c
View file @
67599026
...
@@ -254,7 +254,6 @@ main(int argc, char *argv[], char *envp[])
...
@@ -254,7 +254,6 @@ main(int argc, char *argv[], char *envp[])
SetInputCheck
(
&
alwaysCheckForInput
[
0
],
&
alwaysCheckForInput
[
1
]);
SetInputCheck
(
&
alwaysCheckForInput
[
0
],
&
alwaysCheckForInput
[
1
]);
screenInfo
.
arraySize
=
MAXSCREENS
;
screenInfo
.
arraySize
=
MAXSCREENS
;
screenInfo
.
numScreens
=
0
;
screenInfo
.
numScreens
=
0
;
screenInfo
.
numVideoScreens
=
-
1
;
InitAtoms
();
InitAtoms
();
InitEvents
();
InitEvents
();
...
@@ -280,8 +279,6 @@ main(int argc, char *argv[], char *envp[])
...
@@ -280,8 +279,6 @@ main(int argc, char *argv[], char *envp[])
if
(
screenInfo
.
numScreens
<
1
)
if
(
screenInfo
.
numScreens
<
1
)
FatalError
(
"no screens found"
);
FatalError
(
"no screens found"
);
if
(
screenInfo
.
numVideoScreens
<
0
)
screenInfo
.
numVideoScreens
=
screenInfo
.
numScreens
;
InitExtensions
(
argc
,
argv
);
InitExtensions
(
argc
,
argv
);
if
(
!
InitClientPrivates
(
serverClient
))
if
(
!
InitClientPrivates
(
serverClient
))
FatalError
(
"failed to allocate serverClient devprivates"
);
FatalError
(
"failed to allocate serverClient devprivates"
);
...
...
nx-X11/programs/Xserver/dix/property.c
View file @
67599026
...
@@ -253,11 +253,18 @@ ProcChangeProperty(ClientPtr client)
...
@@ -253,11 +253,18 @@ ProcChangeProperty(ClientPtr client)
else
else
return
client
->
noClientException
;
return
client
->
noClientException
;
}
}
#endif
/* NXAGENT_SERVER */
int
int
#ifdef NXAGENT_SERVER
Xorg_ChangeWindowProperty
(
WindowPtr
pWin
,
Atom
property
,
Atom
type
,
int
format
,
int
mode
,
unsigned
long
len
,
void
*
value
,
Bool
sendevent
)
#else
ChangeWindowProperty
(
WindowPtr
pWin
,
Atom
property
,
Atom
type
,
int
format
,
ChangeWindowProperty
(
WindowPtr
pWin
,
Atom
property
,
Atom
type
,
int
format
,
int
mode
,
unsigned
long
len
,
void
*
value
,
int
mode
,
unsigned
long
len
,
void
*
value
,
Bool
sendevent
)
Bool
sendevent
)
#endif
{
{
PropertyPtr
pProp
;
PropertyPtr
pProp
;
int
sizeInBytes
;
int
sizeInBytes
;
...
@@ -367,7 +374,6 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
...
@@ -367,7 +374,6 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
}
}
return
(
Success
);
return
(
Success
);
}
}
#endif
/* NXAGENT_SERVER */
int
int
DeleteProperty
(
WindowPtr
pWin
,
Atom
propName
)
DeleteProperty
(
WindowPtr
pWin
,
Atom
propName
)
...
...
nx-X11/programs/Xserver/dix/xpstubs.c
deleted
100644 → 0
View file @
5a8f1e92
/*
Copyright 1996, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "misc.h"
#include <X11/fonts/font.h>
extern
Bool
XpClientIsBitmapClient
(
ClientPtr
client
);
extern
Bool
XpClientIsPrintClient
(
ClientPtr
client
,
FontPathElementPtr
fpe
);
Bool
XpClientIsBitmapClient
(
ClientPtr
client
)
{
return
TRUE
;
}
Bool
XpClientIsPrintClient
(
ClientPtr
client
,
FontPathElementPtr
fpe
)
{
return
FALSE
;
}
nx-X11/programs/Xserver/hw/nxagent/Atoms.c
View file @
67599026
...
@@ -75,26 +75,61 @@ Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS];
...
@@ -75,26 +75,61 @@ Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS];
static
char
*
nxagentAtomNames
[
NXAGENT_NUMBER_OF_ATOMS
+
1
]
=
static
char
*
nxagentAtomNames
[
NXAGENT_NUMBER_OF_ATOMS
+
1
]
=
{
{
"NX_IDENTITY"
,
/* 0 */
"NX_IDENTITY"
,
/* 0 */
"WM_PROTOCOLS"
,
/* 1 */
/* NX_IDENTITY was used in earlier nx versions to communicate
"WM_DELETE_WINDOW"
,
/* 2 */
the version to NXwin. Got dropped between nxagent 1.5.0-45
"WM_NX_READY"
,
/* 3 */
and 1.5.0-112. */
"MCOPGLOBALS"
,
/* 4 */
"WM_PROTOCOLS"
,
/* 1 */
"NX_CUT_BUFFER_SERVER"
,
/* 5 */
/* standard ICCCM Atom */
/* Unfortunately we cannot rename this to NX_SELTRANS_TO_AGENT
"WM_DELETE_WINDOW"
,
/* 2 */
/* standard ICCCM Atom */
"WM_NX_READY"
,
/* 3 */
/* nxagent takes the ownership of the selection with this name
to signal the nxclient (or any other watching program)
it is ready. */
"MCOPGLOBALS"
,
/* 4 */
/* used for artsd support. */
"NX_CUT_BUFFER_SERVER"
,
/* 5 */
/* this is the name of a property on nxagent's window on the
real X server. This property is used for passing clipboard
content from clients of the real X server to nxagent's clients
Unfortunately we cannot rename this to NX_SELTRANS_TO_AGENT
because nomachine's nxclient is depending on this
because nomachine's nxclient is depending on this
selection */
selection */
"TARGETS"
,
/* 6 */
"TEXT"
,
/* 7 */
"TARGETS"
,
/* 6 */
"NX_AGENT_SIGNATURE"
,
/* 8 */
/* used to request a list of supported data formats from the
"NXDARWIN"
,
/* 9 */
selection owner. Standard ICCCM Atom */
"TEXT"
,
/* 7 */
/* one of the supported data formats for selections. Standard
ICCCM Atom */
"NX_AGENT_SIGNATURE"
,
/* 8 */
/* this is used to set a property on nxagent's window if nxagent
is started with the fullscreen option set. Unsure, what this
is used for. */
"NXDARWIN"
,
/* 9 */
/* this was an Atom in nxdarwin, nomachine's X server for MacOS. */
"CLIPBOARD"
,
/* 10 */
"CLIPBOARD"
,
/* 10 */
/* Atom for the clipboard selection. PRIMARY is fixed in X11 but
CLIPBOARD is not. Standard ICCCM Atom. */
"TIMESTAMP"
,
/* 11 */
"TIMESTAMP"
,
/* 11 */
/* used to request the time a selection has been owned. Standard
ICCCM Atom */
"UTF8_STRING"
,
/* 12 */
"UTF8_STRING"
,
/* 12 */
/* one of the supported data formats for selections. Standard
ICCCM Atom */
"_NET_WM_STATE"
,
/* 13 */
"_NET_WM_STATE"
,
/* 13 */
/* standard ICCCM Atom */
"_NET_WM_STATE_FULLSCREEN"
,
/* 14 */
"_NET_WM_STATE_FULLSCREEN"
,
/* 14 */
/* standard ICCCM Atom */
"NX_SELTRANS_FROM_AGENT"
,
/* 15 */
"NX_SELTRANS_FROM_AGENT"
,
/* 15 */
/* this is the name of a property on nxagent's window on the real
X server. This property is used for passing clipboard content
from nxagent's clients to clients on the real X server */
"COMPOUND_TEXT"
,
/* 16 */
"COMPOUND_TEXT"
,
/* 16 */
/* one of the supported data formats for selections. Standard
ICCCM Atom */
NULL
,
NULL
,
NULL
NULL
};
};
...
...
nx-X11/programs/Xserver/hw/nxagent/Display.c
View file @
67599026
...
@@ -561,11 +561,6 @@ static void nxagentSigchldHandler(int signal)
...
@@ -561,11 +561,6 @@ static void nxagentSigchldHandler(int signal)
Display
*
nxagentInternalOpenDisplay
(
char
*
display
)
Display
*
nxagentInternalOpenDisplay
(
char
*
display
)
{
{
struct
sigaction
oldAction
;
struct
sigaction
newAction
;
int
result
;
/*
/*
* Stop the smart schedule timer since it uses SIGALRM as we do.
* Stop the smart schedule timer since it uses SIGALRM as we do.
*/
*/
...
@@ -583,12 +578,17 @@ FIXME: Should print a warning if the user tries to let the agent
...
@@ -583,12 +578,17 @@ FIXME: Should print a warning if the user tries to let the agent
explanation for the error to the user.
explanation for the error to the user.
*/
*/
newAction
.
sa_handler
=
nxagentRejectConnection
;
struct
sigaction
newAction
=
{
.
sa_handler
=
nxagentRejectConnection
};
sigfillset
(
&
newAction
.
sa_mask
);
sigfillset
(
&
newAction
.
sa_mask
);
newAction
.
sa_flags
=
0
;
newAction
.
sa_flags
=
0
;
int
result
;
struct
sigaction
oldAction
;
while
(((
result
=
sigaction
(
SIGALRM
,
&
newAction
,
while
(((
result
=
sigaction
(
SIGALRM
,
&
newAction
,
&
oldAction
))
==
-
1
)
&&
(
errno
==
EINTR
));
&
oldAction
))
==
-
1
)
&&
(
errno
==
EINTR
));
...
@@ -754,6 +754,20 @@ static void nxagentDisplayFlushHandler(Display *display, int length)
...
@@ -754,6 +754,20 @@ static void nxagentDisplayFlushHandler(Display *display, int length)
}
}
}
}
/*
* From the changelog for nx-X11-3.0.0-4:
* "Added the _NXDisplayErrorPredicate function in XlibInt.c. It is
* actually a pointer to a function called whenever Xlib is going to
* perform a network operation. If the function returns true, the
* call will be aborted and Xlib will return the control to the ap-
* plication. It is up to the application to set the XlibDisplayIO-
* Error flag after the _NXDisplayErrorPredicate returns true. The
* function can be used to activate additional checks, besides the
* normal failures detected by Xlib on the display socket. For exam-
* ple, the application can set the funciton to verify if an inter-
* rupt was received or if any other event occurred mandating the
+ end of the session."
*/
static
int
nxagentDisplayErrorPredicate
(
Display
*
display
,
int
error
)
static
int
nxagentDisplayErrorPredicate
(
Display
*
display
,
int
error
)
{
{
#ifdef TEST
#ifdef TEST
...
@@ -925,8 +939,6 @@ void nxagentInstallSignalHandlers(void)
...
@@ -925,8 +939,6 @@ void nxagentInstallSignalHandlers(void)
struct
sigaction
newAction
;
struct
sigaction
newAction
;
int
result
;
/*
/*
* By default nxcomp installs its signal handlers. We need to
* By default nxcomp installs its signal handlers. We need to
* ensure that SIGUSR1 and SIGUSR2 are ignored if the NX transport
* ensure that SIGUSR1 and SIGUSR2 are ignored if the NX transport
...
@@ -939,6 +951,8 @@ void nxagentInstallSignalHandlers(void)
...
@@ -939,6 +951,8 @@ void nxagentInstallSignalHandlers(void)
newAction
.
sa_flags
=
0
;
newAction
.
sa_flags
=
0
;
int
result
;
while
(((
result
=
sigaction
(
SIGUSR1
,
&
newAction
,
while
(((
result
=
sigaction
(
SIGUSR1
,
&
newAction
,
NULL
))
==
-
1
)
&&
(
errno
==
EINTR
));
NULL
))
==
-
1
)
&&
(
errno
==
EINTR
));
...
@@ -1054,12 +1068,6 @@ void nxagentPostInstallSignalHandlers(void)
...
@@ -1054,12 +1068,6 @@ void nxagentPostInstallSignalHandlers(void)
void
nxagentResetSignalHandlers
(
void
)
void
nxagentResetSignalHandlers
(
void
)
{
{
struct
sigaction
newAction
;
int
result
;
memset
(
&
newAction
,
0
,
sizeof
(
newAction
));
/*
/*
* Reset the signal handlers to a well known state.
* Reset the signal handlers to a well known state.
*/
*/
...
@@ -1074,10 +1082,13 @@ void nxagentResetSignalHandlers(void)
...
@@ -1074,10 +1082,13 @@ void nxagentResetSignalHandlers(void)
nxagentStopTimer
();
nxagentStopTimer
();
newAction
.
sa_handler
=
SIG_DFL
;
struct
sigaction
newAction
=
{
.
sa_handler
=
SIG_DFL
};
sigfillset
(
&
newAction
.
sa_mask
);
sigfillset
(
&
newAction
.
sa_mask
);
int
result
;
while
(((
result
=
sigaction
(
SIGALRM
,
&
newAction
,
while
(((
result
=
sigaction
(
SIGALRM
,
&
newAction
,
NULL
))
==
-
1
)
&&
(
errno
==
EINTR
));
NULL
))
==
-
1
)
&&
(
errno
==
EINTR
));
...
@@ -1091,7 +1102,6 @@ void nxagentResetSignalHandlers(void)
...
@@ -1091,7 +1102,6 @@ void nxagentResetSignalHandlers(void)
*/
*/
nxagentInitTimer
();
nxagentInitTimer
();
}
}
void
nxagentOpenDisplay
(
int
argc
,
char
*
argv
[])
void
nxagentOpenDisplay
(
int
argc
,
char
*
argv
[])
...
@@ -1100,12 +1110,9 @@ void nxagentOpenDisplay(int argc, char *argv[])
...
@@ -1100,12 +1110,9 @@ void nxagentOpenDisplay(int argc, char *argv[])
return
;
return
;
#ifdef NXAGENT_TIMESTAMP
#ifdef NXAGENT_TIMESTAMP
startTime
=
GetTimeInMillis
();
startTime
=
GetTimeInMillis
();
fprintf
(
stderr
,
"Display: Opening the display on real X server with time [%d] ms.
\n
"
,
fprintf
(
stderr
,
"Display: Opening the display on real X server with time [%d] ms.
\n
"
,
GetTimeInMillis
()
-
startTime
);
GetTimeInMillis
()
-
startTime
);
#endif
#endif
/*
/*
...
@@ -1175,10 +1182,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
...
@@ -1175,10 +1182,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
#endif
#endif
#ifdef NXAGENT_TIMESTAMP
#ifdef NXAGENT_TIMESTAMP
fprintf
(
stderr
,
"Display: Display on real X server opened with time [%d] ms.
\n
"
,
fprintf
(
stderr
,
"Display: Display on real X server opened with time [%d] ms.
\n
"
,
GetTimeInMillis
()
-
startTime
);
GetTimeInMillis
()
-
startTime
);
#endif
#endif
nxagentUseNXTrans
=
nxagentUseNXTrans
=
...
@@ -1397,10 +1402,8 @@ N/A
...
@@ -1397,10 +1402,8 @@ N/A
#endif
#endif
#ifdef NXAGENT_TIMESTAMP
#ifdef NXAGENT_TIMESTAMP
fprintf
(
stderr
,
"Display: Open of the display finished with time [%d] ms.
\n
"
,
fprintf
(
stderr
,
"Display: Open of the display finished with time [%d] ms.
\n
"
,
GetTimeInMillis
()
-
startTime
);
GetTimeInMillis
()
-
startTime
);
#endif
#endif
if
(
nxagentOption
(
Persistent
))
if
(
nxagentOption
(
Persistent
))
...
@@ -1435,10 +1438,11 @@ void nxagentSetDefaultVisual(void)
...
@@ -1435,10 +1438,11 @@ void nxagentSetDefaultVisual(void)
}
}
else
else
{
{
XVisualInfo
vi
=
{
0
};
XVisualInfo
vi
=
{
.
visualid
=
XVisualIDFromVisual
(
DefaultVisual
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
)))
};
vi
.
visualid
=
XVisualIDFromVisual
(
DefaultVisual
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
)));
nxagentDefaultVisualIndex
=
0
;
nxagentDefaultVisualIndex
=
0
;
for
(
int
i
=
0
;
i
<
nxagentNumVisuals
;
i
++
)
for
(
int
i
=
0
;
i
<
nxagentNumVisuals
;
i
++
)
...
@@ -1453,14 +1457,13 @@ void nxagentSetDefaultVisual(void)
...
@@ -1453,14 +1457,13 @@ void nxagentSetDefaultVisual(void)
void
nxagentInitVisuals
(
void
)
void
nxagentInitVisuals
(
void
)
{
{
long
mask
=
VisualScreenMask
;
XVisualInfo
vi
=
{
XVisualInfo
vi
=
{
.
screen
=
DefaultScreen
(
nxagentDisplay
),
.
screen
=
DefaultScreen
(
nxagentDisplay
),
.
depth
=
DefaultDepth
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
))
,
.
depth
=
DefaultDepth
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
))
};
};
long
mask
=
VisualScreenMask
;
int
viNumList
;
int
viNumList
;
XVisualInfo
*
viList
=
XGetVisualInfo
(
nxagentDisplay
,
mask
,
&
vi
,
&
viNumList
);
XVisualInfo
*
viList
=
XGetVisualInfo
(
nxagentDisplay
,
mask
,
&
vi
,
&
viNumList
);
nxagentVisuals
=
(
XVisualInfo
*
)
malloc
(
viNumList
*
sizeof
(
XVisualInfo
));
nxagentVisuals
=
(
XVisualInfo
*
)
malloc
(
viNumList
*
sizeof
(
XVisualInfo
));
nxagentNumVisuals
=
0
;
nxagentNumVisuals
=
0
;
...
@@ -1566,7 +1569,6 @@ XXX: Some X server doesn't list 1 among available depths...
...
@@ -1566,7 +1569,6 @@ XXX: Some X server doesn't list 1 among available depths...
if
(
nxagentDepths
[
j
]
==
i
)
if
(
nxagentDepths
[
j
]
==
i
)
{
{
depth
=
i
;
depth
=
i
;
break
;
break
;
}
}
}
}
...
@@ -1744,7 +1746,6 @@ FIXME: Is this needed?
...
@@ -1744,7 +1746,6 @@ FIXME: Is this needed?
nxagentDisplay
=
NULL
;
nxagentDisplay
=
NULL
;
}
}
Bool
nxagentMakeIcon
(
Display
*
display
,
Pixmap
*
nxIcon
,
Pixmap
*
nxMask
)
Bool
nxagentMakeIcon
(
Display
*
display
,
Pixmap
*
nxIcon
,
Pixmap
*
nxMask
)
{
{
char
**
agentIconData
;
char
**
agentIconData
;
...
@@ -1752,7 +1753,7 @@ Bool nxagentMakeIcon(Display *display, Pixmap *nxIcon, Pixmap *nxMask)
...
@@ -1752,7 +1753,7 @@ Bool nxagentMakeIcon(Display *display, Pixmap *nxIcon, Pixmap *nxMask)
/*
/*
* selecting x2go icon when running as X2Go agent
* selecting x2go icon when running as X2Go agent
*/
*/
if
(
nxagentX2go
)
if
(
nxagentX2go
)
{
{
agentIconData
=
x2goagentIconData
;
agentIconData
=
x2goagentIconData
;
}
}
...
@@ -1778,8 +1779,7 @@ Bool nxagentMakeIcon(Display *display, Pixmap *nxIcon, Pixmap *nxMask)
...
@@ -1778,8 +1779,7 @@ Bool nxagentMakeIcon(Display *display, Pixmap *nxIcon, Pixmap *nxMask)
else
else
{
{
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"%s: Xpm operation failed with error '%s'.
\n
"
,
__func__
,
fprintf
(
stderr
,
"%s: Xpm operation failed.
\n
"
,
__func__
);
XpmGetErrorString
(
status
));
#endif
#endif
return
False
;
return
False
;
...
@@ -1911,14 +1911,15 @@ static int nxagentCheckForDefaultDepthCompatibility(void)
...
@@ -1911,14 +1911,15 @@ static int nxagentCheckForDefaultDepthCompatibility(void)
/*
/*
* Depending on the (reconnect) tolerance checks value, this
* Depending on the (reconnect) tolerance checks value, this
* function checks stricter or looser:
* function checks stricter or looser:
* - Strict means that the old and new default depth values must
* - "Strict" means that the old and new default depth values
* match exactly.
* must match exactly.
* - Safe or Risky means that the default depth values might
* - "Safe" or "Risky" means that the default depth values might differ,
* differ, but the new default depth value must be at least as
* but the new default depth value must be at least as
* high as the former default depth value. This is recommended,
* high as the former default depth value. This is
* because it allows clients with a higher default depth value
* recommended, because it allows clients with a
* to still connect, but not lose functionality.
* higher default depth value to still connect, but
* - Bypass means that all of these checks are essentially
* not lose functionality.
* - "Bypass" means that all of these checks are essentially
* deactivated. This is probably a very bad idea.
* deactivated. This is probably a very bad idea.
*/
*/
...
@@ -1970,17 +1971,19 @@ static int nxagentCheckForDepthsCompatibility(void)
...
@@ -1970,17 +1971,19 @@ static int nxagentCheckForDepthsCompatibility(void)
/*
/*
* Depending on the (reconnect) tolerance checks value, this
* Depending on the (reconnect) tolerance checks value, this
* function checks stricter or looser:
* function checks stricter or looser:
* - Strict means that the number of old and new depths must match
* - "Strict" means that the number of old and new depths must
* exactly and every old depth value must be available in the
* match exactly and every old depth value must be
* new depth array.
* available in the new depth array.
* - Safe means that the number of depths might diverge, but all
* - "Safe" means that the number of depths might diverge,
* former depth must also be included in the new depth
* but all former depth must also be included in the
* array. This is recommended, because it allows clients with
* new depth array. This is recommended, because
* more depths to still connect, but not lose functionality.
* it allows clients with more depths to still
* - Risky means that the new depths array is allowed to be
* connect, but not lose functionality.
* smaller than the old depths array, but at least one depth
* - "Risky" means that the new depths array is allowed to be
* value must be included in both. This is potentially unsafe.
* smaller than the old depths array, but at least
* - Bypass or higher means that all of these checks are
* one depth value must be included in both.
* This is potentially unsafe.
* - "Bypass" or higher means that all of these checks are
* essentially deactivated. This is a very bad idea.
* essentially deactivated. This is a very bad idea.
*/
*/
...
@@ -2021,12 +2024,12 @@ static int nxagentCheckForDepthsCompatibility(void)
...
@@ -2021,12 +2024,12 @@ static int nxagentCheckForDepthsCompatibility(void)
/*
/*
* By now the tolerance is either:
* By now the tolerance is either:
* -
Strict
and both depth numbers match
* -
"Strict"
and both depth numbers match
* -
Safe
and:
* -
"Safe"
and:
* o the number of old and new depths matches exactly, or
* o the number of old and new depths matches exactly, or
* o the number of old depths is lower than the number
* o the number of old depths is lower than the number
* of new depths
* of new depths
* -
Risky
* -
"Risky"
*/
*/
bool
compatible
=
true
;
bool
compatible
=
true
;
...
@@ -2122,19 +2125,21 @@ static int nxagentCheckForPixmapFormatsCompatibility(void)
...
@@ -2122,19 +2125,21 @@ static int nxagentCheckForPixmapFormatsCompatibility(void)
/*
/*
* Depending on the (reconnect) tolerance checks value, this
* Depending on the (reconnect) tolerance checks value, this
* function checks stricter or looser:
* function checks stricter or looser:
* - Strict means that the number of internal and external pixmap
* - "Strict" means that the number of internal and external
* formats must match exactly and every internal pixmap format
* pixmap formats must match exactly and every
* must be available in the external pixmap format array.
* internal pixmap format must be available in the
* - Safe means that the number of pixmap formats might diverge,
* external pixmap format array.
* but all internal pixmap formats must also be included in the
* - "Safe" means that the number of pixmap formats might
* external pixmap formats array. This is recommended, because
* diverge, but all internal pixmap formats must
* it allows clients with more pixmap formats to still connect,
* also be included in the external pixmap formats
* array. This is recommended, because it allows
* clients with more pixmap formats to still connect,
* but not lose functionality.
* but not lose functionality.
* -
Risky means that the internal pixmap formats array is allowed
* -
"Risky" means that the internal pixmap formats array is
*
to be smaller than the external pixmap formats array, but at
*
allowed to be smaller than the external pixmap
*
least one pixmap format must be included in both. This is
*
formats array, but at least one pixmap format must
* potentially unsafe.
*
be included in both. This is
potentially unsafe.
* -
Bypass
or higher means that all of these checks are
* -
"Bypass"
or higher means that all of these checks are
* essentially deactivated. This is a very bad idea.
* essentially deactivated. This is a very bad idea.
*/
*/
...
@@ -2173,13 +2178,13 @@ static int nxagentCheckForPixmapFormatsCompatibility(void)
...
@@ -2173,13 +2178,13 @@ static int nxagentCheckForPixmapFormatsCompatibility(void)
/*
/*
* By now the tolerance is either:
* By now the tolerance is either:
* -
Strict
* -
"Strict"
* -
Safe
and:
* -
"Safe"
and:
* o the number of internal and external pixmap formats
* o the number of internal and external pixmap formats
* matches exactly, or
* matches exactly, or
* o the number of external pixmap formats is higher than
* o the number of external pixmap formats is higher than
* the number of internal pixmap formats,
* the number of internal pixmap formats,
* -
Risky
* -
"Risky"
*/
*/
bool
compatible
=
true
;
bool
compatible
=
true
;
...
@@ -2250,6 +2255,9 @@ static int nxagentInitAndCheckVisuals(int flexibility)
...
@@ -2250,6 +2255,9 @@ static int nxagentInitAndCheckVisuals(int flexibility)
{
{
/* FIXME: does this also need work? */
/* FIXME: does this also need work? */
bool
matched
;
bool
compatible
=
true
;
long
viMask
=
VisualScreenMask
;
long
viMask
=
VisualScreenMask
;
XVisualInfo
viTemplate
=
{
XVisualInfo
viTemplate
=
{
.
screen
=
DefaultScreen
(
nxagentDisplay
),
.
screen
=
DefaultScreen
(
nxagentDisplay
),
...
@@ -2260,8 +2268,6 @@ static int nxagentInitAndCheckVisuals(int flexibility)
...
@@ -2260,8 +2268,6 @@ static int nxagentInitAndCheckVisuals(int flexibility)
XVisualInfo
*
newVisuals
=
malloc
(
sizeof
(
XVisualInfo
)
*
nxagentNumVisuals
);
XVisualInfo
*
newVisuals
=
malloc
(
sizeof
(
XVisualInfo
)
*
nxagentNumVisuals
);
bool
compatible
=
true
;
for
(
int
i
=
0
;
i
<
nxagentNumVisuals
;
i
++
)
for
(
int
i
=
0
;
i
<
nxagentNumVisuals
;
i
++
)
{
{
bool
matched
=
false
;
bool
matched
=
false
;
...
@@ -2473,7 +2479,7 @@ Bool nxagentReconnectDisplay(void *p0)
...
@@ -2473,7 +2479,7 @@ Bool nxagentReconnectDisplay(void *p0)
nxagentNumDefaultColormaps
=
nxagentNumVisuals
;
nxagentNumDefaultColormaps
=
nxagentNumVisuals
;
nxagentDefaultColormaps
=
(
Colormap
*
)
realloc
(
nxagentDefaultColormaps
,
nxagentDefaultColormaps
=
(
Colormap
*
)
realloc
(
nxagentDefaultColormaps
,
nxagentNumDefaultColormaps
*
sizeof
(
Colormap
));
nxagentNumDefaultColormaps
*
sizeof
(
Colormap
));
if
(
nxagentDefaultColormaps
==
NULL
)
if
(
nxagentDefaultColormaps
==
NULL
)
{
{
...
@@ -2603,7 +2609,7 @@ Bool nxagentReconnectDisplay(void *p0)
...
@@ -2603,7 +2609,7 @@ Bool nxagentReconnectDisplay(void *p0)
useXpmIcon
=
nxagentMakeIcon
(
nxagentDisplay
,
&
nxagentIconPixmap
,
&
nxagentIconShape
);
useXpmIcon
=
nxagentMakeIcon
(
nxagentDisplay
,
&
nxagentIconPixmap
,
&
nxagentIconShape
);
/*
/*
*
All
went fine. We can continue handling our clients.
*
Everything
went fine. We can continue handling our clients.
*/
*/
reconnectDisplayState
=
EVERYTHING_DONE
;
reconnectDisplayState
=
EVERYTHING_DONE
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Error.c
View file @
67599026
...
@@ -114,10 +114,11 @@ int nxagentErrorHandler(Display *dpy, XErrorEvent *event)
...
@@ -114,10 +114,11 @@ int nxagentErrorHandler(Display *dpy, XErrorEvent *event)
return
0
;
return
0
;
}
}
/* copied from XlibInt.c */
/* copied from XlibInt.c:_XprintDefaultError
/* extension stuff roughly commented out */
* We cannot use the whole function because it requires XlibInt
/* FIXME: why? What's wrong with printing extension stuff?
* internals. And we cannot call _XPrintDefaultError because it
We could drop this in favour of _XprintDefaultError then! */
* is not exported.
*/
static
int
nxagentPrintError
(
dpy
,
event
,
fp
)
static
int
nxagentPrintError
(
dpy
,
event
,
fp
)
Display
*
dpy
;
Display
*
dpy
;
XErrorEvent
*
event
;
XErrorEvent
*
event
;
...
@@ -126,11 +127,11 @@ static int nxagentPrintError(dpy, event, fp)
...
@@ -126,11 +127,11 @@ static int nxagentPrintError(dpy, event, fp)
char
buffer
[
BUFSIZ
];
char
buffer
[
BUFSIZ
];
char
mesg
[
BUFSIZ
];
char
mesg
[
BUFSIZ
];
char
number
[
32
];
char
number
[
32
];
char
*
mtype
=
"XlibMessage"
;
c
onst
c
har
*
mtype
=
"XlibMessage"
;
/*
#ifndef NXAGENT_SERVER
register
_XExtension
*
ext
=
(
_XExtension
*
)
NULL
;
register
_XExtension
*
ext
=
(
_XExtension
*
)
NULL
;
_XExtension
*
bext
=
(
_XExtension
*
)
NULL
;
_XExtension
*
bext
=
(
_XExtension
*
)
NULL
;
*/
#endif
XGetErrorText
(
dpy
,
event
->
error_code
,
buffer
,
BUFSIZ
);
XGetErrorText
(
dpy
,
event
->
error_code
,
buffer
,
BUFSIZ
);
XGetErrorDatabaseText
(
dpy
,
mtype
,
"XError"
,
"X Error"
,
mesg
,
BUFSIZ
);
XGetErrorDatabaseText
(
dpy
,
mtype
,
"XError"
,
"X Error"
,
mesg
,
BUFSIZ
);
(
void
)
fprintf
(
fp
,
"%s: %s
\n
"
,
mesg
,
buffer
);
(
void
)
fprintf
(
fp
,
"%s: %s
\n
"
,
mesg
,
buffer
);
...
@@ -141,14 +142,16 @@ static int nxagentPrintError(dpy, event, fp)
...
@@ -141,14 +142,16 @@ static int nxagentPrintError(dpy, event, fp)
snprintf
(
number
,
sizeof
(
number
),
"%d"
,
event
->
request_code
);
snprintf
(
number
,
sizeof
(
number
),
"%d"
,
event
->
request_code
);
XGetErrorDatabaseText
(
dpy
,
"XRequest"
,
number
,
""
,
buffer
,
BUFSIZ
);
XGetErrorDatabaseText
(
dpy
,
"XRequest"
,
number
,
""
,
buffer
,
BUFSIZ
);
}
else
{
}
else
{
/* for (ext = dpy->ext_procs;
#ifndef NXAGENT_SERVER
for
(
ext
=
dpy
->
ext_procs
;
ext
&&
(
ext
->
codes
.
major_opcode
!=
event
->
request_code
);
ext
&&
(
ext
->
codes
.
major_opcode
!=
event
->
request_code
);
ext
=
ext
->
next
)
ext
=
ext
->
next
)
;
;
if (ext)
if
(
ext
)
{
strncpy
(
buffer
,
ext
->
name
,
BUFSIZ
);
strncpy
(
buffer
,
ext
->
name
,
BUFSIZ
);
else
buffer
[
BUFSIZ
-
1
]
=
'\0'
;
*/
}
else
#endif
buffer
[
0
]
=
'\0'
;
buffer
[
0
]
=
'\0'
;
}
}
(
void
)
fprintf
(
fp
,
" (%s)
\n
"
,
buffer
);
(
void
)
fprintf
(
fp
,
" (%s)
\n
"
,
buffer
);
...
@@ -157,19 +160,19 @@ static int nxagentPrintError(dpy, event, fp)
...
@@ -157,19 +160,19 @@ static int nxagentPrintError(dpy, event, fp)
mesg
,
BUFSIZ
);
mesg
,
BUFSIZ
);
fputs
(
" "
,
fp
);
fputs
(
" "
,
fp
);
(
void
)
fprintf
(
fp
,
mesg
,
event
->
minor_code
);
(
void
)
fprintf
(
fp
,
mesg
,
event
->
minor_code
);
/*
#ifndef NXAGENT_SERVER
if
(
ext
)
{
if
(
ext
)
{
snprintf
(
mesg
,
sizeof
(
mesg
),
"%s.%d"
,
ext
->
name
,
event
->
minor_code
);
snprintf
(
mesg
,
sizeof
(
mesg
),
"%s.%d"
,
ext
->
name
,
event
->
minor_code
);
XGetErrorDatabaseText
(
dpy
,
"XRequest"
,
mesg
,
""
,
buffer
,
BUFSIZ
);
XGetErrorDatabaseText
(
dpy
,
"XRequest"
,
mesg
,
""
,
buffer
,
BUFSIZ
);
(
void
)
fprintf
(
fp
,
" (%s)"
,
buffer
);
(
void
)
fprintf
(
fp
,
" (%s)"
,
buffer
);
}
}
*/
#endif
fputs
(
"
\n
"
,
fp
);
fputs
(
"
\n
"
,
fp
);
}
}
if
(
event
->
error_code
>=
128
)
{
if
(
event
->
error_code
>=
128
)
{
/* kludge, try to find the extension that caused it */
/* kludge, try to find the extension that caused it */
buffer
[
0
]
=
'\0'
;
buffer
[
0
]
=
'\0'
;
/*
#ifndef NXAGENT_SERVER
for
(
ext
=
dpy
->
ext_procs
;
ext
;
ext
=
ext
->
next
)
{
for
(
ext
=
dpy
->
ext_procs
;
ext
;
ext
=
ext
->
next
)
{
if
(
ext
->
error_string
)
if
(
ext
->
error_string
)
(
*
ext
->
error_string
)(
dpy
,
event
->
error_code
,
&
ext
->
codes
,
(
*
ext
->
error_string
)(
dpy
,
event
->
error_code
,
&
ext
->
codes
,
...
@@ -187,7 +190,7 @@ static int nxagentPrintError(dpy, event, fp)
...
@@ -187,7 +190,7 @@ static int nxagentPrintError(dpy, event, fp)
snprintf
(
buffer
,
sizeof
(
buffer
),
"%s.%d"
,
bext
->
name
,
snprintf
(
buffer
,
sizeof
(
buffer
),
"%s.%d"
,
bext
->
name
,
event
->
error_code
-
bext
->
codes
.
first_error
);
event
->
error_code
-
bext
->
codes
.
first_error
);
else
else
*/
#endif
strcpy
(
buffer
,
"Value"
);
strcpy
(
buffer
,
"Value"
);
XGetErrorDatabaseText
(
dpy
,
mtype
,
buffer
,
""
,
mesg
,
BUFSIZ
);
XGetErrorDatabaseText
(
dpy
,
mtype
,
buffer
,
""
,
mesg
,
BUFSIZ
);
if
(
mesg
[
0
])
{
if
(
mesg
[
0
])
{
...
@@ -196,12 +199,12 @@ static int nxagentPrintError(dpy, event, fp)
...
@@ -196,12 +199,12 @@ static int nxagentPrintError(dpy, event, fp)
fputs
(
"
\n
"
,
fp
);
fputs
(
"
\n
"
,
fp
);
}
}
/* let extensions try to print the values */
/* let extensions try to print the values */
/*
#ifndef NXAGENT_SERVER
for
(
ext
=
dpy
->
ext_procs
;
ext
;
ext
=
ext
->
next
)
{
for
(
ext
=
dpy
->
ext_procs
;
ext
;
ext
=
ext
->
next
)
{
if
(
ext
->
error_values
)
if
(
ext
->
error_values
)
(
*
ext
->
error_values
)(
dpy
,
event
,
fp
);
(
*
ext
->
error_values
)(
dpy
,
event
,
fp
);
}
}
*/
#endif
}
else
if
((
event
->
error_code
==
BadWindow
)
||
}
else
if
((
event
->
error_code
==
BadWindow
)
||
(
event
->
error_code
==
BadPixmap
)
||
(
event
->
error_code
==
BadPixmap
)
||
(
event
->
error_code
==
BadCursor
)
||
(
event
->
error_code
==
BadCursor
)
||
...
@@ -229,10 +232,12 @@ static int nxagentPrintError(dpy, event, fp)
...
@@ -229,10 +232,12 @@ static int nxagentPrintError(dpy, event, fp)
mesg
,
BUFSIZ
);
mesg
,
BUFSIZ
);
fputs
(
" "
,
fp
);
fputs
(
" "
,
fp
);
(
void
)
fprintf
(
fp
,
mesg
,
event
->
serial
);
(
void
)
fprintf
(
fp
,
mesg
,
event
->
serial
);
/* XGetErrorDatabaseText(dpy, mtype, "CurrentSerial", "Current Serial #%d",
#ifndef NXAGENT_SERVER
XGetErrorDatabaseText
(
dpy
,
mtype
,
"CurrentSerial"
,
"Current Serial #%d"
,
mesg
,
BUFSIZ
);
mesg
,
BUFSIZ
);
fputs
(
"
\n
"
,
fp
);
fputs
(
"
\n
"
,
fp
);
(void) fprintf(fp, mesg, dpy->request); */
(
void
)
fprintf
(
fp
,
mesg
,
(
unsigned
long
long
)(
X_DPY_GET_REQUEST
(
dpy
)));
#endif
fputs
(
"
\n
"
,
fp
);
fputs
(
"
\n
"
,
fp
);
if
(
event
->
error_code
==
BadImplementation
)
return
0
;
if
(
event
->
error_code
==
BadImplementation
)
return
0
;
return
1
;
return
1
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Events.c
View file @
67599026
...
@@ -2197,7 +2197,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
...
@@ -2197,7 +2197,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
{
{
if
(
nxagentOption
(
AllScreens
)
==
0
&&
nxagentOption
(
Fullscreen
)
==
1
)
if
(
nxagentOption
(
AllScreens
)
==
0
&&
nxagentOption
(
Fullscreen
)
==
1
)
{
{
nxagentSwitchFullscreen
(
pScreen
,
0
);
nxagentSwitchFullscreen
(
pScreen
,
False
);
}
}
else
else
{
{
...
@@ -2578,11 +2578,6 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
...
@@ -2578,11 +2578,6 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
{
{
*
result
=
doNothing
;
*
result
=
doNothing
;
#ifdef TEST
fprintf
(
stderr
,
"%s: ClientMessage event window [%ld] with type [%ld] format [%d].
\n
"
,
__func__
,
X
->
xclient
.
window
,
X
->
xclient
.
message_type
,
X
->
xclient
.
format
);
#endif
/*
/*
* If window is 0, message_type is 0 and format is 32 then we assume
* If window is 0, message_type is 0 and format is 32 then we assume
* event is coming from proxy.
* event is coming from proxy.
...
@@ -2592,11 +2587,25 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
...
@@ -2592,11 +2587,25 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
X
->
xclient
.
message_type
==
0
&&
X
->
xclient
.
message_type
==
0
&&
X
->
xclient
.
format
==
32
)
X
->
xclient
.
format
==
32
)
{
{
#ifdef TEST
fprintf
(
stderr
,
"%s: got nxproxy event
\n
"
,
__func__
);
#endif
nxagentHandleProxyEvent
(
X
);
nxagentHandleProxyEvent
(
X
);
return
1
;
return
1
;
}
}
#ifdef TEST
char
*
name
=
XGetAtomName
(
nxagentDisplay
,
X
->
xclient
.
message_type
);
fprintf
(
stderr
,
"nxagentHandleClientMessageEvent: ClientMessage event window [0x%lx] with "
"message_type [%ld][%s] format [%d] type [%d] source_indication [%ld][%s] timestamp [%ld] "
"curwin [0x%lx].
\n
"
,
X
->
xclient
.
window
,
X
->
xclient
.
message_type
,
name
,
X
->
xclient
.
format
,
X
->
xclient
.
type
,
X
->
xclient
.
data
.
l
[
0
],
X
->
xclient
.
data
.
l
[
0
]
==
1
?
"'application'"
:
X
->
xclient
.
data
.
l
[
0
]
==
1
?
"'pager'"
:
"'none (old spec)'"
,
X
->
xclient
.
data
.
l
[
1
],
X
->
xclient
.
data
.
l
[
2
]);
SAFE_XFree
(
name
);
#endif
if
(
nxagentOption
(
Rootless
))
if
(
nxagentOption
(
Rootless
))
{
{
Atom
message_type
=
nxagentRemoteToLocalAtom
(
X
->
xclient
.
message_type
);
Atom
message_type
=
nxagentRemoteToLocalAtom
(
X
->
xclient
.
message_type
);
...
@@ -2611,11 +2620,20 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
...
@@ -2611,11 +2620,20 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
}
}
WindowPtr
pWin
=
nxagentWindowPtr
(
X
->
xclient
.
window
);
WindowPtr
pWin
=
nxagentWindowPtr
(
X
->
xclient
.
window
);
if
(
pWin
==
NULL
)
if
(
pWin
==
NULL
)
{
{
/*
* If some window on the real X server sends a
* _NET_ACTIVE_WINDOW ClientMessage to indicate the active
* window that window will be one not belonging to nxagent so
* this situation is perfectly legal. For all other situations
* we print a warning.
*/
#ifdef WARNING
#ifdef WARNING
fprintf
(
stderr
,
"WARNING: Invalid window in ClientMessage.
\n
"
);
if
(
message_type
!=
MakeAtom
(
"_NET_ACTIVE_WINDOW"
,
strlen
(
"_NET_ACTIVE_WINDOW"
),
False
))
{
fprintf
(
stderr
,
"WARNING: Invalid window in ClientMessage xclient.window [0x%lx].
\n
"
,
X
->
xclient
.
window
);
}
#endif
#endif
return
0
;
return
0
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Font.c
View file @
67599026
...
@@ -469,9 +469,6 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont)
...
@@ -469,9 +469,6 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont)
FontSetPrivate
(
pFont
,
nxagentFontPrivateIndex
,
NULL
);
FontSetPrivate
(
pFont
,
nxagentFontPrivateIndex
,
NULL
);
#endif
/* HAS_XFONT2 */
#endif
/* HAS_XFONT2 */
if
(
requestingClient
&&
XpClientIsPrintClient
(
requestingClient
,
NULL
))
return
True
;
name_atom
=
MakeAtom
(
"FONT"
,
4
,
True
);
name_atom
=
MakeAtom
(
"FONT"
,
4
,
True
);
value_atom
=
0L
;
value_atom
=
0L
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Handlers.c
View file @
67599026
...
@@ -726,8 +726,6 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas
...
@@ -726,8 +726,6 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas
}
}
#endif
#endif
#ifndef __CYGWIN32__
if
(
nxagentReadEvents
(
nxagentDisplay
)
>
0
||
if
(
nxagentReadEvents
(
nxagentDisplay
)
>
0
||
nxagentReadEvents
(
nxagentShadowDisplay
)
>
0
)
nxagentReadEvents
(
nxagentShadowDisplay
)
>
0
)
{
{
...
@@ -745,19 +743,6 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas
...
@@ -745,19 +743,6 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas
nxagentShadowAdaptToRatio
();
nxagentShadowAdaptToRatio
();
}
}
#else
if
(
nxagentReadEvents
(
nxagentDisplay
)
>
0
)
{
#ifdef TEST
fprintf
(
stderr
,
"nxagentShadowBlockHandler: Reading X events queued.
\n
"
);
#endif
nxagentDispatchEvents
(
NULL
);
}
#endif
changed
=
0
;
changed
=
0
;
NXShadowGetScreenSize
(
&
width_
,
&
height_
);
NXShadowGetScreenSize
(
&
width_
,
&
height_
);
...
@@ -800,26 +785,6 @@ FIXME: Must queue multiple writes and handle the events by resembling
...
@@ -800,26 +785,6 @@ FIXME: Must queue multiple writes and handle the events by resembling
*
timeout
=
&
zero
;
*
timeout
=
&
zero
;
}
}
#ifdef __CYGWIN32__
if
(
nxagentOption
(
SleepTime
)
>
0
)
{
#ifdef TEST
fprintf
(
stderr
,
"nxagentShadowBlockHandler: sleeping for %d milliseconds for slowdown.
\n
"
,
nxagentOption
(
SleepTime
));
#endif
usleep
(
nxagentOption
(
SleepTime
)
*
1000
);
}
#ifdef TEST
else
if
(
0
==
nxagentOption
(
SleepTime
))
{
fprintf
(
stderr
,
"nxagentShadowBlockHandler: not sleeping for slowdown.
\n
"
);
}
#endif
(
*
timeout
)
->
tv_sec
=
0
;
(
*
timeout
)
->
tv_usec
=
50
*
1000
;
#else
if
(
changed
==
0
)
if
(
changed
==
0
)
{
{
(
*
timeout
)
->
tv_sec
=
0
;
(
*
timeout
)
->
tv_sec
=
0
;
...
@@ -831,8 +796,6 @@ FIXME: Must queue multiple writes and handle the events by resembling
...
@@ -831,8 +796,6 @@ FIXME: Must queue multiple writes and handle the events by resembling
(
*
timeout
)
->
tv_usec
=
0
;
(
*
timeout
)
->
tv_usec
=
0
;
}
}
#endif
nxagentPrintGeometry
();
nxagentPrintGeometry
();
#ifdef BLOCKS
#ifdef BLOCKS
...
@@ -857,7 +820,6 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask)
...
@@ -857,7 +820,6 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask)
if
(
!
SmartScheduleSignalEnable
)
if
(
!
SmartScheduleSignalEnable
)
{
{
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentShadowWakeupHandler: Resetting the dispatch state after wakeup.
\n
"
);
fprintf
(
stderr
,
"nxagentShadowWakeupHandler: Resetting the dispatch state after wakeup.
\n
"
);
#endif
#endif
...
@@ -866,7 +828,6 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask)
...
@@ -866,7 +828,6 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask)
nxagentDispatch
.
in
=
nxagentBytesIn
;
nxagentDispatch
.
in
=
nxagentBytesIn
;
nxagentDispatch
.
out
=
nxagentBytesOut
;
nxagentDispatch
.
out
=
nxagentBytesOut
;
}
}
/*
/*
...
...
nx-X11/programs/Xserver/hw/nxagent/Image.c
View file @
67599026
...
@@ -99,6 +99,7 @@ extern void nxagentBitOrderInvert(unsigned char *, int);
...
@@ -99,6 +99,7 @@ extern void nxagentBitOrderInvert(unsigned char *, int);
extern
void
nxagentTwoByteSwap
(
unsigned
char
*
,
register
int
);
extern
void
nxagentTwoByteSwap
(
unsigned
char
*
,
register
int
);
extern
void
nxagentFourByteSwap
(
register
unsigned
char
*
,
register
int
);
extern
void
nxagentFourByteSwap
(
register
unsigned
char
*
,
register
int
);
extern
ClientPtr
nxagentRequestingClient
;
/*
/*
* Store the last visual used to unpack the images for the given
* Store the last visual used to unpack the images for the given
* client.
* client.
...
@@ -140,9 +141,7 @@ static char *nxagentImageCopy(XImage *source, XImage *destination);
...
@@ -140,9 +141,7 @@ static char *nxagentImageCopy(XImage *source, XImage *destination);
* expensive than a copy.
* expensive than a copy.
*/
*/
#define nxagentNeedCache(image, method) \
#define nxagentNeedCache(image, method) ((method) != PACK_BITMAP_16M_COLORS)
\
((method) != PACK_BITMAP_16M_COLORS)
/*
/*
* With the bitmap encoding, if the image is 32 bits-per-pixel the 4th
* With the bitmap encoding, if the image is 32 bits-per-pixel the 4th
...
@@ -276,6 +275,7 @@ int nxagentImagePad(int width, int format, int leftPad, int depth)
...
@@ -276,6 +275,7 @@ int nxagentImagePad(int width, int format, int leftPad, int depth)
else
if
(
format
==
XYPixmap
)
else
if
(
format
==
XYPixmap
)
{
{
line
=
BitmapBytePad
(
width
+
leftPad
);
line
=
BitmapBytePad
(
width
+
leftPad
);
/* FIXME: shouldn't we multiply by depth here like in nxagentImageLength? */
}
}
else
if
(
format
==
ZPixmap
)
else
if
(
format
==
ZPixmap
)
{
{
...
@@ -1074,7 +1074,7 @@ void nxagentPutSubImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
...
@@ -1074,7 +1074,7 @@ void nxagentPutSubImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
/*
/*
FIXME: Should use an unpack resource here.
FIXME: Should use an unpack resource here.
*/
*/
client
=
r
equestingClient
;
client
=
nxagentR
equestingClient
;
if
(
client
==
NULL
)
if
(
client
==
NULL
)
{
{
...
@@ -1093,7 +1093,7 @@ FIXME: Should use an unpack resource here.
...
@@ -1093,7 +1093,7 @@ FIXME: Should use an unpack resource here.
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"nxagentPutSubImage: Display image order is [%d] bitmap order is [%d].
\n
"
,
fprintf
(
stderr
,
"nxagentPutSubImage: Display image order is [%d] bitmap order is [%d].
\n
"
,
ImageByteOrder
(
nxagentDisplay
),
nxagent
BitmapBitOrder
(
nxagentDisplay
));
ImageByteOrder
(
nxagentDisplay
),
BitmapBitOrder
(
nxagentDisplay
));
#endif
#endif
/*
/*
...
@@ -1559,7 +1559,6 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio,
...
@@ -1559,7 +1559,6 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio,
XImage
**
pImage
,
int
*
scaledx
,
int
*
scaledy
)
XImage
**
pImage
,
int
*
scaledx
,
int
*
scaledy
)
{
{
XImage
*
image
=
*
pImage
;
XImage
*
image
=
*
pImage
;
if
(
image
==
NULL
)
if
(
image
==
NULL
)
{
{
return
0
;
return
0
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Imakefile
View file @
67599026
...
@@ -59,7 +59,6 @@ SRCS = \
...
@@ -59,7 +59,6 @@ SRCS = \
Composite.c \
Composite.c \
Pixels.c \
Pixels.c \
stubs.c \
stubs.c \
xpstubs.c \
miinitext.c \
miinitext.c \
$(NULL)
$(NULL)
...
@@ -116,7 +115,6 @@ OBJS = \
...
@@ -116,7 +115,6 @@ OBJS = \
Composite.o \
Composite.o \
Pixels.o \
Pixels.o \
stubs.o \
stubs.o \
xpstubs.o \
miinitext.o \
miinitext.o \
$(NULL)
$(NULL)
...
@@ -264,7 +262,6 @@ DEFINES = \
...
@@ -264,7 +262,6 @@ DEFINES = \
all:: $(OBJS)
all:: $(OBJS)
LinkSourceFile(stubs.c,$(SERVERSRC)/Xi)
LinkSourceFile(stubs.c,$(SERVERSRC)/Xi)
LinkSourceFile(xpstubs.c,$(SERVERSRC)/dix)
LinkSourceFile(miinitext.c,$(SERVERSRC)/mi)
LinkSourceFile(miinitext.c,$(SERVERSRC)/mi)
SpecialCObjectRule(miinitext,$(ICONFIGFILES), $(_NOOP_))
SpecialCObjectRule(miinitext,$(ICONFIGFILES), $(_NOOP_))
...
...
nx-X11/programs/Xserver/hw/nxagent/Init.h
View file @
67599026
...
@@ -45,7 +45,7 @@ extern int nxagentDoFullGeneration;
...
@@ -45,7 +45,7 @@ extern int nxagentDoFullGeneration;
extern
int
nxagentBackingStore
;
extern
int
nxagentBackingStore
;
extern
int
nxagentSaveUnder
;
extern
int
nxagentSaveUnder
;
extern
int
nxagentX2go
;
extern
int
nxagentX2go
;
void
checkX2goAgent
(
void
);
void
checkX2goAgent
(
void
);
extern
ServerGrabInfoRec
nxagentGrabServerInfo
;
extern
ServerGrabInfoRec
nxagentGrabServerInfo
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
View file @
67599026
...
@@ -567,7 +567,7 @@ XkbError:
...
@@ -567,7 +567,7 @@ XkbError:
if
(
nxagentKeyboard
[
i
]
==
'\0'
||
nxagentKeyboard
[
i
+
1
]
==
'\0'
||
i
==
0
)
if
(
nxagentKeyboard
[
i
]
==
'\0'
||
nxagentKeyboard
[
i
+
1
]
==
'\0'
||
i
==
0
)
{
{
ErrorF
(
"Warning: Wrong keyboard type:
%s
.
\n
"
,
nxagentKeyboard
);
ErrorF
(
"Warning: Wrong keyboard type:
'%s'
.
\n
"
,
nxagentKeyboard
);
goto
XkbError
;
goto
XkbError
;
}
}
...
@@ -1466,7 +1466,7 @@ static void nxagentWriteKeyboardDir(void)
...
@@ -1466,7 +1466,7 @@ static void nxagentWriteKeyboardDir(void)
if
(
keyboard_file_path
)
if
(
keyboard_file_path
)
{
{
/*
/*
* special case: if rules is NULL create a directory instea
s
of
* special case: if rules is NULL create a directory instea
d
of
* a file. This is the defined method to disable x2gosetkeyboard.
* a file. This is the defined method to disable x2gosetkeyboard.
*/
*/
if
(
mkdir
(
keyboard_file_path
,
0555
)
<
0
)
if
(
mkdir
(
keyboard_file_path
,
0555
)
<
0
)
...
...
nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
View file @
67599026
...
@@ -432,7 +432,7 @@ void nxagentDumpKeystrokes(void)
...
@@ -432,7 +432,7 @@ void nxagentDumpKeystrokes(void)
{
{
int
maxlen
=
0
;
int
maxlen
=
0
;
for
(
int
i
=
0
;
nxagentSpecialKeystrokeNames
[
i
];
i
++
)
for
(
int
i
=
0
;
nxagentSpecialKeystrokeNames
[
i
];
i
++
)
maxlen
=
m
in
(
maxlen
,
strlen
(
nxagentSpecialKeystrokeNames
[
i
]));
maxlen
=
m
ax
(
maxlen
,
strlen
(
nxagentSpecialKeystrokeNames
[
i
]));
fprintf
(
stderr
,
"Currently known keystrokes:
\n
"
);
fprintf
(
stderr
,
"Currently known keystrokes:
\n
"
);
...
...
nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
View file @
67599026
...
@@ -200,6 +200,12 @@ extern int nxagentMaxSelections;
...
@@ -200,6 +200,12 @@ extern int nxagentMaxSelections;
extern
int
nxOpenFont
(
ClientPtr
,
XID
,
Mask
,
unsigned
,
char
*
);
extern
int
nxOpenFont
(
ClientPtr
,
XID
,
Mask
,
unsigned
,
char
*
);
/*
* This used to be a dix variable used only by XPRINT, so xorg dropped it.
*/
ClientPtr
nxagentRequestingClient
;
void
void
InitSelections
(
void
)
InitSelections
(
void
)
{
{
...
@@ -245,6 +251,7 @@ Dispatch(void)
...
@@ -245,6 +251,7 @@ Dispatch(void)
InitSelections
();
InitSelections
();
nClients
=
0
;
nClients
=
0
;
#ifdef NXAGENT_SERVER
/*
/*
* The agent initialization was successfully
* The agent initialization was successfully
* completed. We can now handle our clients.
* completed. We can now handle our clients.
...
@@ -269,10 +276,12 @@ Dispatch(void)
...
@@ -269,10 +276,12 @@ Dispatch(void)
#endif
#endif
#endif
/* NXAGENT_SERVER */
clientReady
=
(
int
*
)
malloc
(
sizeof
(
int
)
*
MaxClients
);
clientReady
=
(
int
*
)
malloc
(
sizeof
(
int
)
*
MaxClients
);
if
(
!
clientReady
)
if
(
!
clientReady
)
return
;
return
;
#ifdef NXAGENT_SERVER
#ifdef WATCH
#ifdef WATCH
fprintf
(
stderr
,
"Dispatch: Watchpoint 12.
\n
"
);
fprintf
(
stderr
,
"Dispatch: Watchpoint 12.
\n
"
);
...
@@ -303,6 +312,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
...
@@ -303,6 +312,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
if
(
!
(
dispatchException
&
DE_TERMINATE
))
if
(
!
(
dispatchException
&
DE_TERMINATE
))
dispatchException
=
0
;
dispatchException
=
0
;
#endif
/* NXAGENT_SERVER */
while
(
!
dispatchException
)
while
(
!
dispatchException
)
{
{
...
@@ -312,6 +322,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
...
@@ -312,6 +322,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
FlushIfCriticalOutputPending
();
FlushIfCriticalOutputPending
();
}
}
#ifdef NXAGENT_SERVER
/*
/*
* Ensure we remove the splash after the timeout.
* Ensure we remove the splash after the timeout.
* Initializing clientReady[0] to -1 will tell
* Initializing clientReady[0] to -1 will tell
...
@@ -351,9 +362,11 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
...
@@ -351,9 +362,11 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
#ifdef BLOCKS
#ifdef BLOCKS
fprintf
(
stderr
,
"[End dispatch]
\n
"
);
fprintf
(
stderr
,
"[End dispatch]
\n
"
);
#endif
#endif
#endif
/* NXAGENT_SERVER */
nready
=
WaitForSomething
(
clientReady
);
nready
=
WaitForSomething
(
clientReady
);
#ifdef NXAGENT_SERVER
#ifdef BLOCKS
#ifdef BLOCKS
fprintf
(
stderr
,
"[Begin dispatch]
\n
"
);
fprintf
(
stderr
,
"[Begin dispatch]
\n
"
);
#endif
#endif
...
@@ -378,6 +391,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
...
@@ -378,6 +391,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
nxagentClients
=
nClients
;
nxagentClients
=
nClients
;
#endif
#endif
#endif
/* NXAGENT_SERVER */
if
(
nready
)
if
(
nready
)
{
{
...
@@ -405,7 +419,9 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
...
@@ -405,7 +419,9 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
}
}
isItTimeToYield
=
FALSE
;
isItTimeToYield
=
FALSE
;
requestingClient
=
client
;
#ifdef NXAGENT_SERVER
nxagentRequestingClient
=
client
;
#endif
start_tick
=
SmartScheduleTime
;
start_tick
=
SmartScheduleTime
;
while
(
!
isItTimeToYield
)
while
(
!
isItTimeToYield
)
{
{
...
@@ -423,10 +439,15 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
...
@@ -423,10 +439,15 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
}
}
/* now, finally, deal with client requests */
/* now, finally, deal with client requests */
/* Update currentTime so request time checks, such as for input
* device grabs, are calculated correctly */
UpdateCurrentTimeIf
();
#ifdef NXAGENT_SERVER
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"******Dispatch: Reading request from client [%d].
\n
"
,
fprintf
(
stderr
,
"******Dispatch: Reading request from client [%d].
\n
"
,
client
->
index
);
client
->
index
);
#endif
#endif
#endif
/* NXAGENT_SERVER */
result
=
ReadRequestFromClient
(
client
);
result
=
ReadRequestFromClient
(
client
);
if
(
result
<=
0
)
if
(
result
<=
0
)
...
@@ -435,8 +456,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
...
@@ -435,8 +456,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
CloseDownClient
(
client
);
CloseDownClient
(
client
);
break
;
break
;
}
}
#ifdef NXAGENT_SERVER
#ifdef NXAGENT_SERVER
#ifdef TEST
#ifdef TEST
else
else
...
@@ -463,10 +484,9 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
...
@@ -463,10 +484,9 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
if
(
result
>
(
maxBigRequestSize
<<
2
))
if
(
result
>
(
maxBigRequestSize
<<
2
))
result
=
BadLength
;
result
=
BadLength
;
else
else
#ifdef NXAGENT_SERVER
{
{
result
=
(
*
client
->
requestVector
[
MAJOROP
])(
client
);
result
=
(
*
client
->
requestVector
[
MAJOROP
])(
client
);
#ifdef NXAGENT_SERVER
#ifdef TEST
#ifdef TEST
if
(
MAJOROP
>
127
)
if
(
MAJOROP
>
127
)
...
@@ -492,11 +512,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
...
@@ -492,11 +512,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
*/
*/
nxagentDispatchHandler
(
client
,
client
->
req_len
<<
2
,
0
);
nxagentDispatchHandler
(
client
,
client
->
req_len
<<
2
,
0
);
}
#else
result
=
(
*
client
->
requestVector
[
MAJOROP
])(
client
);
#endif
#endif
}
if
(
!
SmartScheduleSignalEnable
)
if
(
!
SmartScheduleSignalEnable
)
SmartScheduleTime
=
GetTimeInMillis
();
SmartScheduleTime
=
GetTimeInMillis
();
...
@@ -519,13 +536,17 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
...
@@ -519,13 +536,17 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
client
=
clients
[
clientReady
[
nready
]];
client
=
clients
[
clientReady
[
nready
]];
if
(
client
)
if
(
client
)
client
->
smart_stop_tick
=
SmartScheduleTime
;
client
->
smart_stop_tick
=
SmartScheduleTime
;
requestingClient
=
NULL
;
#ifdef NXAGENT_SERVER
nxagentRequestingClient
=
NULL
;
#endif
}
}
dispatchException
&=
~
DE_PRIORITYCHANGE
;
dispatchException
&=
~
DE_PRIORITYCHANGE
;
}
}
#if defined(DDXBEFORERESET)
#if defined(DDXBEFORERESET)
ddxBeforeReset
();
ddxBeforeReset
();
#endif
#endif
#ifdef NXAGENT_SERVER
/* FIXME: maybe move the code up to the KillAllClients() call to ddxBeforeReset? */
/* FIXME: maybe move the code up to the KillAllClients() call to ddxBeforeReset? */
if
((
dispatchException
&
DE_RESET
)
&&
if
((
dispatchException
&
DE_RESET
)
&&
(
serverGeneration
>
nxagentMaxAllowedResets
))
(
serverGeneration
>
nxagentMaxAllowedResets
))
...
@@ -559,6 +580,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
...
@@ -559,6 +580,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
NXShadowDestroy
();
NXShadowDestroy
();
}
}
saveAgentState
(
"TERMINATED"
);
saveAgentState
(
"TERMINATED"
);
#endif
/* NXAGENT_SERVER */
KillAllClients
();
KillAllClients
();
free
(
clientReady
);
free
(
clientReady
);
...
@@ -580,7 +602,9 @@ ProcReparentWindow(register ClientPtr client)
...
@@ -580,7 +602,9 @@ ProcReparentWindow(register ClientPtr client)
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
#ifdef NXAGENT_SERVER
nxagentRemoveSplashWindow
();
nxagentRemoveSplashWindow
();
#endif
pParent
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
parent
,
client
,
pParent
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
parent
,
client
,
DixWriteAccess
);
DixWriteAccess
);
...
@@ -807,7 +831,7 @@ ProcCloseFont(register ClientPtr client)
...
@@ -807,7 +831,7 @@ ProcCloseFont(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pFont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_FONT
,
pFont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_FONT
,
DixDestroyAccess
);
DixDestroyAccess
);
if
(
pFont
!=
(
FontPtr
)
NULL
)
if
(
pFont
!=
(
FontPtr
)
NULL
)
/* id was valid */
{
{
#ifdef NXAGENT_SERVER
#ifdef NXAGENT_SERVER
...
@@ -1140,6 +1164,8 @@ CloseDownClient(register ClientPtr client)
...
@@ -1140,6 +1164,8 @@ CloseDownClient(register ClientPtr client)
xorg_CloseDownClient
(
client
);
xorg_CloseDownClient
(
client
);
}
}
/* FIXME: Instead of having a own function use the provided Callback
mechanism */
int
int
InitClientPrivates
(
ClientPtr
client
)
InitClientPrivates
(
ClientPtr
client
)
{
{
...
...
nx-X11/programs/Xserver/hw/nxagent/NXpicture.c
View file @
67599026
...
@@ -215,7 +215,9 @@ AllocatePicture (ScreenPtr pScreen)
...
@@ -215,7 +215,9 @@ AllocatePicture (ScreenPtr pScreen)
ppriv
->
ptr
=
(
void
*
)
NULL
;
ppriv
->
ptr
=
(
void
*
)
NULL
;
}
}
#ifdef NXAGENT_SERVER
nxagentPicturePriv
(
pPicture
)
->
picture
=
0
;
nxagentPicturePriv
(
pPicture
)
->
picture
=
0
;
#endif
return
pPicture
;
return
pPicture
;
}
}
...
@@ -245,13 +247,14 @@ CreatePicture (Picture pid,
...
@@ -245,13 +247,14 @@ CreatePicture (Picture pid,
pPicture
->
format
=
pFormat
->
format
|
(
pDrawable
->
bitsPerPixel
<<
24
);
pPicture
->
format
=
pFormat
->
format
|
(
pDrawable
->
bitsPerPixel
<<
24
);
if
(
pDrawable
->
type
==
DRAWABLE_PIXMAP
)
if
(
pDrawable
->
type
==
DRAWABLE_PIXMAP
)
{
{
#ifdef NXAGENT_SERVER
/*
/*
* Let picture always point to the virtual pixmap.
* Let picture always point to the virtual pixmap.
* For sure this is not the best way to deal with
* For sure this is not the best way to deal with
* the virtual frame-buffer.
* the virtual frame-buffer.
*/
*/
pPicture
->
pDrawable
=
nxagentVirtualDrawable
(
pDrawable
);
pPicture
->
pDrawable
=
nxagentVirtualDrawable
(
pDrawable
);
#endif
++
((
PixmapPtr
)
pDrawable
)
->
refcnt
;
++
((
PixmapPtr
)
pDrawable
)
->
refcnt
;
pPicture
->
pNext
=
0
;
pPicture
->
pNext
=
0
;
}
}
...
...
nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
View file @
67599026
...
@@ -215,16 +215,9 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
...
@@ -215,16 +215,9 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
int
mode
,
unsigned
long
len
,
void
*
value
,
int
mode
,
unsigned
long
len
,
void
*
value
,
Bool
sendevent
)
Bool
sendevent
)
{
{
PropertyPtr
pProp
;
int
sizeInBytes
=
format
>>
3
;
int
sizeInBytes
;
int
totalSize
=
len
*
sizeInBytes
;
int
totalSize
;
int
copySize
=
nxagentOption
(
CopyBufferSize
);
void
*
data
;
int
copySize
;
sizeInBytes
=
format
>>
3
;
totalSize
=
len
*
sizeInBytes
;
copySize
=
nxagentOption
(
CopyBufferSize
);
if
(
copySize
!=
COPY_UNLIMITED
&&
property
==
clientCutProperty
)
if
(
copySize
!=
COPY_UNLIMITED
&&
property
==
clientCutProperty
)
{
{
...
@@ -236,105 +229,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
...
@@ -236,105 +229,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
}
}
}
}
/* first see if property already exists */
return
Xorg_ChangeWindowProperty
(
pWin
,
property
,
type
,
format
,
mode
,
len
,
value
,
sendevent
);
pProp
=
wUserProps
(
pWin
);
while
(
pProp
)
{
if
(
pProp
->
propertyName
==
property
)
break
;
pProp
=
pProp
->
next
;
}
if
(
!
pProp
)
/* just add to list */
{
if
(
!
pWin
->
optional
&&
!
MakeWindowOptional
(
pWin
))
return
(
BadAlloc
);
pProp
=
(
PropertyPtr
)
malloc
(
sizeof
(
PropertyRec
));
if
(
!
pProp
)
return
(
BadAlloc
);
data
=
(
void
*
)
malloc
(
totalSize
);
if
(
!
data
&&
len
)
{
free
(
pProp
);
return
(
BadAlloc
);
}
pProp
->
propertyName
=
property
;
pProp
->
type
=
type
;
pProp
->
format
=
format
;
pProp
->
data
=
data
;
if
(
len
)
memmove
((
char
*
)
data
,
(
char
*
)
value
,
totalSize
);
pProp
->
size
=
len
;
pProp
->
next
=
pWin
->
optional
->
userProps
;
pWin
->
optional
->
userProps
=
pProp
;
}
else
{
/* To append or prepend to a property the request format and type
must match those of the already defined property. The
existing format and type are irrelevant when using the mode
"PropModeReplace" since they will be written over. */
if
((
format
!=
pProp
->
format
)
&&
(
mode
!=
PropModeReplace
))
return
(
BadMatch
);
if
((
pProp
->
type
!=
type
)
&&
(
mode
!=
PropModeReplace
))
return
(
BadMatch
);
if
(
mode
==
PropModeReplace
)
{
if
(
totalSize
!=
pProp
->
size
*
(
pProp
->
format
>>
3
))
{
data
=
(
void
*
)
realloc
(
pProp
->
data
,
totalSize
);
if
(
!
data
&&
len
)
return
(
BadAlloc
);
pProp
->
data
=
data
;
}
if
(
len
)
memmove
((
char
*
)
pProp
->
data
,
(
char
*
)
value
,
totalSize
);
pProp
->
size
=
len
;
pProp
->
type
=
type
;
pProp
->
format
=
format
;
}
else
if
(
len
==
0
)
{
/* do nothing */
}
else
if
(
mode
==
PropModeAppend
)
{
data
=
(
void
*
)
realloc
(
pProp
->
data
,
sizeInBytes
*
(
len
+
pProp
->
size
));
if
(
!
data
)
return
(
BadAlloc
);
pProp
->
data
=
data
;
memmove
(
&
((
char
*
)
data
)[
pProp
->
size
*
sizeInBytes
],
(
char
*
)
value
,
totalSize
);
pProp
->
size
+=
len
;
}
else
if
(
mode
==
PropModePrepend
)
{
data
=
(
void
*
)
malloc
(
sizeInBytes
*
(
len
+
pProp
->
size
));
if
(
!
data
)
return
(
BadAlloc
);
memmove
(
&
((
char
*
)
data
)[
totalSize
],
(
char
*
)
pProp
->
data
,
(
int
)(
pProp
->
size
*
sizeInBytes
));
memmove
((
char
*
)
data
,
(
char
*
)
value
,
totalSize
);
free
(
pProp
->
data
);
pProp
->
data
=
data
;
pProp
->
size
+=
len
;
}
}
if
(
sendevent
)
{
xEvent
event
;
memset
(
&
event
,
0
,
sizeof
(
xEvent
));
event
.
u
.
u
.
type
=
PropertyNotify
;
event
.
u
.
property
.
window
=
pWin
->
drawable
.
id
;
event
.
u
.
property
.
state
=
PropertyNewValue
;
event
.
u
.
property
.
atom
=
pProp
->
propertyName
;
event
.
u
.
property
.
time
=
currentTime
.
milliseconds
;
DeliverEvents
(
pWin
,
&
event
,
1
,
(
WindowPtr
)
NULL
);
}
return
(
Success
);
}
}
/*****************
/*****************
...
...
nx-X11/programs/Xserver/hw/nxagent/Options.c
View file @
67599026
...
@@ -107,16 +107,8 @@ void nxagentInitOptions(void)
...
@@ -107,16 +107,8 @@ void nxagentInitOptions(void)
nxagentOptions
.
ViewportXSpan
=
0
;
nxagentOptions
.
ViewportXSpan
=
0
;
nxagentOptions
.
ViewportYSpan
=
0
;
nxagentOptions
.
ViewportYSpan
=
0
;
#ifndef __CYGWIN32__
nxagentOptions
.
DesktopResize
=
1
;
nxagentOptions
.
DesktopResize
=
1
;
#else
nxagentOptions
.
DesktopResize
=
0
;
#endif
nxagentOptions
.
Ratio
=
DONT_SCALE
;
nxagentOptions
.
Ratio
=
DONT_SCALE
;
nxagentOptions
.
XRatio
=
DONT_SCALE
;
nxagentOptions
.
XRatio
=
DONT_SCALE
;
nxagentOptions
.
YRatio
=
DONT_SCALE
;
nxagentOptions
.
YRatio
=
DONT_SCALE
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Pointer.c
View file @
67599026
...
@@ -87,7 +87,7 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl)
...
@@ -87,7 +87,7 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl)
if
(
nxagentOption
(
DeviceControl
)
==
True
)
if
(
nxagentOption
(
DeviceControl
)
==
True
)
{
{
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"
nxagentChangePointerControl: WARNING! Propagating changes to pointer settings.
\n
"
);
fprintf
(
stderr
,
"
%s: WARNING! Propagating changes to pointer settings.
\n
"
,
__func__
);
#endif
#endif
XChangePointerControl
(
nxagentDisplay
,
True
,
True
,
XChangePointerControl
(
nxagentDisplay
,
True
,
True
,
...
@@ -97,7 +97,7 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl)
...
@@ -97,7 +97,7 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl)
}
}
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"
nxagentChangePointerControl: WARNING! Not propagating changes to pointer settings.
\n
"
);
fprintf
(
stderr
,
"
%s: WARNING! Not propagating changes to pointer settings.
\n
"
,
__func__
);
#endif
#endif
}
}
...
@@ -108,7 +108,7 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
...
@@ -108,7 +108,7 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
case
DEVICE_INIT
:
case
DEVICE_INIT
:
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"
nxagentPointerProc: Called for [DEVICE_INIT].
\n
"
);
fprintf
(
stderr
,
"
%s: Called for [DEVICE_INIT].
\n
"
,
__func__
);
#endif
#endif
if
(
NXDisplayError
(
nxagentDisplay
)
==
1
)
if
(
NXDisplayError
(
nxagentDisplay
)
==
1
)
...
@@ -129,7 +129,7 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
...
@@ -129,7 +129,7 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
case
DEVICE_ON
:
case
DEVICE_ON
:
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"
nxagentPointerProc: Called for [DEVICE_ON].
\n
"
);
fprintf
(
stderr
,
"
%s: Called for [DEVICE_ON].
\n
"
,
__func__
);
#endif
#endif
if
(
NXDisplayError
(
nxagentDisplay
)
==
1
)
if
(
NXDisplayError
(
nxagentDisplay
)
==
1
)
...
@@ -146,7 +146,7 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
...
@@ -146,7 +146,7 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
case
DEVICE_OFF
:
case
DEVICE_OFF
:
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"
nxagentPointerProc: Called for [DEVICE_OFF].
\n
"
);
fprintf
(
stderr
,
"
%s: Called for [DEVICE_OFF].
\n
"
,
__func__
);
#endif
#endif
if
(
NXDisplayError
(
nxagentDisplay
)
==
1
)
if
(
NXDisplayError
(
nxagentDisplay
)
==
1
)
...
@@ -160,7 +160,7 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
...
@@ -160,7 +160,7 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
case
DEVICE_CLOSE
:
case
DEVICE_CLOSE
:
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"
nxagentPointerProc: Called for [DEVICE_CLOSE].
\n
"
);
fprintf
(
stderr
,
"
%s: Called for [DEVICE_CLOSE].
\n
"
,
__func__
);
#endif
#endif
break
;
break
;
...
@@ -174,14 +174,14 @@ void nxagentInitPointerMap(void)
...
@@ -174,14 +174,14 @@ void nxagentInitPointerMap(void)
unsigned
char
pointerMap
[
MAXBUTTONS
];
unsigned
char
pointerMap
[
MAXBUTTONS
];
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"
nxagentInitPointerMap
: Going to retrieve the "
fprintf
(
stderr
,
"
%s
: Going to retrieve the "
"pointer map from remote display.
\n
"
);
"pointer map from remote display.
\n
"
,
__func__
);
#endif
#endif
int
numButtons
=
XGetPointerMapping
(
nxagentDisplay
,
pointerMap
,
MAXBUTTONS
);
int
numButtons
=
XGetPointerMapping
(
nxagentDisplay
,
pointerMap
,
MAXBUTTONS
);
/*
/*
* Computing revers pointer map.
* Computing revers
e
pointer map.
*/
*/
for
(
int
i
=
1
;
i
<=
numButtons
;
i
++
)
for
(
int
i
=
1
;
i
<=
numButtons
;
i
++
)
...
...
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
View file @
67599026
...
@@ -666,7 +666,7 @@ Bool nxagentReconnectSession(void)
...
@@ -666,7 +666,7 @@ Bool nxagentReconnectSession(void)
}
}
/* Re-read keystrokes definitions in case the keystrokes file has
/* Re-read keystrokes definitions in case the keystrokes file has
changed while being supended */
changed while being su
s
pended */
nxagentInitKeystrokes
(
True
);
nxagentInitKeystrokes
(
True
);
#ifdef NX_DEBUG_INPUT
#ifdef NX_DEBUG_INPUT
...
...
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
View file @
67599026
...
@@ -285,7 +285,7 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
...
@@ -285,7 +285,7 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
if
(
!
toplevel
)
if
(
!
toplevel
)
{
{
/* FIXME: Is this too much and we
an
d simply return here? */
/* FIXME: Is this too much and we
shoul
d simply return here? */
FatalError
(
"nxagentRootlessRestack: malloc() failed."
);
FatalError
(
"nxagentRootlessRestack: malloc() failed."
);
}
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Screen.c
View file @
67599026
...
@@ -454,8 +454,6 @@ Window nxagentCreateIconWindow(void)
...
@@ -454,8 +454,6 @@ Window nxagentCreateIconWindow(void)
*/
*/
XSizeHints
*
sizeHints
=
XAllocSizeHints
();
XSizeHints
*
sizeHints
=
XAllocSizeHints
();
XWMHints
*
wmHints
=
XAllocWMHints
();;
if
(
sizeHints
)
if
(
sizeHints
)
{
{
sizeHints
->
flags
=
PMinSize
|
PMaxSize
;
sizeHints
->
flags
=
PMinSize
|
PMaxSize
;
...
@@ -463,27 +461,23 @@ Window nxagentCreateIconWindow(void)
...
@@ -463,27 +461,23 @@ Window nxagentCreateIconWindow(void)
sizeHints
->
min_height
=
sizeHints
->
max_height
=
1
;
sizeHints
->
min_height
=
sizeHints
->
max_height
=
1
;
}
}
XWMHints
*
wmHints
=
XAllocWMHints
();;
if
(
wmHints
)
if
(
wmHints
)
{
{
wmHints
->
flags
=
IconPixmapHint
|
IconMask
Hint
;
wmHints
->
flags
=
StateHint
|
IconPixmap
Hint
;
wmHints
->
initial_state
=
IconicState
;
wmHints
->
initial_state
=
IconicState
;
wmHints
->
icon_pixmap
=
nxagentIconPixmap
;
wmHints
->
icon_pixmap
=
nxagentIconPixmap
;
if
(
useXpmIcon
)
if
(
useXpmIcon
)
{
{
wmHints
->
flags
|=
IconMaskHint
;
wmHints
->
icon_mask
=
nxagentIconShape
;
wmHints
->
icon_mask
=
nxagentIconShape
;
wmHints
->
flags
=
IconPixmapHint
|
IconMaskHint
;
}
else
{
wmHints
->
flags
=
StateHint
|
IconPixmapHint
;
}
}
}
}
char
*
window_name
=
nxagentWindowName
;
Xutf8SetWMProperties
(
nxagentDisplay
,
w
,
Xutf8SetWMProperties
(
nxagentDisplay
,
w
,
window_name
,
window_n
ame
,
nxagentWindowName
,
nxagentWindowN
ame
,
NULL
,
0
,
sizeHints
,
wmHints
,
NULL
);
NULL
,
0
,
sizeHints
,
wmHints
,
NULL
);
SAFE_XFree
(
sizeHints
);
SAFE_XFree
(
sizeHints
);
SAFE_XFree
(
wmHints
);
SAFE_XFree
(
wmHints
);
...
@@ -1901,10 +1895,8 @@ N/A
...
@@ -1901,10 +1895,8 @@ N/A
XSelectInput
(
nxagentDisplay
,
nxagentFullscreenWindow
,
mask
);
XSelectInput
(
nxagentDisplay
,
nxagentFullscreenWindow
,
mask
);
}
}
XSizeHints
*
sizeHints
;
XSizeHints
*
sizeHints
=
XAllocSizeHints
();
XWMHints
*
wmHints
;
if
(
sizeHints
)
if
((
sizeHints
=
XAllocSizeHints
()))
{
{
sizeHints
->
flags
=
PPosition
|
PMinSize
|
PMaxSize
;
sizeHints
->
flags
=
PPosition
|
PMinSize
|
PMaxSize
;
sizeHints
->
x
=
nxagentOption
(
X
)
+
POSITION_OFFSET
;
sizeHints
->
x
=
nxagentOption
(
X
)
+
POSITION_OFFSET
;
...
@@ -1932,18 +1924,16 @@ N/A
...
@@ -1932,18 +1924,16 @@ N/A
sizeHints
->
flags
|=
USSize
;
sizeHints
->
flags
|=
USSize
;
}
}
if
((
wmHints
=
XAllocWMHints
()))
XWMHints
*
wmHints
=
XAllocWMHints
();
if
(
wmHints
)
{
{
wmHints
->
flags
=
IconPixmapHint
;
wmHints
->
icon_pixmap
=
nxagentIconPixmap
;
wmHints
->
icon_pixmap
=
nxagentIconPixmap
;
if
(
useXpmIcon
)
if
(
useXpmIcon
)
{
{
wmHints
->
flags
|=
IconMaskHint
;
wmHints
->
icon_mask
=
nxagentIconShape
;
wmHints
->
icon_mask
=
nxagentIconShape
;
wmHints
->
flags
=
IconPixmapHint
|
IconMaskHint
;
}
else
{
wmHints
->
flags
=
IconPixmapHint
;
}
}
}
}
...
@@ -2192,19 +2182,17 @@ Bool nxagentCloseScreen(ScreenPtr pScreen)
...
@@ -2192,19 +2182,17 @@ Bool nxagentCloseScreen(ScreenPtr pScreen)
static
void
nxagentSetRootClip
(
ScreenPtr
pScreen
,
Bool
enable
)
static
void
nxagentSetRootClip
(
ScreenPtr
pScreen
,
Bool
enable
)
{
{
WindowPtr
pWin
=
pScreen
->
root
;
WindowPtr
pWin
=
pScreen
->
root
;
WindowPtr
pChild
;
Bool
WasViewable
=
(
Bool
)(
pWin
->
viewable
);
Bool
WasViewable
=
(
Bool
)(
pWin
->
viewable
);
Bool
anyMarked
=
FALSE
;
Bool
anyMarked
=
FALSE
;
RegionPtr
pOldClip
=
NULL
,
bsExposed
;
RegionPtr
pOldClip
=
NULL
;
#ifdef DO_SAVE_UNDERS
#ifdef DO_SAVE_UNDERS
Bool
dosave
=
FALSE
;
Bool
dosave
=
FALSE
;
#endif
#endif
WindowPtr
pLayerWin
;
WindowPtr
pLayerWin
;
BoxRec
box
;
if
(
WasViewable
)
if
(
WasViewable
)
{
{
for
(
pChild
=
pWin
->
firstChild
;
pChild
;
pChild
=
pChild
->
nextSib
)
for
(
WindowPtr
pChild
=
pWin
->
firstChild
;
pChild
;
pChild
=
pChild
->
nextSib
)
{
{
(
void
)
(
*
pScreen
->
MarkOverlappedWindows
)(
pChild
,
(
void
)
(
*
pScreen
->
MarkOverlappedWindows
)(
pChild
,
pChild
,
pChild
,
...
@@ -2216,9 +2204,7 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable)
...
@@ -2216,9 +2204,7 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable)
{
{
if
(
HasBorder
(
pWin
))
if
(
HasBorder
(
pWin
))
{
{
RegionPtr
borderVisible
;
RegionPtr
borderVisible
=
RegionCreate
(
NullBox
,
1
);
borderVisible
=
RegionCreate
(
NullBox
,
1
);
RegionSubtract
(
borderVisible
,
RegionSubtract
(
borderVisible
,
&
pWin
->
borderClip
,
&
pWin
->
winSize
);
&
pWin
->
borderClip
,
&
pWin
->
winSize
);
pWin
->
valdata
->
before
.
borderVisible
=
borderVisible
;
pWin
->
valdata
->
before
.
borderVisible
=
borderVisible
;
...
@@ -2229,15 +2215,12 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable)
...
@@ -2229,15 +2215,12 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable)
/*
/*
* Use REGION_BREAK to avoid optimizations in ValidateTree
* Use REGION_BREAK to avoid optimizations in ValidateTree
* that assume the root borderClip can't change
w
ell, normally
* that assume the root borderClip can't change
. W
ell, normally
* it doesn't...)
* it doesn't...)
*/
*/
if
(
enable
)
if
(
enable
)
{
{
box
.
x1
=
0
;
BoxRec
box
=
{.
x1
=
0
,
.
y1
=
0
,
.
x2
=
pScreen
->
width
,
.
y2
=
pScreen
->
height
};
box
.
y1
=
0
;
box
.
x2
=
pScreen
->
width
;
box
.
y2
=
pScreen
->
height
;
RegionInit
(
&
pWin
->
winSize
,
&
box
,
1
);
RegionInit
(
&
pWin
->
winSize
,
&
box
,
1
);
RegionInit
(
&
pWin
->
borderSize
,
&
box
,
1
);
RegionInit
(
&
pWin
->
borderSize
,
&
box
,
1
);
if
(
WasViewable
)
if
(
WasViewable
)
...
@@ -2290,14 +2273,14 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable)
...
@@ -2290,14 +2273,14 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable)
{
{
if
(
!
WasViewable
)
if
(
!
WasViewable
)
pOldClip
=
&
pWin
->
clipList
;
/* a convenient empty region */
pOldClip
=
&
pWin
->
clipList
;
/* a convenient empty region */
bsExposed
=
(
*
pScreen
->
TranslateBackingStore
)
RegionPtr
bsExposed
=
(
*
pScreen
->
TranslateBackingStore
)
(
pWin
,
0
,
0
,
pOldClip
,
(
pWin
,
0
,
0
,
pOldClip
,
pWin
->
drawable
.
x
,
pWin
->
drawable
.
y
);
pWin
->
drawable
.
x
,
pWin
->
drawable
.
y
);
if
(
WasViewable
)
if
(
WasViewable
)
RegionDestroy
(
pOldClip
);
RegionDestroy
(
pOldClip
);
if
(
bsExposed
)
if
(
bsExposed
)
{
{
RegionPtr
valExposed
=
NullRegion
;
RegionPtr
valExposed
=
NullRegion
;
if
(
pWin
->
valdata
)
if
(
pWin
->
valdata
)
valExposed
=
&
pWin
->
valdata
->
after
.
exposed
;
valExposed
=
&
pWin
->
valdata
->
after
.
exposed
;
...
@@ -2326,15 +2309,6 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable)
...
@@ -2326,15 +2309,6 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable)
Bool
nxagentResizeScreen
(
ScreenPtr
pScreen
,
int
width
,
int
height
,
Bool
nxagentResizeScreen
(
ScreenPtr
pScreen
,
int
width
,
int
height
,
int
mmWidth
,
int
mmHeight
)
int
mmWidth
,
int
mmHeight
)
{
{
BoxRec
box
;
PixmapPtr
pPixmap
;
char
*
fbBits
;
int
oldWidth
;
int
oldHeight
;
int
oldMmWidth
;
int
oldMmHeight
;
#ifdef TEST
#ifdef TEST
nxagentPrintAgentGeometry
(
"Before Resize Screen"
,
"nxagentResizeScreen:"
);
nxagentPrintAgentGeometry
(
"Before Resize Screen"
,
"nxagentResizeScreen:"
);
#endif
#endif
...
@@ -2343,10 +2317,10 @@ Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height,
...
@@ -2343,10 +2317,10 @@ Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height,
* Change screen properties.
* Change screen properties.
*/
*/
oldWidth
=
pScreen
->
width
;
int
oldWidth
=
pScreen
->
width
;
oldHeight
=
pScreen
->
height
;
int
oldHeight
=
pScreen
->
height
;
oldMmWidth
=
pScreen
->
mmWidth
;
int
oldMmWidth
=
pScreen
->
mmWidth
;
oldMmHeight
=
pScreen
->
mmHeight
;
int
oldMmHeight
=
pScreen
->
mmHeight
;
pScreen
->
width
=
width
;
pScreen
->
width
=
width
;
pScreen
->
height
=
height
;
pScreen
->
height
=
height
;
...
@@ -2396,10 +2370,11 @@ Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height,
...
@@ -2396,10 +2370,11 @@ Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height,
pScreen
->
mmWidth
=
mmWidth
;
pScreen
->
mmWidth
=
mmWidth
;
pScreen
->
mmHeight
=
mmHeight
;
pScreen
->
mmHeight
=
mmHeight
;
pPixmap
=
fbGetScreenPixmap
(
pScreen
);
PixmapPtr
pPixmap
=
fbGetScreenPixmap
(
pScreen
);
if
((
fbBits
=
realloc
(
pPixmap
->
devPrivate
.
ptr
,
PixmapBytePad
(
width
,
pScreen
->
rootDepth
)
*
char
*
fbBits
=
realloc
(
pPixmap
->
devPrivate
.
ptr
,
PixmapBytePad
(
width
,
pScreen
->
rootDepth
)
*
height
*
BitsPerPixel
(
pScreen
->
rootDepth
)
/
8
))
==
NULL
)
height
*
BitsPerPixel
(
pScreen
->
rootDepth
)
/
8
);
if
(
fbBits
==
NULL
)
{
{
pScreen
->
width
=
oldWidth
;
pScreen
->
width
=
oldWidth
;
pScreen
->
height
=
oldHeight
;
pScreen
->
height
=
oldHeight
;
...
@@ -2466,10 +2441,7 @@ FIXME: We should try to restore the previously
...
@@ -2466,10 +2441,7 @@ FIXME: We should try to restore the previously
* Set properties for the agent root window.
* Set properties for the agent root window.
*/
*/
box
.
x1
=
0
;
BoxRec
box
=
{.
x1
=
0
,
.
y1
=
0
,
.
x2
=
width
,
.
y2
=
height
};
box
.
y1
=
0
;
box
.
x2
=
width
;
box
.
y2
=
height
;
pScreen
->
root
->
drawable
.
width
=
width
;
pScreen
->
root
->
drawable
.
width
=
width
;
pScreen
->
root
->
drawable
.
height
=
height
;
pScreen
->
root
->
drawable
.
height
=
height
;
...
@@ -2511,9 +2483,6 @@ nxagentResizeScreenError:
...
@@ -2511,9 +2483,6 @@ nxagentResizeScreenError:
void
nxagentShadowSetRatio
(
float
floatXRatio
,
float
floatYRatio
)
void
nxagentShadowSetRatio
(
float
floatXRatio
,
float
floatYRatio
)
{
{
int
intXRatio
;
int
intYRatio
;
if
(
floatXRatio
==
0
)
if
(
floatXRatio
==
0
)
{
{
floatXRatio
=
1
.
0
;
floatXRatio
=
1
.
0
;
...
@@ -2524,8 +2493,8 @@ void nxagentShadowSetRatio(float floatXRatio, float floatYRatio)
...
@@ -2524,8 +2493,8 @@ void nxagentShadowSetRatio(float floatXRatio, float floatYRatio)
floatYRatio
=
1
.
0
;
floatYRatio
=
1
.
0
;
}
}
intXRatio
=
floatXRatio
*
(
1
<<
PRECISION
);
int
int
XRatio
=
floatXRatio
*
(
1
<<
PRECISION
);
intYRatio
=
floatYRatio
*
(
1
<<
PRECISION
);
int
int
YRatio
=
floatYRatio
*
(
1
<<
PRECISION
);
nxagentChangeOption
(
FloatXRatio
,
floatXRatio
);
nxagentChangeOption
(
FloatXRatio
,
floatXRatio
);
nxagentChangeOption
(
FloatYRatio
,
floatYRatio
);
nxagentChangeOption
(
FloatYRatio
,
floatYRatio
);
...
@@ -2563,16 +2532,6 @@ void nxagentShadowSetWindowOptions(void)
...
@@ -2563,16 +2532,6 @@ void nxagentShadowSetWindowOptions(void)
int
nxagentShadowInit
(
ScreenPtr
pScreen
,
WindowPtr
pWin
)
int
nxagentShadowInit
(
ScreenPtr
pScreen
,
WindowPtr
pWin
)
{
{
char
*
layout
=
NULL
;
char
*
layout
=
NULL
;
XlibGC
gc
;
XGCValues
value
;
#ifndef __CYGWIN32__
Atom
nxagentShadowAtom
;
int
fd
;
#endif
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"Info: Init shadow session. nxagentDisplayName [%s] "
fprintf
(
stderr
,
"Info: Init shadow session. nxagentDisplayName [%s] "
...
@@ -2603,8 +2562,6 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
...
@@ -2603,8 +2562,6 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
nxagentShadowUid
);
nxagentShadowUid
);
#endif
#endif
#if !defined (__CYGWIN32__) && !defined (WIN32)
if
(
nxagentShadowUid
!=
-
1
)
if
(
nxagentShadowUid
!=
-
1
)
{
{
NXShadowSetDisplayUid
(
nxagentShadowUid
);
NXShadowSetDisplayUid
(
nxagentShadowUid
);
...
@@ -2615,8 +2572,6 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
...
@@ -2615,8 +2572,6 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
NXShadowDisableDamage
();
NXShadowDisableDamage
();
}
}
#endif
if
(
NXShadowCreate
(
nxagentDisplay
,
layout
,
nxagentShadowDisplayName
,
if
(
NXShadowCreate
(
nxagentDisplay
,
layout
,
nxagentShadowDisplayName
,
(
void
*
)
&
nxagentShadowDisplay
)
!=
1
)
(
void
*
)
&
nxagentShadowDisplay
)
!=
1
)
{
{
...
@@ -2629,18 +2584,14 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
...
@@ -2629,18 +2584,14 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
}
}
/*
/*
* The shadow nxagent sets the _NX_SHADOW
* The shadow nxagent sets the _NX_SHADOW property on the master X
* property on the master X server root
* server root window in order to notify its presence.
* window in order to notify its presence.
*/
*/
#ifndef __CYGWIN__
XlibAtom
nxagentShadowAtom
=
XInternAtom
(
nxagentShadowDisplay
,
"_NX_SHADOW"
,
False
);
nxagentShadowAtom
=
XInternAtom
(
nxagentShadowDisplay
,
"_NX_SHADOW"
,
False
);
XChangeProperty
(
nxagentShadowDisplay
,
DefaultRootWindow
(
nxagentShadowDisplay
),
XChangeProperty
(
nxagentShadowDisplay
,
DefaultRootWindow
(
nxagentShadowDisplay
),
nxagentShadowAtom
,
XA_STRING
,
8
,
PropModeReplace
,
NULL
,
0
);
nxagentShadowAtom
,
XA_STRING
,
8
,
PropModeReplace
,
NULL
,
0
);
#endif
if
(
NXShadowAddUpdaterDisplay
(
nxagentDisplay
,
&
nxagentShadowWidth
,
if
(
NXShadowAddUpdaterDisplay
(
nxagentDisplay
,
&
nxagentShadowWidth
,
&
nxagentShadowHeight
,
&
nxagentMasterDepth
)
==
0
)
&
nxagentShadowHeight
,
&
nxagentMasterDepth
)
==
0
)
...
@@ -2653,8 +2604,6 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
...
@@ -2653,8 +2604,6 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
return
-
1
;
return
-
1
;
}
}
#ifndef __CYGWIN32__
if
(
nxagentOption
(
Fullscreen
)
==
1
)
if
(
nxagentOption
(
Fullscreen
)
==
1
)
{
{
nxagentShadowSetRatio
(
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
))
*
1
.
0
/
nxagentShadowWidth
,
nxagentShadowSetRatio
(
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
))
*
1
.
0
/
nxagentShadowWidth
,
...
@@ -2686,36 +2635,12 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
...
@@ -2686,36 +2635,12 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
switch
(
DefaultVisualOfScreen
(
DefaultScreenOfDisplay
(
nxagentShadowDisplay
))
->
class
)
switch
(
DefaultVisualOfScreen
(
DefaultScreenOfDisplay
(
nxagentShadowDisplay
))
->
class
)
{
{
case
StaticGray
:
case
StaticGray
:
{
className
=
"StaticGray"
;
break
;
}
{
case
StaticColor
:
{
className
=
"StaticColor"
;
break
;
}
className
=
"StaticGray"
;
case
PseudoColor
:
{
className
=
"PseudoColor"
;
break
;
}
break
;
case
DirectColor
:
{
className
=
"DirectColor"
;
break
;
}
}
case
GrayScale
:
{
className
=
"GrayScale"
;
break
;
}
case
StaticColor
:
default:
{
className
=
""
;
break
;
}
{
className
=
"StaticColor"
;
break
;
}
case
PseudoColor
:
{
className
=
"PseudoColor"
;
break
;
}
case
DirectColor
:
{
className
=
"DirectColor"
;
break
;
}
case
GrayScale
:
{
className
=
"GrayScale"
;
break
;
}
default:
{
className
=
""
;
break
;
}
}
}
fprintf
(
stderr
,
"nxagentShadowInit: PANIC! Cannot shadow the display. "
fprintf
(
stderr
,
"nxagentShadowInit: PANIC! Cannot shadow the display. "
...
@@ -2727,8 +2652,6 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
...
@@ -2727,8 +2652,6 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
return
-
1
;
return
-
1
;
}
}
#endif
nxagentShadowDepth
=
pScreen
->
rootDepth
;
nxagentShadowDepth
=
pScreen
->
rootDepth
;
switch
(
nxagentMasterDepth
)
switch
(
nxagentMasterDepth
)
...
@@ -2813,19 +2736,13 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
...
@@ -2813,19 +2736,13 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
nxagentBppShadow
=
1
;
nxagentBppShadow
=
1
;
}
}
#if !defined(__CYGWIN__)
imageByteOrder
=
nxagentShadowDisplay
->
byte_order
;
imageByteOrder
=
nxagentShadowDisplay
->
byte_order
;
fd
=
XConnectionNumber
(
nxagentShadowDisplay
);
nxagentShadowXConnectionNumber
=
XConnectionNumber
(
nxagentShadowDisplay
);
nxagentShadowXConnectionNumber
=
fd
;
#endif
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"nxagentShadowInit: Adding the X connection [%d] "
fprintf
(
stderr
,
"nxagentShadowInit: Adding the X connection [%d] "
"to the device set.
\n
"
,
fd
);
"to the device set.
\n
"
,
nxagentShadowXConnectionNumber
);
#endif
#endif
SetNotifyFd
(
nxagentShadowXConnectionNumber
,
nxagentNotifyConnection
,
X_NOTIFY_READ
,
NULL
);
SetNotifyFd
(
nxagentShadowXConnectionNumber
,
nxagentNotifyConnection
,
X_NOTIFY_READ
,
NULL
);
...
@@ -2855,13 +2772,15 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
...
@@ -2855,13 +2772,15 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
* Clean up the main window.
* Clean up the main window.
*/
*/
value
.
foreground
=
0x00000000
;
XGCValues
value
=
{
value
.
background
=
0x00000000
;
.
foreground
=
0x00000000
,
value
.
plane_mask
=
0xffffffff
;
.
background
=
0x00000000
,
value
.
fill_style
=
FillSolid
;
.
plane_mask
=
0xffffffff
,
.
fill_style
=
FillSolid
,
};
gc
=
XCreateGC
(
nxagentDisplay
,
nxagentPixmap
(
nxagentShadowPixmapPtr
),
GCBackground
|
XlibGC
gc
=
XCreateGC
(
nxagentDisplay
,
nxagentPixmap
(
nxagentShadowPixmapPtr
),
GCBackground
|
GCForeground
|
GCFillStyle
|
GCPlaneMask
,
&
value
);
GCForeground
|
GCFillStyle
|
GCPlaneMask
,
&
value
);
XFillRectangle
(
nxagentDisplay
,
nxagentPixmap
(
nxagentShadowPixmapPtr
),
gc
,
0
,
0
,
XFillRectangle
(
nxagentDisplay
,
nxagentPixmap
(
nxagentShadowPixmapPtr
),
gc
,
0
,
0
,
nxagentShadowWidth
,
nxagentShadowHeight
);
nxagentShadowWidth
,
nxagentShadowHeight
);
...
@@ -2875,12 +2794,6 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
...
@@ -2875,12 +2794,6 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
int
nxagentShadowCreateMainWindow
(
ScreenPtr
pScreen
,
WindowPtr
pWin
,
int
width
,
int
height
)
int
nxagentShadowCreateMainWindow
(
ScreenPtr
pScreen
,
WindowPtr
pWin
,
int
width
,
int
height
)
{
{
XWindowChanges
changes
;
Mask
mask
,
maskb
;
XID
values
[
4
],
*
vlist
;
int
error
;
XID
xid
;
nxagentShadowWidth
=
width
;
nxagentShadowWidth
=
width
;
nxagentShadowHeight
=
height
;
nxagentShadowHeight
=
height
;
...
@@ -2926,9 +2839,9 @@ int nxagentShadowCreateMainWindow(ScreenPtr pScreen, WindowPtr pWin, int width,
...
@@ -2926,9 +2839,9 @@ int nxagentShadowCreateMainWindow(ScreenPtr pScreen, WindowPtr pWin, int width,
XFreePixmap
(
nxagentDisplay
,
nxagentPixmap
(
nxagentVirtualPixmap
(
nxagentShadowPixmapPtr
)));
XFreePixmap
(
nxagentDisplay
,
nxagentPixmap
(
nxagentVirtualPixmap
(
nxagentShadowPixmapPtr
)));
xid
=
XCreatePixmap
(
nxagentDisplay
,
nxagentDefaultWindows
[
0
],
XID
xid
=
XCreatePixmap
(
nxagentDisplay
,
nxagentDefaultWindows
[
0
],
nxagentScale
(
nxagentShadowWidth
,
nxagentOption
(
XRatio
)),
nxagentScale
(
nxagentShadowWidth
,
nxagentOption
(
XRatio
)),
nxagentScale
(
nxagentShadowHeight
,
nxagentOption
(
YRatio
)),
nxagentShadowDepth
);
nxagentScale
(
nxagentShadowHeight
,
nxagentOption
(
YRatio
)),
nxagentShadowDepth
);
nxagentPixmap
(
nxagentVirtualPixmap
(
nxagentShadowPixmapPtr
))
=
xid
;
nxagentPixmap
(
nxagentVirtualPixmap
(
nxagentShadowPixmapPtr
))
=
xid
;
...
@@ -2957,24 +2870,27 @@ int nxagentShadowCreateMainWindow(ScreenPtr pScreen, WindowPtr pWin, int width,
...
@@ -2957,24 +2870,27 @@ int nxagentShadowCreateMainWindow(ScreenPtr pScreen, WindowPtr pWin, int width,
#endif
#endif
}
}
mask
=
CWBackPixmap
|
CWEventMask
|
CWCursor
;
Mask
mask
=
CWBackPixmap
|
CWEventMask
|
CWCursor
;
Mask
maskb
=
nxagentGetDefaultEventMask
()
|
ResizeRedirectMask
|
ExposureMask
;
maskb
=
nxagentGetDefaultEventMask
();
XID
values
[
4
];
maskb
|=
ResizeRedirectMask
|
ExposureMask
;
XID
*
vlist
=
values
;
vlist
=
values
;
*
vlist
++
=
(
XID
)
nxagentShadowPixmapPtr
->
drawable
.
id
;
*
vlist
++
=
(
XID
)
nxagentShadowPixmapPtr
->
drawable
.
id
;
*
vlist
++
=
(
XID
)
maskb
;
*
vlist
++
=
(
XID
)
maskb
;
*
vlist
=
(
XID
)
None
;
*
vlist
=
(
XID
)
None
;
int
error
;
nxagentShadowWindowPtr
=
CreateWindow
(
accessWindowID
,
pWin
,
0
,
0
,
nxagentShadowWidth
,
nxagentShadowWindowPtr
=
CreateWindow
(
accessWindowID
,
pWin
,
0
,
0
,
nxagentShadowWidth
,
nxagentShadowHeight
,
0
,
InputOutput
,
mask
,
(
XID
*
)
values
,
nxagentShadowHeight
,
0
,
InputOutput
,
mask
,
(
XID
*
)
values
,
nxagentShadowDepth
,
serverClient
,
CopyFromParent
,
&
error
);
nxagentShadowDepth
,
serverClient
,
CopyFromParent
,
&
error
);
mask
=
CWWidth
|
CWHeight
;
mask
=
CWWidth
|
CWHeight
;
changes
.
width
=
nxagentScale
(
nxagentShadowWidth
,
nxagentOption
(
XRatio
));
XWindowChanges
changes
=
{
changes
.
height
=
nxagentScale
(
nxagentShadowHeight
,
nxagentOption
(
YRatio
));
.
width
=
nxagentScale
(
nxagentShadowWidth
,
nxagentOption
(
XRatio
)),
.
height
=
nxagentScale
(
nxagentShadowHeight
,
nxagentOption
(
YRatio
))
};
XConfigureWindow
(
nxagentDisplay
,
nxagentWindow
(
nxagentShadowWindowPtr
),
mask
,
&
changes
);
XConfigureWindow
(
nxagentDisplay
,
nxagentWindow
(
nxagentShadowWindowPtr
),
mask
,
&
changes
);
...
@@ -3038,51 +2954,33 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
...
@@ -3038,51 +2954,33 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
unsigned
char
nxagentShadowDepth
,
int
nxagentShadowWidth
,
unsigned
char
nxagentShadowDepth
,
int
nxagentShadowWidth
,
int
nxagentShadowHeight
,
char
*
nxagentShadowBuffer
,
int
*
changed
,
int
*
suspended
)
int
nxagentShadowHeight
,
char
*
nxagentShadowBuffer
,
int
*
changed
,
int
*
suspended
)
{
{
int
x
,
y
,
y2
,
n
,
c
,
line
;
int
result
;
long
numRects
;
unsigned
int
width
,
height
,
length
;
char
*
tBuffer
=
NULL
;
char
*
iBuffer
,
*
ptBox
;
BoxRec
*
pBox
;
RegionRec
updateRegion
;
RegionRec
updateRegion
;
RegionRec
tempRegion
;
RegionRec
tempRegion
;
BoxRec
box
;
int
overlap
;
RegionNull
(
&
updateRegion
);
RegionNull
(
&
updateRegion
);
RegionNull
(
&
tempRegion
);
RegionNull
(
&
tempRegion
);
#ifdef __CYGWIN32__
int
result
=
NXShadowHasChanged
(
nxagentUserInput
,
NULL
,
suspended
);
if
(
NXShadowCaptureCursor
(
nxagentWindow
(
nxagentShadowWindowPtr
),
nxagentShadowWindowPtr
->
drawable
.
pScreen
->
visuals
)
==
-
1
)
{
#ifdef WARNING
fprintf
(
stderr
,
"nxagentShadowPoll: Failed to capture cursor.
\n
"
);
#endif
}
#endif
result
=
NXShadowHasChanged
(
nxagentUserInput
,
NULL
,
suspended
);
*
changed
=
result
;
*
changed
=
result
;
if
(
result
==
1
)
if
(
result
==
1
)
{
{
char
*
tBuffer
=
NULL
;
char
*
iBuffer
,
*
ptBox
;
nxagentRemoveSplashWindow
();
nxagentRemoveSplashWindow
();
long
numRects
;
NXShadowExportChanges
(
&
numRects
,
&
ptBox
);
NXShadowExportChanges
(
&
numRects
,
&
ptBox
);
pBox
=
(
BoxRec
*
)
ptBox
;
BoxRec
*
pBox
=
(
BoxRec
*
)
ptBox
;
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"nxagentShadowPoll: nRects[%ld], pBox[%p] depth[%d].
\n
"
,
numRects
,
(
void
*
)
pBox
,
nxagentShadowDepth
);
fprintf
(
stderr
,
"nxagentShadowPoll: nRects[%ld], pBox[%p] depth[%d].
\n
"
,
numRects
,
(
void
*
)
pBox
,
nxagentShadowDepth
);
#endif
#endif
for
(
n
=
0
;
n
<
numRects
;
n
++
)
for
(
int
n
=
0
;
n
<
numRects
;
n
++
)
{
{
/*
/*
* The BoxRec struct defined in the Xserver has a different
* The BoxRec struct defined in the Xserver has a different
...
@@ -3090,11 +2988,11 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
...
@@ -3090,11 +2988,11 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
* the second and third field are inverted.
* the second and third field are inverted.
*/
*/
x
=
pBox
[
n
].
x1
;
int
x
=
pBox
[
n
].
x1
;
y
=
pBox
[
n
].
x2
;
int
y
=
pBox
[
n
].
x2
;
y2
=
pBox
[
n
].
y2
;
int
y2
=
pBox
[
n
].
y2
;
width
=
pBox
[
n
].
y1
-
pBox
[
n
].
x1
;
/* y1 = x2 */
unsigned
int
width
=
pBox
[
n
].
y1
-
pBox
[
n
].
x1
;
/* y1 = x2 */
height
=
y2
-
pBox
[
n
].
x2
;
/* x2 = y1 */
unsigned
int
height
=
y2
-
pBox
[
n
].
x2
;
/* x2 = y1 */
if
((
x
+
width
)
>
nxagentShadowWidth
||
(
y
+
height
)
>
nxagentShadowHeight
)
if
((
x
+
width
)
>
nxagentShadowWidth
||
(
y
+
height
)
>
nxagentShadowHeight
)
{
{
...
@@ -3105,13 +3003,13 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
...
@@ -3105,13 +3003,13 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
continue
;
continue
;
}
}
line
=
PixmapBytePad
(
width
,
nxagentMasterDepth
);
int
line
=
PixmapBytePad
(
width
,
nxagentMasterDepth
);
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentShadowPoll: Rectangle Number[%d] - x[%d]y[%d]W[%u]H[%u].
\n
"
,
n
+
1
,
x
,
y
,
width
,
height
);
fprintf
(
stderr
,
"nxagentShadowPoll: Rectangle Number[%d] - x[%d]y[%d]W[%u]H[%u].
\n
"
,
n
+
1
,
x
,
y
,
width
,
height
);
#endif
#endif
length
=
nxagentImageLength
(
width
,
height
,
ZPixmap
,
0
,
nxagentMasterDepth
);
unsigned
int
length
=
nxagentImageLength
(
width
,
height
,
ZPixmap
,
0
,
nxagentMasterDepth
);
SAFE_free
(
tBuffer
);
SAFE_free
(
tBuffer
);
...
@@ -3128,7 +3026,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
...
@@ -3128,7 +3026,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
iBuffer
=
tBuffer
;
iBuffer
=
tBuffer
;
for
(
c
=
0
;
c
+
y
<
y2
;
c
++
)
for
(
int
c
=
0
;
c
+
y
<
y2
;
c
++
)
{
{
memcpy
(
tBuffer
,
nxagentShadowBuffer
+
x
*
nxagentBppMaster
+
memcpy
(
tBuffer
,
nxagentShadowBuffer
+
x
*
nxagentBppMaster
+
(
y
+
c
)
*
nxagentShadowWidth
*
nxagentBppMaster
,
line
);
(
y
+
c
)
*
nxagentShadowWidth
*
nxagentBppMaster
,
line
);
...
@@ -3139,25 +3037,15 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
...
@@ -3139,25 +3037,15 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
tBuffer
=
iBuffer
;
tBuffer
=
iBuffer
;
#ifdef __CYGWIN32__
if
(
nxagentBppMaster
==
2
)
{
NXShadowCorrectColor
(
length
,
tBuffer
);
}
#else
if
(
nxagentCheckDepth
==
1
)
if
(
nxagentCheckDepth
==
1
)
{
{
nxagentShadowAdaptDepth
(
width
,
height
,
line
,
&
tBuffer
);
nxagentShadowAdaptDepth
(
width
,
height
,
line
,
&
tBuffer
);
}
}
#endif
fbPutImage
(
nxagentVirtualDrawable
((
DrawablePtr
)
nxagentShadowPixmapPtr
),
nxagentShadowGCPtr
,
fbPutImage
(
nxagentVirtualDrawable
((
DrawablePtr
)
nxagentShadowPixmapPtr
),
nxagentShadowGCPtr
,
nxagentShadowDepth
,
x
,
y
,
width
,
height
,
0
,
ZPixmap
,
tBuffer
);
nxagentShadowDepth
,
x
,
y
,
width
,
height
,
0
,
ZPixmap
,
tBuffer
);
box
.
x1
=
x
;
BoxRec
box
=
{.
x1
=
x
,
.
x2
=
x
+
width
,
.
y1
=
y
,
.
y2
=
y
+
height
};
box
.
x2
=
x
+
width
;
box
.
y1
=
y
;
box
.
y2
=
y
+
height
;
RegionInit
(
&
tempRegion
,
&
box
,
1
);
RegionInit
(
&
tempRegion
,
&
box
,
1
);
...
@@ -3165,6 +3053,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
...
@@ -3165,6 +3053,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
RegionUninit
(
&
tempRegion
);
RegionUninit
(
&
tempRegion
);
int
overlap
;
RegionValidate
(
&
updateRegion
,
&
overlap
);
RegionValidate
(
&
updateRegion
,
&
overlap
);
RegionUnion
(
&
nxagentShadowUpdateRegion
,
&
nxagentShadowUpdateRegion
,
&
updateRegion
);
RegionUnion
(
&
nxagentShadowUpdateRegion
,
&
nxagentShadowUpdateRegion
,
&
updateRegion
);
...
@@ -3398,43 +3287,40 @@ unsigned char fromHexNibble(char c)
...
@@ -3398,43 +3287,40 @@ unsigned char fromHexNibble(char c)
void
nxagentPropagateArtsdProperties
(
ScreenPtr
pScreen
,
char
*
port
)
void
nxagentPropagateArtsdProperties
(
ScreenPtr
pScreen
,
char
*
port
)
{
{
Window
rootWin
;
XlibAtom
atomReturnType
;
XlibAtom
propAtom
;
int
iReturnFormat
;
unsigned
long
ulReturnItems
;
unsigned
long
ulReturnBytesLeft
;
unsigned
char
*
pszReturnData
=
NULL
;
int
iReturn
;
char
tchar
[]
=
" "
;
char
tchar
[]
=
" "
;
/*
/*
FIXME: The port information is not used at the moment and produces a
FIXME: The port information is not used at the moment and produces a
warning on recent gcc versions. Do we need such information
warning on recent gcc versions. Do we need such information
to run the audio for
aw
rding?
to run the audio for
wa
rding?
char *chport;
char *chport;
char hex[] = "0123456789abcdef";
char hex[] = "0123456789abcdef";
*/
*/
rootWin
=
DefaultRootWindow
(
nxagentDisplay
);
Window
rootWin
=
DefaultRootWindow
(
nxagentDisplay
);
propAtom
=
nxagentAtoms
[
4
];
/* MCOPGLOBALS */
XlibAtom
propAtom
=
nxagentAtoms
[
4
];
/* MCOPGLOBALS */
XlibAtom
atomReturnType
;
int
iReturnFormat
;
unsigned
long
ulReturnItems
;
unsigned
long
ulReturnBytesLeft
;
unsigned
char
*
pszReturnData
=
NULL
;
/*
/*
* Get at most 64KB of data.
* Get at most 64KB of data.
*/
*/
iReturn
=
XGetWindowProperty
(
nxagentDisplay
,
i
nt
i
Return
=
XGetWindowProperty
(
nxagentDisplay
,
rootWin
,
rootWin
,
propAtom
,
propAtom
,
0
,
0
,
65536
/
4
,
65536
/
4
,
False
,
False
,
XA_STRING
,
XA_STRING
,
&
atomReturnType
,
&
atomReturnType
,
&
iReturnFormat
,
&
iReturnFormat
,
&
ulReturnItems
,
&
ulReturnItems
,
&
ulReturnBytesLeft
,
&
ulReturnBytesLeft
,
&
pszReturnData
);
&
pszReturnData
);
if
(
iReturn
==
Success
&&
atomReturnType
!=
None
&&
if
(
iReturn
==
Success
&&
atomReturnType
!=
None
&&
ulReturnItems
>
0
&&
pszReturnData
!=
NULL
)
ulReturnItems
>
0
&&
pszReturnData
!=
NULL
)
...
@@ -3462,72 +3348,69 @@ FIXME: The port information is not used at the moment and produces a
...
@@ -3462,72 +3348,69 @@ FIXME: The port information is not used at the moment and produces a
int
i
,
in
;
int
i
,
in
;
for
(
i
=
0
,
in
=
0
;
pszReturnData
[
i
]
!=
'\0'
;
i
++
)
for
(
i
=
0
,
in
=
0
;
pszReturnData
[
i
]
!=
'\0'
;
i
++
)
{
{
local_buf
[
in
]
=
pszReturnData
[
i
];
local_buf
[
in
]
=
pszReturnData
[
i
];
if
(
pszReturnData
[
i
]
==
':'
)
if
(
pszReturnData
[
i
]
==
':'
)
{
{
i
++
;
i
++
;
while
(
pszReturnData
[
i
]
!=
'\n'
)
while
(
pszReturnData
[
i
]
!=
'\n'
)
{
{
unsigned
char
h
;
unsigned
char
h
=
fromHexNibble
(
pszReturnData
[
i
]);
unsigned
char
l
;
h
=
fromHexNibble
(
pszReturnData
[
i
]);
i
++
;
i
++
;
if
(
pszReturnData
[
i
]
==
'\0'
)
continue
;
if
(
pszReturnData
[
i
]
==
'\0'
)
l
=
fromHexNibble
(
pszReturnData
[
i
]);
continue
;
unsigned
char
l
=
fromHexNibble
(
pszReturnData
[
i
]);
i
++
;
i
++
;
if
(
h
>=
16
||
l
>=
16
)
continue
;
if
(
h
>=
16
||
l
>=
16
)
continue
;
/*
/*
* FIXME: The array tchar[] was used uninitialized.
* FIXME: The array tchar[] was used uninitialized. It's
* It's not clear to me the original purpose of the
* not clear to me the original purpose of the piece of
* piece of code using it. To be removed in future
* code using it. To be removed in future versions.
* versions.
*/
*/
tchar
[
0
]
=
tchar
[
1
];
tchar
[
0
]
=
tchar
[
1
];
tchar
[
1
]
=
tchar
[
2
];
tchar
[
1
]
=
tchar
[
2
];
tchar
[
2
]
=
tchar
[
3
];
tchar
[
2
]
=
tchar
[
3
];
tchar
[
3
]
=
(
h
<<
4
)
+
l
;
tchar
[
3
]
=
(
h
<<
4
)
+
l
;
tchar
[
4
]
=
'\0'
;
tchar
[
4
]
=
'\0'
;
if
(
strncmp
(
tchar
,
"tcp:"
,
4
)
==
0
)
if
(
strncmp
(
tchar
,
"tcp:"
,
4
)
==
0
)
{
{
local_buf
[
in
-
7
]
=
'1'
;
local_buf
[
in
-
7
]
=
'1'
;
local_buf
[
in
-
6
]
=
strlen
(
port
)
+
47
;
local_buf
[
in
-
6
]
=
strlen
(
port
)
+
47
;
in
++
;
in
++
;
local_buf
[
in
]
=
pszReturnData
[
i
-
2
];
local_buf
[
in
]
=
pszReturnData
[
i
-
2
];
in
++
;
in
++
;
local_buf
[
in
]
=
pszReturnData
[
i
-
1
];
local_buf
[
in
]
=
pszReturnData
[
i
-
1
];
/* "localhost:" */
/* "localhost:" */
strcat
(
local_buf
,
"6c6f63616c686f73743a"
);
strcat
(
local_buf
,
"6c6f63616c686f73743a"
);
in
+=
20
;
in
+=
20
;
/*
/*
FIXME: The port information is not used at the moment and produces a
FIXME: The port information is not used at the moment and produces a
warning on recent gcc versions. Do we need such information
warning on recent gcc versions. Do we need such information
to run the audio forawrding?
to run the audio forawrding?
chport
=
&port[0];
chport
=
&port[0];
while(*chport
!=
'\0')
while(*chport
!=
'\0')
{
{
in++;
in++;
local_buf[in]
=
hex[(*chport >> 4) & 0xf];
local_buf[in]
=
hex[(*chport >> 4) & 0xf];
in++;
in++;
local_buf[in]
=
hex[*chport & 0xf];
local_buf[in]
=
hex[*chport & 0xf];
*chport++;
*chport++;
}
}
*/
*/
strcat
(
local_buf
,
"00"
);
strcat
(
local_buf
,
"00"
);
in
+=
2
;
in
+=
2
;
while
(
pszReturnData
[
i
]
!=
'\n'
)
while
(
pszReturnData
[
i
]
!=
'\n'
)
{
{
i
++
;
i
++
;
}
}
...
@@ -3535,20 +3418,20 @@ FIXME: The port information is not used at the moment and produces a
...
@@ -3535,20 +3418,20 @@ FIXME: The port information is not used at the moment and produces a
else
else
{
{
in
++
;
in
++
;
local_buf
[
in
]
=
pszReturnData
[
i
-
2
];
local_buf
[
in
]
=
pszReturnData
[
i
-
2
];
in
++
;
in
++
;
local_buf
[
in
]
=
pszReturnData
[
i
-
1
];
local_buf
[
in
]
=
pszReturnData
[
i
-
1
];
}
}
}
}
in
++
;
in
++
;
local_buf
[
in
]
=
pszReturnData
[
i
];
local_buf
[
in
]
=
pszReturnData
[
i
];
}
}
in
++
;
in
++
;
}
}
local_buf
[
in
]
=
0
;
local_buf
[
in
]
=
0
;
if
(
strlen
(
local_buf
))
if
(
strlen
(
local_buf
))
{
{
...
@@ -3623,9 +3506,6 @@ Bool intersect(int ax1, int ay1, unsigned int aw, unsigned int ah,
...
@@ -3623,9 +3506,6 @@ Bool intersect(int ax1, int ay1, unsigned int aw, unsigned int ah,
int
bx1
,
int
by1
,
unsigned
int
bw
,
unsigned
int
bh
,
int
bx1
,
int
by1
,
unsigned
int
bw
,
unsigned
int
bh
,
int
*
x
,
int
*
y
,
unsigned
int
*
w
,
unsigned
int
*
h
)
int
*
x
,
int
*
y
,
unsigned
int
*
w
,
unsigned
int
*
h
)
{
{
int
tx1
,
ty1
,
tx2
,
ty2
,
ix
,
iy
;
unsigned
int
iw
,
ih
;
int
ax2
=
ax1
+
aw
;
int
ax2
=
ax1
+
aw
;
int
ay2
=
ay1
+
ah
;
int
ay2
=
ay1
+
ah
;
int
bx2
=
bx1
+
bw
;
int
bx2
=
bx1
+
bw
;
...
@@ -3643,15 +3523,15 @@ Bool intersect(int ax1, int ay1, unsigned int aw, unsigned int ah,
...
@@ -3643,15 +3523,15 @@ Bool intersect(int ax1, int ay1, unsigned int aw, unsigned int ah,
return
FALSE
;
return
FALSE
;
}
}
tx1
=
max
(
ax1
,
bx1
);
int
tx1
=
max
(
ax1
,
bx1
);
ty1
=
max
(
ay1
,
by1
);
int
ty1
=
max
(
ay1
,
by1
);
tx2
=
min
(
ax2
,
bx2
);
int
tx2
=
min
(
ax2
,
bx2
);
ty2
=
min
(
ay2
,
by2
);
int
ty2
=
min
(
ay2
,
by2
);
ix
=
tx1
-
ax1
;
i
nt
i
x
=
tx1
-
ax1
;
iy
=
ty1
-
ay1
;
i
nt
i
y
=
ty1
-
ay1
;
iw
=
tx2
-
tx1
;
unsigned
int
iw
=
tx2
-
tx1
;
ih
=
ty2
-
ty1
;
unsigned
int
ih
=
ty2
-
ty1
;
/* check if the resulting rectangle is feasible */
/* check if the resulting rectangle is feasible */
if
(
iw
<=
0
||
ih
<=
0
)
{
if
(
iw
<=
0
||
ih
<=
0
)
{
...
@@ -3691,34 +3571,31 @@ Bool intersect_bb(int ax1, int ay1, unsigned int aw, unsigned int ah,
...
@@ -3691,34 +3571,31 @@ Bool intersect_bb(int ax1, int ay1, unsigned int aw, unsigned int ah,
Bool
result
=
intersect
(
ax1
,
ay1
,
aw
,
ah
,
bx1
,
by1
,
bw
,
bh
,
x
,
y
,
w
,
h
);
Bool
result
=
intersect
(
ax1
,
ay1
,
aw
,
ah
,
bx1
,
by1
,
bw
,
bh
,
x
,
y
,
w
,
h
);
if
(
result
==
TRUE
)
{
if
(
result
==
TRUE
)
{
/*
/*
* ###### The X-Coordinate ######
* ###### The X-Coordinate ######
*/
*/
/* check if outside-left of bounding box */
/* check if outside-left of bounding box */
if
(
bx1
==
bbx1
&&
ax1
<
bbx1
)
{
if
(
bx1
==
bbx1
&&
ax1
<
bbx1
)
{
*
w
+=
bbx1
-
ax1
;
*
w
+=
bbx1
-
ax1
;
*
x
=
0
;
*
x
=
0
;
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"intersect_bb: session box is outside-left of the bounding box - width gets adapted to [%d]
\n
"
,
*
w
);
fprintf
(
stderr
,
"intersect_bb: session box is outside-left of the bounding box - width gets adapted to [%d]
\n
"
,
*
w
);
#endif
#endif
}
}
/* check if outside-right of bounding box */
/* check if outside-right of bounding box */
if
(
bx1
+
bw
==
bbx2
&&
ax1
+
aw
>
bbx2
)
{
if
(
bx1
+
bw
==
bbx2
&&
ax1
+
aw
>
bbx2
)
{
*
w
+=
ax1
+
aw
-
bbx2
;
*
w
+=
ax1
+
aw
-
bbx2
;
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"intersect_bb: session box is outside-right of the bounding box - width gets adapted to [%d]
\n
"
,
*
w
);
fprintf
(
stderr
,
"intersect_bb: session box is outside-right of the bounding box - width gets adapted to [%d]
\n
"
,
*
w
);
#endif
#endif
}
}
/*
/*
...
@@ -3726,34 +3603,31 @@ Bool intersect_bb(int ax1, int ay1, unsigned int aw, unsigned int ah,
...
@@ -3726,34 +3603,31 @@ Bool intersect_bb(int ax1, int ay1, unsigned int aw, unsigned int ah,
*/
*/
/* check if outside-above of bounding box */
/* check if outside-above of bounding box */
if
(
by1
==
bby1
&&
ay1
<
bby1
)
{
if
(
by1
==
bby1
&&
ay1
<
bby1
)
{
*
h
+=
bby1
-
ay1
;
*
h
+=
bby1
-
ay1
;
*
y
=
0
;
*
y
=
0
;
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"intersect_bb: session box is outside-above of the bounding box - height gets adapted to [%d]
\n
"
,
*
h
);
fprintf
(
stderr
,
"intersect_bb: session box is outside-above of the bounding box - height gets adapted to [%d]
\n
"
,
*
h
);
#endif
#endif
}
}
/* check if outside-below of bounding box */
/* check if outside-below of bounding box */
if
(
by1
+
bh
==
bby2
&&
ay1
+
ah
>
bby2
)
{
if
(
by1
+
bh
==
bby2
&&
ay1
+
ah
>
bby2
)
{
*
h
+=
ay1
+
ah
-
bby2
;
*
h
+=
ay1
+
ah
-
bby2
;
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"intersect_bb: session box is outside-below of the bounding box - height gets adapted to [%d]
\n
"
,
*
h
);
fprintf
(
stderr
,
"intersect_bb: session box is outside-below of the bounding box - height gets adapted to [%d]
\n
"
,
*
h
);
#endif
#endif
}
}
}
}
return
result
;
return
result
;
}
}
#endif
#endif
RRModePtr
nxagentRRCustomMode
=
NULL
;
RRModePtr
nxagentRRCustomMode
=
NULL
;
/*
/*
This is basically the code that was used on screen resize before
This is basically the code that was used on screen resize before
...
@@ -3763,38 +3637,36 @@ RRModePtr nxagentRRCustomMode = NULL;
...
@@ -3763,38 +3637,36 @@ RRModePtr nxagentRRCustomMode = NULL;
void
nxagentAdjustCustomMode
(
ScreenPtr
pScreen
)
void
nxagentAdjustCustomMode
(
ScreenPtr
pScreen
)
{
{
rrScrPrivPtr
pScrPriv
=
rrGetScrPriv
(
pScreen
);
rrScrPrivPtr
pScrPriv
=
rrGetScrPriv
(
pScreen
);
RROutputPtr
output
;
if
(
pScrPriv
)
if
(
pScrPriv
)
{
{
output
=
RRFirstOutput
(
pScreen
);
RROutputPtr
output
=
RRFirstOutput
(
pScreen
);
if
(
output
&&
output
->
crtc
)
if
(
output
&&
output
->
crtc
)
{
{
RRCrtcPtr
crtc
;
char
name
[
100
];
xRRModeInfo
modeInfo
;
const
int
refresh
=
60
;
const
int
refresh
=
60
;
int
width
=
nxagentOption
(
Width
);
int
width
=
nxagentOption
(
Width
);
int
height
=
nxagentOption
(
Height
);
int
height
=
nxagentOption
(
Height
);
crtc
=
output
->
crtc
;
RRCrtcPtr
crtc
=
output
->
crtc
;
for
(
int
c
=
0
;
c
<
pScrPriv
->
numCrtcs
;
c
++
)
for
(
int
c
=
0
;
c
<
pScrPriv
->
numCrtcs
;
c
++
)
{
{
RRCrtcSet
(
pScrPriv
->
crtcs
[
c
],
NULL
,
0
,
0
,
RR_Rotate_0
,
0
,
NULL
);
RRCrtcSet
(
pScrPriv
->
crtcs
[
c
],
NULL
,
0
,
0
,
RR_Rotate_0
,
0
,
NULL
);
}
}
memset
(
&
modeInfo
,
'\0'
,
sizeof
(
modeInfo
))
;
char
name
[
100
]
;
sprintf
(
name
,
"%dx%d"
,
width
,
height
);
sprintf
(
name
,
"%dx%d"
,
width
,
height
);
modeInfo
.
width
=
width
;
xRRModeInfo
modeInfo
=
{
modeInfo
.
height
=
height
;
.
width
=
width
,
modeInfo
.
hTotal
=
width
;
.
height
=
height
,
modeInfo
.
vTotal
=
height
;
.
hTotal
=
width
,
modeInfo
.
dotClock
=
((
CARD32
)
width
*
(
CARD32
)
height
*
.
vTotal
=
height
,
(
CARD32
)
refresh
);
.
dotClock
=
((
CARD32
)
width
*
(
CARD32
)
height
*
modeInfo
.
nameLength
=
strlen
(
name
);
(
CARD32
)
refresh
),
.
nameLength
=
strlen
(
name
)
};
if
(
nxagentRRCustomMode
!=
NULL
)
if
(
nxagentRRCustomMode
!=
NULL
)
{
{
...
@@ -3936,19 +3808,13 @@ void nxagentDropOutput(RROutputPtr o)
...
@@ -3936,19 +3808,13 @@ void nxagentDropOutput(RROutputPtr o)
int
nxagentAdjustRandRXinerama
(
ScreenPtr
pScreen
)
int
nxagentAdjustRandRXinerama
(
ScreenPtr
pScreen
)
{
{
rrScrPrivPtr
pScrPriv
;
int
width
=
nxagentOption
(
Width
);
RROutputPtr
output
;
int
height
=
nxagentOption
(
Height
);
xRRModeInfo
modeInfo
;
char
name
[
100
];
int
refresh
=
60
;
int
width
=
nxagentOption
(
Width
);
int
height
=
nxagentOption
(
Height
);
pScrPriv
=
rrGetScrPriv
(
pScreen
);
rrScrPrivPtr
pScrPriv
=
rrGetScrPriv
(
pScreen
);
if
(
pScrPriv
)
if
(
pScrPriv
)
{
{
int
i
;
int
number
=
0
;
int
number
=
0
;
XineramaScreenInfo
*
screeninfo
=
XineramaQueryScreens
(
nxagentDisplay
,
&
number
);
XineramaScreenInfo
*
screeninfo
=
XineramaQueryScreens
(
nxagentDisplay
,
&
number
);
...
@@ -3957,7 +3823,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
...
@@ -3957,7 +3823,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
{
{
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentAdjustRandRXinerama: XineramaQueryScreens() returned [%d] screens:
\n
"
,
number
);
fprintf
(
stderr
,
"nxagentAdjustRandRXinerama: XineramaQueryScreens() returned [%d] screens:
\n
"
,
number
);
for
(
int
i
=
0
;
i
<
number
;
i
++
)
{
for
(
int
i
=
0
;
i
<
number
;
i
++
)
{
fprintf
(
stderr
,
"nxagentAdjustRandRXinerama: screen_number [%d] x_org [%d] y_org [%d] width [%d] height [%d]
\n
"
,
screeninfo
[
i
].
screen_number
,
screeninfo
[
i
].
x_org
,
screeninfo
[
i
].
y_org
,
screeninfo
[
i
].
width
,
screeninfo
[
i
].
height
);
fprintf
(
stderr
,
"nxagentAdjustRandRXinerama: screen_number [%d] x_org [%d] y_org [%d] width [%d] height [%d]
\n
"
,
screeninfo
[
i
].
screen_number
,
screeninfo
[
i
].
x_org
,
screeninfo
[
i
].
y_org
,
screeninfo
[
i
].
width
,
screeninfo
[
i
].
height
);
}
}
#endif
#endif
...
@@ -4002,15 +3868,13 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
...
@@ -4002,15 +3868,13 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentAdjustRandRXinerama: numCrtcs [%d], numOutputs [%d]
\n
"
,
pScrPriv
->
numCrtcs
,
pScrPriv
->
numOutputs
);
fprintf
(
stderr
,
"nxagentAdjustRandRXinerama: numCrtcs [%d], numOutputs [%d]
\n
"
,
pScrPriv
->
numCrtcs
,
pScrPriv
->
numOutputs
);
{
{
Bool
rrgetinfo
;
/*
/*
* Convert old RANDR 1.0 data (if any) to current structure. This
* Convert old RANDR 1.0 data (if any) to current structure. This
* is needed once at the first run of this function. If we don't
* is needed once at the first run of this function. If we don't
* do this here it will be done implicitly later and add mode(s) to
* do this here it will be done implicitly later and add mode(s) to
* our crtc(s)!
* our crtc(s)!
*/
*/
rrgetinfo
=
RRGetInfo
(
pScreen
,
FALSE
);
Bool
rrgetinfo
=
RRGetInfo
(
pScreen
,
FALSE
);
fprintf
(
stderr
,
"nxagentAdjustRandRXinerama: RRGetInfo returned [%d]
\n
"
,
rrgetinfo
);
fprintf
(
stderr
,
"nxagentAdjustRandRXinerama: RRGetInfo returned [%d]
\n
"
,
rrgetinfo
);
}
}
...
@@ -4025,7 +3889,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
...
@@ -4025,7 +3889,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
bbx2
=
bby2
=
0
;
bbx2
=
bby2
=
0
;
bbx1
=
bby1
=
INT_MAX
;
bbx1
=
bby1
=
INT_MAX
;
for
(
i
=
0
;
i
<
number
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
number
;
i
++
)
{
{
bbx2
=
max
(
bbx2
,
screeninfo
[
i
].
x_org
+
screeninfo
[
i
].
width
);
bbx2
=
max
(
bbx2
,
screeninfo
[
i
].
x_org
+
screeninfo
[
i
].
width
);
bby2
=
max
(
bby2
,
screeninfo
[
i
].
y_org
+
screeninfo
[
i
].
height
);
bby2
=
max
(
bby2
,
screeninfo
[
i
].
y_org
+
screeninfo
[
i
].
height
);
...
@@ -4070,7 +3934,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
...
@@ -4070,7 +3934,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
/* set gamma. Currently the only reason for doing this is
/* set gamma. Currently the only reason for doing this is
preventing the xrandr command from complaining about missing
preventing the xrandr command from complaining about missing
gamma. */
gamma. */
for
(
i
=
0
;
i
<
pScrPriv
->
numCrtcs
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
pScrPriv
->
numCrtcs
;
i
++
)
{
{
if
(
pScrPriv
->
crtcs
[
i
]
->
gammaSize
==
0
)
if
(
pScrPriv
->
crtcs
[
i
]
->
gammaSize
==
0
)
{
{
...
@@ -4082,19 +3946,22 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
...
@@ -4082,19 +3946,22 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
}
}
/* delete superfluous non-NX outputs */
/* delete superfluous non-NX outputs */
for
(
i
=
pScrPriv
->
numOutputs
-
1
;
i
>=
0
;
i
--
)
for
(
i
nt
i
=
pScrPriv
->
numOutputs
-
1
;
i
>=
0
;
i
--
)
if
(
strncmp
(
pScrPriv
->
outputs
[
i
]
->
name
,
"NX"
,
2
))
if
(
strncmp
(
pScrPriv
->
outputs
[
i
]
->
name
,
"NX"
,
2
))
nxagentDropOutput
(
pScrPriv
->
outputs
[
i
]);
nxagentDropOutput
(
pScrPriv
->
outputs
[
i
]);
/* at this stage only NX outputs are left - we delete the superfluous ones */
/* at this stage only NX outputs are left - we delete the superfluous ones */
for
(
i
=
pScrPriv
->
numOutputs
-
1
;
i
>=
number
;
i
--
)
for
(
i
nt
i
=
pScrPriv
->
numOutputs
-
1
;
i
>=
number
;
i
--
)
nxagentDropOutput
(
pScrPriv
->
outputs
[
i
]);
nxagentDropOutput
(
pScrPriv
->
outputs
[
i
]);
/* add and init outputs */
/* add and init outputs */
for
(
i
=
0
;
i
<
number
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
number
;
i
++
)
{
{
RROutputPtr
output
;
if
(
i
>=
pScrPriv
->
numOutputs
)
if
(
i
>=
pScrPriv
->
numOutputs
)
{
{
char
name
[
100
];
sprintf
(
name
,
"NX%d"
,
i
+
1
);
sprintf
(
name
,
"NX%d"
,
i
+
1
);
output
=
RROutputCreate
(
pScreen
,
name
,
strlen
(
name
),
NULL
);
output
=
RROutputCreate
(
pScreen
,
name
,
strlen
(
name
),
NULL
);
/* will be done later
/* will be done later
...
@@ -4120,10 +3987,8 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
...
@@ -4120,10 +3987,8 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
RROutputSetPhysicalSize
(
output
,
0
,
0
);
RROutputSetPhysicalSize
(
output
,
0
,
0
);
}
}
for
(
i
=
0
;
i
<
pScrPriv
->
numOutputs
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
pScrPriv
->
numOutputs
;
i
++
)
{
{
Bool
disable_output
=
FALSE
;
RRModePtr
mymode
=
NULL
,
prevmode
=
NULL
;
int
new_x
=
0
;
int
new_x
=
0
;
int
new_y
=
0
;
int
new_y
=
0
;
unsigned
int
new_w
=
0
;
unsigned
int
new_w
=
0
;
...
@@ -4131,22 +3996,22 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
...
@@ -4131,22 +3996,22 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
/* if there's no intersection disconnect the output */
/* if there's no intersection disconnect the output */
#ifdef NXAGENT_RANDR_XINERAMA_CLIPPING
#ifdef NXAGENT_RANDR_XINERAMA_CLIPPING
disable_output
=
!
intersect
(
nxagentOption
(
X
),
nxagentOption
(
Y
),
Bool
disable_output
=
!
intersect
(
nxagentOption
(
X
),
nxagentOption
(
Y
),
width
,
height
,
width
,
height
,
screeninfo
[
i
].
x_org
,
screeninfo
[
i
].
y_org
,
screeninfo
[
i
].
x_org
,
screeninfo
[
i
].
y_org
,
screeninfo
[
i
].
width
,
screeninfo
[
i
].
height
,
screeninfo
[
i
].
width
,
screeninfo
[
i
].
height
,
&
new_x
,
&
new_y
,
&
new_w
,
&
new_h
);
&
new_x
,
&
new_y
,
&
new_w
,
&
new_h
);
#else
#else
disable_output
=
!
intersect_bb
(
nxagentOption
(
X
),
nxagentOption
(
Y
),
Bool
disable_output
=
!
intersect_bb
(
nxagentOption
(
X
),
nxagentOption
(
Y
),
width
,
height
,
width
,
height
,
screeninfo
[
i
].
x_org
,
screeninfo
[
i
].
y_org
,
screeninfo
[
i
].
x_org
,
screeninfo
[
i
].
y_org
,
screeninfo
[
i
].
width
,
screeninfo
[
i
].
height
,
screeninfo
[
i
].
width
,
screeninfo
[
i
].
height
,
bbx1
,
bby1
,
bbx2
,
bby2
,
bbx1
,
bby1
,
bbx2
,
bby2
,
&
new_x
,
&
new_y
,
&
new_w
,
&
new_h
);
&
new_x
,
&
new_y
,
&
new_w
,
&
new_h
);
#endif
#endif
/* save previous mode */
/* save previous mode */
prevmode
=
pScrPriv
->
crtcs
[
i
]
->
mode
;
RRModePtr
prevmode
=
pScrPriv
->
crtcs
[
i
]
->
mode
;
#ifdef DEBUG
#ifdef DEBUG
if
(
prevmode
)
if
(
prevmode
)
{
{
...
@@ -4197,22 +4062,25 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
...
@@ -4197,22 +4062,25 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
RROutputSetConnection
(
pScrPriv
->
outputs
[
i
],
RR_Connected
);
RROutputSetConnection
(
pScrPriv
->
outputs
[
i
],
RR_Connected
);
memset
(
&
modeInfo
,
'\0'
,
sizeof
(
modeInfo
));
/* avoid collisions with pre-existing default modes by using a
/* avoid collisions with pre-existing default modes by using a
separate namespace. If we'd simply use XxY we could not
separate namespace. If we'd simply use XxY we could not
distinguish between pre-existing modes which should stay
distinguish between pre-existing modes which should stay
and our own modes that should be removed after use. */
and our own modes that should be removed after use. */
char
name
[
100
];
sprintf
(
name
,
"%s%dx%d"
,
QUOTE
(
NXAGENT_RANDR_MODE_PREFIX
),
new_w
,
new_h
);
sprintf
(
name
,
"%s%dx%d"
,
QUOTE
(
NXAGENT_RANDR_MODE_PREFIX
),
new_w
,
new_h
);
modeInfo
.
width
=
new_w
;
const
int
refresh
=
60
;
modeInfo
.
height
=
new_h
;
modeInfo
.
hTotal
=
new_w
;
xRRModeInfo
modeInfo
=
{
modeInfo
.
vTotal
=
new_h
;
.
width
=
new_w
,
modeInfo
.
dotClock
=
((
CARD32
)
new_w
*
(
CARD32
)
new_h
*
(
CARD32
)
refresh
);
.
height
=
new_h
,
modeInfo
.
nameLength
=
strlen
(
name
);
.
hTotal
=
new_w
,
.
vTotal
=
new_h
,
.
dotClock
=
((
CARD32
)
new_w
*
(
CARD32
)
new_h
*
(
CARD32
)
refresh
),
.
nameLength
=
strlen
(
name
)
};
mymode
=
RRModeGet
(
&
modeInfo
,
name
);
RRModePtr
mymode
=
RRModeGet
(
&
modeInfo
,
name
);
#ifdef DEBUG
#ifdef DEBUG
if
(
mymode
)
if
(
mymode
)
...
@@ -4310,8 +4178,6 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
...
@@ -4310,8 +4178,6 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
void
nxagentSaveAreas
(
PixmapPtr
pPixmap
,
RegionPtr
prgnSave
,
int
xorg
,
int
yorg
,
WindowPtr
pWin
)
void
nxagentSaveAreas
(
PixmapPtr
pPixmap
,
RegionPtr
prgnSave
,
int
xorg
,
int
yorg
,
WindowPtr
pWin
)
{
{
XGCValues
values
=
{
0
};
miBSWindowPtr
pBackingStore
=
(
miBSWindowPtr
)
pWin
->
backStorage
;
miBSWindowPtr
pBackingStore
=
(
miBSWindowPtr
)
pWin
->
backStorage
;
PixmapPtr
pVirtualPixmap
=
nxagentVirtualPixmap
(
pPixmap
);
PixmapPtr
pVirtualPixmap
=
nxagentVirtualPixmap
(
pPixmap
);
...
@@ -4323,7 +4189,7 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg,
...
@@ -4323,7 +4189,7 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg,
fbCopyWindowProc
(
&
pWin
->
drawable
,
&
pVirtualPixmap
->
drawable
,
0
,
RegionRects
(
prgnSave
),
fbCopyWindowProc
(
&
pWin
->
drawable
,
&
pVirtualPixmap
->
drawable
,
0
,
RegionRects
(
prgnSave
),
RegionNumRects
(
prgnSave
),
xorg
,
yorg
,
FALSE
,
FALSE
,
0
,
0
);
RegionNumRects
(
prgnSave
),
xorg
,
yorg
,
FALSE
,
FALSE
,
0
,
0
);
values
.
subwindow_mode
=
IncludeInferiors
;
XGCValues
values
=
{.
subwindow_mode
=
IncludeInferiors
}
;
XlibGC
gc
=
XCreateGC
(
nxagentDisplay
,
nxagentWindow
(
screenInfo
.
screens
[
0
]
->
root
),
GCSubwindowMode
,
&
values
);
XlibGC
gc
=
XCreateGC
(
nxagentDisplay
,
nxagentWindow
(
screenInfo
.
screens
[
0
]
->
root
),
GCSubwindowMode
,
&
values
);
...
@@ -4417,8 +4283,6 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg,
...
@@ -4417,8 +4283,6 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg,
void
nxagentRestoreAreas
(
PixmapPtr
pPixmap
,
RegionPtr
prgnRestore
,
int
xorg
,
void
nxagentRestoreAreas
(
PixmapPtr
pPixmap
,
RegionPtr
prgnRestore
,
int
xorg
,
int
yorg
,
WindowPtr
pWin
)
int
yorg
,
WindowPtr
pWin
)
{
{
XGCValues
values
=
{
0
};
/*
/*
* Limit the area to restore to the
* Limit the area to restore to the
* root window size.
* root window size.
...
@@ -4434,7 +4298,7 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg,
...
@@ -4434,7 +4298,7 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg,
fbCopyWindowProc
(
&
pVirtualPixmap
->
drawable
,
&
pWin
->
drawable
,
0
,
RegionRects
(
prgnRestore
),
fbCopyWindowProc
(
&
pVirtualPixmap
->
drawable
,
&
pWin
->
drawable
,
0
,
RegionRects
(
prgnRestore
),
RegionNumRects
(
prgnRestore
),
-
xorg
,
-
yorg
,
FALSE
,
FALSE
,
0
,
0
);
RegionNumRects
(
prgnRestore
),
-
xorg
,
-
yorg
,
FALSE
,
FALSE
,
0
,
0
);
values
.
subwindow_mode
=
ClipByChildren
;
XGCValues
values
=
{.
subwindow_mode
=
ClipByChildren
}
;
XlibGC
gc
=
XCreateGC
(
nxagentDisplay
,
nxagentWindow
(
screenInfo
.
screens
[
0
]
->
root
),
GCSubwindowMode
,
&
values
);
XlibGC
gc
=
XCreateGC
(
nxagentDisplay
,
nxagentWindow
(
screenInfo
.
screens
[
0
]
->
root
),
GCSubwindowMode
,
&
values
);
...
@@ -4597,9 +4461,9 @@ void nxagentSetWMNormalHints(int screen, int width, int height)
...
@@ -4597,9 +4461,9 @@ void nxagentSetWMNormalHints(int screen, int width, int height)
*/
*/
void
nxagentSetWMNormalHintsMaxsize
(
ScreenPtr
pScreen
,
int
maxwidth
,
int
maxheight
)
void
nxagentSetWMNormalHintsMaxsize
(
ScreenPtr
pScreen
,
int
maxwidth
,
int
maxheight
)
{
{
XSizeHints
*
sizeHints
;
XSizeHints
*
sizeHints
=
XAllocSizeHints
()
;
if
(
(
sizeHints
=
XAllocSizeHints
())
)
if
(
sizeHints
)
{
{
sizeHints
->
flags
=
PMaxSize
;
sizeHints
->
flags
=
PMaxSize
;
sizeHints
->
max_width
=
maxwidth
;
sizeHints
->
max_width
=
maxwidth
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Window.c
View file @
67599026
...
@@ -407,7 +407,7 @@ Bool nxagentCreateWindow(WindowPtr pWin)
...
@@ -407,7 +407,7 @@ Bool nxagentCreateWindow(WindowPtr pWin)
if
(
nxagentReportPrivateWindowIds
)
if
(
nxagentReportPrivateWindowIds
)
{
{
fprintf
(
stderr
,
"NXAGENT_WINDOW_ID: PRIVATE_WINDOW,WID:[0x%x]
\n
"
,
nxagentWindowPriv
(
pWin
)
->
window
);
fprintf
(
stderr
,
"NXAGENT_WINDOW_ID: PRIVATE_WINDOW,WID:[0x%x],INT:[0x%x]
\n
"
,
nxagentWindowPriv
(
pWin
)
->
window
,
pWin
->
drawable
.
id
);
}
}
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"nxagentCreateWindow: Created new window with id [0x%x].
\n
"
,
fprintf
(
stderr
,
"nxagentCreateWindow: Created new window with id [0x%x].
\n
"
,
...
@@ -1228,8 +1228,8 @@ void nxagentMoveViewport(ScreenPtr pScreen, int hShift, int vShift)
...
@@ -1228,8 +1228,8 @@ void nxagentMoveViewport(ScreenPtr pScreen, int hShift, int vShift)
/*
/*
* This will update the window on the real X server by calling
* This will update the window on the real X server by calling
* XConfigureWindow()/XMapWindow()/XLowerWindow()/XRaiseWindow()
* XConfigureWindow()/XMapWindow()/XLowerWindow()/XRaiseWindow()
.
* mask defines
the values that need to be updated, see e.g
* mask defines
the values that need to be updated, see e.g.
* man XConfigureWindow.
* man XConfigureWindow.
*
*
* In addition to the bit flags known to Xorg it uses these
* In addition to the bit flags known to Xorg it uses these
...
@@ -1281,35 +1281,30 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
...
@@ -1281,35 +1281,30 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
if
(
mask
&
CWX
)
if
(
mask
&
CWX
)
{
{
valuemask
|=
CWX
;
valuemask
|=
CWX
;
values
.
x
=
nxagentWindowPriv
(
pWin
)
->
x
=
pWin
->
origin
.
x
-
wBorderWidth
(
pWin
);
values
.
x
=
nxagentWindowPriv
(
pWin
)
->
x
=
pWin
->
origin
.
x
-
wBorderWidth
(
pWin
);
}
}
if
(
mask
&
CWY
)
if
(
mask
&
CWY
)
{
{
valuemask
|=
CWY
;
valuemask
|=
CWY
;
values
.
y
=
nxagentWindowPriv
(
pWin
)
->
y
=
pWin
->
origin
.
y
-
wBorderWidth
(
pWin
);
values
.
y
=
nxagentWindowPriv
(
pWin
)
->
y
=
pWin
->
origin
.
y
-
wBorderWidth
(
pWin
);
}
}
if
(
mask
&
CWWidth
)
if
(
mask
&
CWWidth
)
{
{
valuemask
|=
CWWidth
;
valuemask
|=
CWWidth
;
values
.
width
=
nxagentWindowPriv
(
pWin
)
->
width
=
pWin
->
drawable
.
width
;
values
.
width
=
nxagentWindowPriv
(
pWin
)
->
width
=
pWin
->
drawable
.
width
;
}
}
if
(
mask
&
CWHeight
)
if
(
mask
&
CWHeight
)
{
{
valuemask
|=
CWHeight
;
valuemask
|=
CWHeight
;
values
.
height
=
nxagentWindowPriv
(
pWin
)
->
height
=
pWin
->
drawable
.
height
;
values
.
height
=
nxagentWindowPriv
(
pWin
)
->
height
=
pWin
->
drawable
.
height
;
}
}
if
(
mask
&
CWBorderWidth
)
if
(
mask
&
CWBorderWidth
)
{
{
valuemask
|=
CWBorderWidth
;
valuemask
|=
CWBorderWidth
;
values
.
border_width
=
nxagentWindowPriv
(
pWin
)
->
borderWidth
=
values
.
border_width
=
nxagentWindowPriv
(
pWin
)
->
borderWidth
=
pWin
->
borderWidth
;
pWin
->
borderWidth
;
}
}
...
@@ -3037,7 +3032,7 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer
...
@@ -3037,7 +3032,7 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer
if
(
nxagentReportPrivateWindowIds
)
if
(
nxagentReportPrivateWindowIds
)
{
{
fprintf
(
stderr
,
"NXAGENT_WINDOW_ID: PRIVATE_WINDOW,WID:[0x%x]
\n
"
,
nxagentWindowPriv
(
pWin
)
->
window
);
fprintf
(
stderr
,
"NXAGENT_WINDOW_ID: PRIVATE_WINDOW,WID:[0x%x],INT:[0x%x]
\n
"
,
nxagentWindowPriv
(
pWin
)
->
window
,
pWin
->
drawable
.
id
);
}
}
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"nxagentReconnectWindow: Created new window with id [0x%x].
\n
"
,
fprintf
(
stderr
,
"nxagentReconnectWindow: Created new window with id [0x%x].
\n
"
,
...
@@ -3447,10 +3442,7 @@ void nxagentSetTopLevelEventMask(WindowPtr pWin)
...
@@ -3447,10 +3442,7 @@ void nxagentSetTopLevelEventMask(WindowPtr pWin)
*/
*/
void
nxagentFlushConfigureWindow
(
void
)
void
nxagentFlushConfigureWindow
(
void
)
{
{
ConfiguredWindowStruct
*
index
;
ConfiguredWindowStruct
*
index
=
nxagentConfiguredWindowList
;
XWindowChanges
changes
;
index
=
nxagentConfiguredWindowList
;
while
(
index
)
while
(
index
)
{
{
...
@@ -3493,8 +3485,10 @@ void nxagentFlushConfigureWindow(void)
...
@@ -3493,8 +3485,10 @@ void nxagentFlushConfigureWindow(void)
if
(
nxagentExposeQueue
.
exposures
[
i
].
synchronize
==
1
)
if
(
nxagentExposeQueue
.
exposures
[
i
].
synchronize
==
1
)
{
{
changes
.
x
=
nxagentExposeQueue
.
exposures
[
i
].
serial
;
XWindowChanges
changes
=
{
changes
.
y
=
-
2
;
.
x
=
nxagentExposeQueue
.
exposures
[
i
].
serial
,
.
y
=
-
2
};
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentFlushConfigureWindow: Sending synch ConfigureWindow for "
fprintf
(
stderr
,
"nxagentFlushConfigureWindow: Sending synch ConfigureWindow for "
...
...
nx-X11/programs/Xserver/include/dix.h
View file @
67599026
...
@@ -265,7 +265,6 @@ typedef struct _Client *ClientPtr; /* also in misc.h */
...
@@ -265,7 +265,6 @@ typedef struct _Client *ClientPtr; /* also in misc.h */
typedef
struct
_WorkQueue
*
WorkQueuePtr
;
typedef
struct
_WorkQueue
*
WorkQueuePtr
;
extern
ClientPtr
requestingClient
;
extern
ClientPtr
*
clients
;
extern
ClientPtr
*
clients
;
extern
ClientPtr
serverClient
;
extern
ClientPtr
serverClient
;
extern
int
currentMaxClients
;
extern
int
currentMaxClients
;
...
...
nx-X11/programs/Xserver/include/scrnintstr.h
View file @
67599026
...
@@ -743,7 +743,7 @@ typedef struct _ScreenInfo {
...
@@ -743,7 +743,7 @@ typedef struct _ScreenInfo {
int
arraySize
;
int
arraySize
;
int
numScreens
;
int
numScreens
;
ScreenPtr
screens
[
MAXSCREENS
];
ScreenPtr
screens
[
MAXSCREENS
];
int
numVideoScreens
;
int
unused
;
}
ScreenInfo
;
}
ScreenInfo
;
extern
ScreenInfo
screenInfo
;
extern
ScreenInfo
screenInfo
;
...
...
nx-X11/programs/Xserver/include/xkbsrv.h
View file @
67599026
...
@@ -56,11 +56,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
...
@@ -56,11 +56,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "xkbstr.h"
#include "xkbstr.h"
#include "inputstr.h"
#include "inputstr.h"
#ifdef NXAGENT_SERVER
extern
char
*
_NXGetXkbBasePath
(
const
char
*
path
);
extern
char
*
_NXGetXkbCompPath
(
const
char
*
path
);
#endif
typedef
struct
_XkbInterest
{
typedef
struct
_XkbInterest
{
DeviceIntPtr
dev
;
DeviceIntPtr
dev
;
ClientPtr
client
;
ClientPtr
client
;
...
@@ -253,6 +248,7 @@ typedef struct
...
@@ -253,6 +248,7 @@ typedef struct
/***====================================================================***/
/***====================================================================***/
extern
void
XkbFreePrivates
(
DeviceIntPtr
);
/***====================================================================***/
/***====================================================================***/
...
...
nx-X11/programs/Xserver/mi/mibstore.c
View file @
67599026
...
@@ -57,7 +57,6 @@ implied warranty.
...
@@ -57,7 +57,6 @@ implied warranty.
#include "pixmapstr.h"
#include "pixmapstr.h"
#include <X11/fonts/fontstruct.h>
#include <X11/fonts/fontstruct.h>
#include "dixfontstr.h"
#include "dixfontstr.h"
#include "dixstruct.h"
/* For requestingClient */
#include "mi.h"
#include "mi.h"
#include "mibstorest.h"
#include "mibstorest.h"
...
...
nx-X11/programs/Xserver/mi/miwideline.c
View file @
67599026
...
@@ -1127,7 +1127,7 @@ miLineProjectingCap (pDrawable, pGC, pixel, spanData, face, isLeft, xorg, yorg,
...
@@ -1127,7 +1127,7 @@ miLineProjectingCap (pDrawable, pGC, pixel, spanData, face, isLeft, xorg, yorg,
{
{
int
xorgi
=
0
,
yorgi
=
0
;
int
xorgi
=
0
,
yorgi
=
0
;
int
lw
;
int
lw
;
PolyEdgeRec
lefts
[
2
],
rights
[
2
];
PolyEdgeRec
lefts
[
4
],
rights
[
4
];
int
lefty
,
righty
,
topy
,
bottomy
;
int
lefty
,
righty
,
topy
,
bottomy
;
PolyEdgePtr
left
,
right
;
PolyEdgePtr
left
,
right
;
PolyEdgePtr
top
,
bottom
;
PolyEdgePtr
top
,
bottom
;
...
@@ -1311,7 +1311,7 @@ miWideSegment (
...
@@ -1311,7 +1311,7 @@ miWideSegment (
PolyEdgePtr
top
,
bottom
;
PolyEdgePtr
top
,
bottom
;
int
lefty
,
righty
,
topy
,
bottomy
;
int
lefty
,
righty
,
topy
,
bottomy
;
int
signdx
;
int
signdx
;
PolyEdgeRec
lefts
[
2
],
rights
[
2
];
PolyEdgeRec
lefts
[
4
],
rights
[
4
];
LineFacePtr
tface
;
LineFacePtr
tface
;
int
lw
=
pGC
->
lineWidth
;
int
lw
=
pGC
->
lineWidth
;
...
@@ -1713,7 +1713,7 @@ miWideDashSegment (
...
@@ -1713,7 +1713,7 @@ miWideDashSegment (
PolyVertexRec
vertices
[
4
];
PolyVertexRec
vertices
[
4
];
PolyVertexRec
saveRight
,
saveBottom
;
PolyVertexRec
saveRight
,
saveBottom
;
PolySlopeRec
slopes
[
4
];
PolySlopeRec
slopes
[
4
];
PolyEdgeRec
left
[
2
],
right
[
2
];
PolyEdgeRec
left
[
4
],
right
[
4
];
LineFaceRec
lcapFace
,
rcapFace
;
LineFaceRec
lcapFace
,
rcapFace
;
int
nleft
,
nright
;
int
nleft
,
nright
;
int
h
;
int
h
;
...
...
nx-X11/programs/Xserver/os/WaitFor.c
View file @
67599026
...
@@ -82,9 +82,6 @@ SOFTWARE.
...
@@ -82,9 +82,6 @@ SOFTWARE.
#include <dix-config.h>
#include <dix-config.h>
#endif
#endif
#ifdef WIN32
#include <nx-X11/Xwinsock.h>
#endif
#include <nx-X11/Xos.h>
/* for strings, fcntl, time */
#include <nx-X11/Xos.h>
/* for strings, fcntl, time */
#include <errno.h>
#include <errno.h>
#include <stdio.h>
#include <stdio.h>
...
@@ -105,22 +102,9 @@ static unsigned long startTimeInMillis;
...
@@ -105,22 +102,9 @@ static unsigned long startTimeInMillis;
#endif
#endif
#ifdef WIN32
/* Error codes from windows sockets differ from fileio error codes */
#undef EINTR
#define EINTR WSAEINTR
#undef EINVAL
#define EINVAL WSAEINVAL
#undef EBADF
#define EBADF WSAENOTSOCK
/* Windows select does not set errno. Use GetErrno as wrapper for
WSAGetLastError */
#define GetErrno WSAGetLastError
#else
/* This is just a fallback to errno to hide the differences between unix and
/* This is just a fallback to errno to hide the differences between unix and
Windows in the code */
Windows in the code */
#define GetErrno() errno
#define GetErrno() errno
#endif
/* modifications by raphael */
/* modifications by raphael */
int
int
...
@@ -484,30 +468,12 @@ WaitForSomething(int *pClientsReady)
...
@@ -484,30 +468,12 @@ WaitForSomething(int *pClientsReady)
if
(
XFD_ANYSET
(
&
clientsReadable
))
if
(
XFD_ANYSET
(
&
clientsReadable
))
break
;
break
;
#ifdef WIN32
/* Windows keyboard and mouse events are added to the input queue
in Block- and WakupHandlers. There is no device to check if
data is ready. So check here if new input is available */
#if defined(NX_TRANS_SOCKET)
if
(
*
checkForInput
[
0
]
!=
*
checkForInput
[
1
])
{
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
fprintf
(
stderr
,
"WaitForSomething: Returning 0 because of (*checkForInput[0] != *checkForInput[1]).
\n
"
);
#endif
return
0
;
}
#else
if
(
*
checkForInput
[
0
]
!=
*
checkForInput
[
1
])
return
0
;
#endif
#endif
}
}
}
}
nready
=
0
;
nready
=
0
;
if
(
XFD_ANYSET
(
&
clientsReadable
))
if
(
XFD_ANYSET
(
&
clientsReadable
))
{
{
#ifndef WIN32
for
(
i
=
0
;
i
<
howmany
(
XFD_SETSIZE
,
NFDBITS
);
i
++
)
for
(
i
=
0
;
i
<
howmany
(
XFD_SETSIZE
,
NFDBITS
);
i
++
)
{
{
while
(
clientsReadable
.
fds_bits
[
i
])
while
(
clientsReadable
.
fds_bits
[
i
])
...
@@ -517,23 +483,9 @@ WaitForSomething(int *pClientsReady)
...
@@ -517,23 +483,9 @@ WaitForSomething(int *pClientsReady)
curclient
=
ffs
(
clientsReadable
.
fds_bits
[
i
])
-
1
;
curclient
=
ffs
(
clientsReadable
.
fds_bits
[
i
])
-
1
;
client_index
=
/* raphael: modified */
client_index
=
/* raphael: modified */
ConnectionTranslation
[
curclient
+
(
i
*
(
sizeof
(
fd_mask
)
*
8
))];
ConnectionTranslation
[
curclient
+
(
i
*
(
sizeof
(
fd_mask
)
*
8
))];
#else
fd_set
savedClientsReadable
;
XFD_COPYSET
(
&
clientsReadable
,
&
savedClientsReadable
);
for
(
i
=
0
;
i
<
XFD_SETCOUNT
(
&
savedClientsReadable
);
i
++
)
{
int
client_priority
,
client_index
;
curclient
=
XFD_FD
(
&
savedClientsReadable
,
i
);
client_index
=
GetConnectionTranslation
(
curclient
);
#endif
pClientsReady
[
nready
++
]
=
client_index
;
pClientsReady
[
nready
++
]
=
client_index
;
#ifndef WIN32
clientsReadable
.
fds_bits
[
i
]
&=
~
(((
fd_mask
)
1L
)
<<
curclient
);
clientsReadable
.
fds_bits
[
i
]
&=
~
(((
fd_mask
)
1L
)
<<
curclient
);
}
}
#else
FD_CLR
(
curclient
,
&
clientsReadable
);
#endif
}
}
}
}
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
...
...
nx-X11/programs/Xserver/os/access.c
View file @
67599026
...
@@ -58,9 +58,6 @@ SOFTWARE.
...
@@ -58,9 +58,6 @@ SOFTWARE.
#include <dix-config.h>
#include <dix-config.h>
#endif
#endif
#ifdef WIN32
#include <nx-X11/Xwinsock.h>
#endif
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
...
@@ -75,14 +72,13 @@ SOFTWARE.
...
@@ -75,14 +72,13 @@ SOFTWARE.
#include "site.h"
#include "site.h"
#include <errno.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/types.h>
#ifndef WIN32
#include <sys/socket.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/ioctl.h>
#include <ctype.h>
#include <ctype.h>
#if defined(TCPCONN)
|| defined(ISC) || defined(__SCO__)
#if defined(TCPCONN)
#include <netinet/in.h>
#include <netinet/in.h>
#endif
/* TCPCONN
|| ISC || __SCO__
*/
#endif
/* TCPCONN */
#ifdef HAS_GETPEERUCRED
#ifdef HAS_GETPEERUCRED
# include <ucred.h>
# include <ucred.h>
...
@@ -91,15 +87,11 @@ SOFTWARE.
...
@@ -91,15 +87,11 @@ SOFTWARE.
# endif
# endif
#endif
#endif
#if defined(SVR4) || (defined(SYSV) && defined(
i386
)) || defined(__GNU__)
#if defined(SVR4) || (defined(SYSV) && defined(
__i386__
)) || defined(__GNU__)
# include <sys/utsname.h>
# include <sys/utsname.h>
#endif
#endif
#if defined(SYSV) && defined(
i386
)
#if defined(SYSV) && defined(
__i386__
)
# include <sys/stream.h>
# include <sys/stream.h>
# ifdef ISC
# include <sys/stropts.h>
# include <sys/sioctl.h>
# endif
/* ISC */
#endif
#endif
#ifdef __GNU__
#ifdef __GNU__
#undef SIOCGIFCONF
#undef SIOCGIFCONF
...
@@ -145,7 +137,6 @@ SOFTWARE.
...
@@ -145,7 +137,6 @@ SOFTWARE.
/* #endif */
/* #endif */
#endif
#endif
#endif
/* WIN32 */
#ifndef PATH_MAX
#ifndef PATH_MAX
#include <sys/param.h>
#include <sys/param.h>
...
@@ -158,10 +149,6 @@ SOFTWARE.
...
@@ -158,10 +149,6 @@ SOFTWARE.
#endif
#endif
#endif
#endif
#ifdef __SCO__
/* The system defined value is wrong. MAXPATHLEN is set in sco5.cf. */
#undef PATH_MAX
#endif
#define X_INCLUDE_NETDB_H
#define X_INCLUDE_NETDB_H
#include <nx-X11/Xos_r.h>
#include <nx-X11/Xos_r.h>
...
@@ -282,7 +269,7 @@ AccessUsingXdmcp (void)
...
@@ -282,7 +269,7 @@ AccessUsingXdmcp (void)
}
}
#if ((defined(SVR4) && !defined(SCO325) && !defined(sun) && !defined(NCR))
|| defined(ISC)
) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF)
#if ((defined(SVR4) && !defined(SCO325) && !defined(sun) && !defined(NCR))) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF)
/* Deal with different SIOCGIFCONF ioctl semantics on these OSs */
/* Deal with different SIOCGIFCONF ioctl semantics on these OSs */
...
@@ -299,17 +286,6 @@ ifioctl (int fd, int cmd, char *arg)
...
@@ -299,17 +286,6 @@ ifioctl (int fd, int cmd, char *arg)
{
{
ioc
.
ic_len
=
((
struct
ifconf
*
)
arg
)
->
ifc_len
;
ioc
.
ic_len
=
((
struct
ifconf
*
)
arg
)
->
ifc_len
;
ioc
.
ic_dp
=
((
struct
ifconf
*
)
arg
)
->
ifc_buf
;
ioc
.
ic_dp
=
((
struct
ifconf
*
)
arg
)
->
ifc_buf
;
#ifdef ISC
/* SIOCGIFCONF is somewhat brain damaged on ISC. The argument
* buffer must contain the ifconf structure as header. Ifc_req
* is also not a pointer but a one element array of ifreq
* structures. On return this array is extended by enough
* ifreq fields to hold all interfaces. The return buffer length
* is placed in the buffer header.
*/
((
struct
ifconf
*
)
ioc
.
ic_dp
)
->
ifc_len
=
ioc
.
ic_len
-
sizeof
(
struct
ifconf
);
#endif
}
}
else
else
{
{
...
@@ -321,19 +297,11 @@ ifioctl (int fd, int cmd, char *arg)
...
@@ -321,19 +297,11 @@ ifioctl (int fd, int cmd, char *arg)
#ifdef SVR4
#ifdef SVR4
((
struct
ifconf
*
)
arg
)
->
ifc_len
=
ioc
.
ic_len
;
((
struct
ifconf
*
)
arg
)
->
ifc_len
=
ioc
.
ic_len
;
#endif
#endif
#ifdef ISC
{
((
struct
ifconf
*
)
arg
)
->
ifc_len
=
((
struct
ifconf
*
)
ioc
.
ic_dp
)
->
ifc_len
;
((
struct
ifconf
*
)
arg
)
->
ifc_buf
=
(
caddr_t
)((
struct
ifconf
*
)
ioc
.
ic_dp
)
->
ifc_req
;
}
#endif
return
(
ret
);
return
(
ret
);
}
}
#else
/* Case sun, SCO325 NCR and others */
#else
/* Case sun, SCO325 NCR and others */
#define ifioctl ioctl
#define ifioctl ioctl
#endif
/* ((SVR4 && !sun !SCO325 !NCR)
|| ISC
) && SIOCGIFCONF */
#endif
/* ((SVR4 && !sun !SCO325 !NCR)) && SIOCGIFCONF */
/*
/*
* DefineSelf (fd):
* DefineSelf (fd):
...
@@ -501,13 +469,7 @@ DefineSelf (int fd)
...
@@ -501,13 +469,7 @@ DefineSelf (int fd)
int
family
;
int
family
;
register
HOST
*
host
;
register
HOST
*
host
;
#ifndef WIN32
struct
utsname
name
;
struct
utsname
name
;
#else
struct
{
char
nodename
[
512
];
}
name
;
#endif
register
struct
hostent
*
hp
;
register
struct
hostent
*
hp
;
...
@@ -531,11 +493,7 @@ DefineSelf (int fd)
...
@@ -531,11 +493,7 @@ DefineSelf (int fd)
* uname() lets me access to the whole string (it smashes release, you
* uname() lets me access to the whole string (it smashes release, you
* see), whereas gethostname() kindly truncates it for me.
* see), whereas gethostname() kindly truncates it for me.
*/
*/
#ifndef WIN32
uname
(
&
name
);
uname
(
&
name
);
#else
gethostname
(
name
.
nodename
,
sizeof
(
name
.
nodename
));
#endif
hp
=
_XGethostbyname
(
name
.
nodename
,
hparams
);
hp
=
_XGethostbyname
(
name
.
nodename
,
hparams
);
if
(
hp
!=
NULL
)
if
(
hp
!=
NULL
)
...
@@ -723,11 +681,7 @@ DefineSelf (int fd)
...
@@ -723,11 +681,7 @@ DefineSelf (int fd)
ifc
.
ifc_buf
=
bufptr
;
ifc
.
ifc_buf
=
bufptr
;
#define IFC_IOCTL_REQ SIOCGIFCONF
#define IFC_IOCTL_REQ SIOCGIFCONF
#ifdef ISC
#define IFC_IFC_REQ (struct ifreq *) ifc.ifc_buf
#else
#define IFC_IFC_REQ ifc.ifc_req
#define IFC_IFC_REQ ifc.ifc_req
#endif
/* ISC */
#define IFC_IFC_LEN ifc.ifc_len
#define IFC_IFC_LEN ifc.ifc_len
#define IFR_IFR_ADDR ifr->ifr_addr
#define IFR_IFR_ADDR ifr->ifr_addr
#define IFR_IFR_NAME ifr->ifr_name
#define IFR_IFR_NAME ifr->ifr_name
...
@@ -1723,10 +1677,6 @@ ConvertAddr (
...
@@ -1723,10 +1677,6 @@ ConvertAddr (
return
FamilyLocal
;
return
FamilyLocal
;
#if defined(TCPCONN)
#if defined(TCPCONN)
case
AF_INET
:
case
AF_INET
:
#ifdef WIN32
if
(
16777343
==
*
(
long
*
)
&
((
struct
sockaddr_in
*
)
saddr
)
->
sin_addr
)
return
FamilyLocal
;
#endif
*
len
=
sizeof
(
struct
in_addr
);
*
len
=
sizeof
(
struct
in_addr
);
*
addr
=
(
void
*
)
&
(((
struct
sockaddr_in
*
)
saddr
)
->
sin_addr
);
*
addr
=
(
void
*
)
&
(((
struct
sockaddr_in
*
)
saddr
)
->
sin_addr
);
return
FamilyInternet
;
return
FamilyInternet
;
...
...
nx-X11/programs/Xserver/os/auth.c
View file @
67599026
...
@@ -71,9 +71,6 @@ from The Open Group.
...
@@ -71,9 +71,6 @@ from The Open Group.
#define _SECURITY_SERVER
#define _SECURITY_SERVER
# include <nx-X11/extensions/security.h>
# include <nx-X11/extensions/security.h>
#endif
#endif
#ifdef WIN32
#include <nx-X11/Xw32defs.h>
#endif
struct
protocol
{
struct
protocol
{
unsigned
short
name_length
;
unsigned
short
name_length
;
...
...
nx-X11/programs/Xserver/os/connection.c
View file @
67599026
...
@@ -65,9 +65,6 @@ SOFTWARE.
...
@@ -65,9 +65,6 @@ SOFTWARE.
#include <dix-config.h>
#include <dix-config.h>
#endif
#endif
#ifdef WIN32
#include <nx-X11/Xwinsock.h>
#endif
#include <nx-X11/X.h>
#include <nx-X11/X.h>
#include <nx-X11/Xproto.h>
#include <nx-X11/Xproto.h>
#define XSERV_t
#define XSERV_t
...
@@ -81,7 +78,6 @@ SOFTWARE.
...
@@ -81,7 +78,6 @@ SOFTWARE.
#include <stdlib.h>
#include <stdlib.h>
#include <unistd.h>
#include <unistd.h>
#ifndef WIN32
#include <sys/socket.h>
#include <sys/socket.h>
#if defined(TCPCONN)
#if defined(TCPCONN)
...
@@ -104,7 +100,6 @@ SOFTWARE.
...
@@ -104,7 +100,6 @@ SOFTWARE.
#endif
#endif
#include <sys/uio.h>
#include <sys/uio.h>
#endif
/* WIN32 */
#include "misc.h"
#include "misc.h"
#include "osdep.h"
#include "osdep.h"
#include <nx-X11/Xpoll.h>
#include <nx-X11/Xpoll.h>
...
@@ -155,98 +150,7 @@ int GrabInProgress = 0;
...
@@ -155,98 +150,7 @@ int GrabInProgress = 0;
static
void
static
void
QueueNewConnections
(
int
curconn
,
int
ready
,
void
*
data
);
QueueNewConnections
(
int
curconn
,
int
ready
,
void
*
data
);
#if !defined(WIN32)
int
*
ConnectionTranslation
=
NULL
;
int
*
ConnectionTranslation
=
NULL
;
#else
/*
* On NT fds are not between 0 and MAXSOCKS, they are unrelated, and there is
* not even a known maximum value, so use something quite arbitrary for now.
* Do storage is a hash table of size 256. Collisions are handled in a linked
* list.
*/
#undef MAXSOCKS
#define MAXSOCKS 500
#undef MAXSELECT
#define MAXSELECT 500
#define MAXFD 500
struct
_ct_node
{
struct
_ct_node
*
next
;
int
key
;
int
value
;
};
struct
_ct_node
*
ct_head
[
256
];
void
InitConnectionTranslation
(
void
)
{
bzero
(
ct_head
,
sizeof
(
ct_head
));
}
int
GetConnectionTranslation
(
int
conn
)
{
struct
_ct_node
*
node
=
ct_head
[
conn
&
0xff
];
while
(
node
!=
NULL
)
{
if
(
node
->
key
==
conn
)
return
node
->
value
;
node
=
node
->
next
;
}
return
0
;
}
void
SetConnectionTranslation
(
int
conn
,
int
client
)
{
struct
_ct_node
**
node
=
ct_head
+
(
conn
&
0xff
);
if
(
client
==
0
)
/* remove entry */
{
while
(
*
node
!=
NULL
)
{
if
((
*
node
)
->
key
==
conn
)
{
struct
_ct_node
*
temp
=
*
node
;
*
node
=
(
*
node
)
->
next
;
free
(
temp
);
return
;
}
node
=
&
((
*
node
)
->
next
);
}
return
;
}
else
{
while
(
*
node
!=
NULL
)
{
if
((
*
node
)
->
key
==
conn
)
{
(
*
node
)
->
value
=
client
;
return
;
}
node
=
&
((
*
node
)
->
next
);
}
*
node
=
(
struct
_ct_node
*
)
malloc
(
sizeof
(
struct
_ct_node
));
(
*
node
)
->
next
=
NULL
;
(
*
node
)
->
key
=
conn
;
(
*
node
)
->
value
=
client
;
return
;
}
}
void
ClearConnectionTranslation
(
void
)
{
unsigned
i
;
for
(
i
=
0
;
i
<
256
;
i
++
)
{
struct
_ct_node
*
node
=
ct_head
[
i
];
while
(
node
!=
NULL
)
{
struct
_ct_node
*
temp
=
node
;
node
=
node
->
next
;
free
(
temp
);
}
}
}
#endif
XtransConnInfo
*
ListenTransConns
=
NULL
;
XtransConnInfo
*
ListenTransConns
=
NULL
;
int
*
ListenTransFds
=
NULL
;
int
*
ListenTransFds
=
NULL
;
...
@@ -318,11 +222,7 @@ InitConnectionLimits(void)
...
@@ -318,11 +222,7 @@ InitConnectionLimits(void)
ErrorF
(
"InitConnectionLimits: MaxClients = %d
\n
"
,
MaxClients
);
ErrorF
(
"InitConnectionLimits: MaxClients = %d
\n
"
,
MaxClients
);
#endif
#endif
#if !defined(WIN32)
ConnectionTranslation
=
(
int
*
)
xnfalloc
(
sizeof
(
int
)
*
(
lastfdesc
+
1
));
ConnectionTranslation
=
(
int
*
)
xnfalloc
(
sizeof
(
int
)
*
(
lastfdesc
+
1
));
#else
InitConnectionTranslation
();
#endif
}
}
/*
/*
...
@@ -341,7 +241,6 @@ InitConnectionLimits(void)
...
@@ -341,7 +241,6 @@ InitConnectionLimits(void)
static
void
static
void
InitParentProcess
(
void
)
InitParentProcess
(
void
)
{
{
#if !defined(WIN32)
OsSigHandlerPtr
handler
;
OsSigHandlerPtr
handler
;
handler
=
OsSignal
(
SIGUSR1
,
SIG_IGN
);
handler
=
OsSignal
(
SIGUSR1
,
SIG_IGN
);
if
(
handler
==
SIG_IGN
)
if
(
handler
==
SIG_IGN
)
...
@@ -357,13 +256,11 @@ InitParentProcess(void)
...
@@ -357,13 +256,11 @@ InitParentProcess(void)
*/
*/
ParentProcess
=
GetPPID
(
ParentProcess
);
ParentProcess
=
GetPPID
(
ParentProcess
);
#endif
/* __UNIXOS2__ */
#endif
/* __UNIXOS2__ */
#endif
}
}
void
void
NotifyParentProcess
(
void
)
NotifyParentProcess
(
void
)
{
{
#if !defined(WIN32)
if
(
displayfd
>=
0
)
{
if
(
displayfd
>=
0
)
{
#ifdef NXAGENT_SERVER
#ifdef NXAGENT_SERVER
if
(
displayfd
==
STDERR_FILENO
)
if
(
displayfd
==
STDERR_FILENO
)
...
@@ -385,7 +282,6 @@ NotifyParentProcess(void)
...
@@ -385,7 +282,6 @@ NotifyParentProcess(void)
kill
(
ParentProcess
,
SIGUSR1
);
kill
(
ParentProcess
,
SIGUSR1
);
}
}
}
}
#endif
}
}
static
Bool
static
Bool
...
@@ -416,11 +312,7 @@ CreateWellKnownSockets(void)
...
@@ -416,11 +312,7 @@ CreateWellKnownSockets(void)
FD_ZERO
(
&
LastSelectMask
);
FD_ZERO
(
&
LastSelectMask
);
FD_ZERO
(
&
ClientsWithInput
);
FD_ZERO
(
&
ClientsWithInput
);
#if !defined(WIN32)
for
(
i
=
0
;
i
<
MaxClients
;
i
++
)
ConnectionTranslation
[
i
]
=
0
;
for
(
i
=
0
;
i
<
MaxClients
;
i
++
)
ConnectionTranslation
[
i
]
=
0
;
#else
ClearConnectionTranslation
();
#endif
/* display is initialized to "0" by main(). It is then set to the display
/* display is initialized to "0" by main(). It is then set to the display
* number if specified on the command line. */
* number if specified on the command line. */
...
@@ -473,10 +365,8 @@ CreateWellKnownSockets(void)
...
@@ -473,10 +365,8 @@ CreateWellKnownSockets(void)
if
(
ListenTransCount
==
0
&&
!
NoListenAll
)
if
(
ListenTransCount
==
0
&&
!
NoListenAll
)
FatalError
(
"Cannot establish any listening sockets - Make sure an X server isn't already running"
);
FatalError
(
"Cannot establish any listening sockets - Make sure an X server isn't already running"
);
#if !defined(WIN32)
OsSignal
(
SIGPIPE
,
SIG_IGN
);
OsSignal
(
SIGPIPE
,
SIG_IGN
);
OsSignal
(
SIGHUP
,
AutoResetServer
);
OsSignal
(
SIGHUP
,
AutoResetServer
);
#endif
OsSignal
(
SIGINT
,
GiveUp
);
OsSignal
(
SIGINT
,
GiveUp
);
OsSignal
(
SIGTERM
,
GiveUp
);
OsSignal
(
SIGTERM
,
GiveUp
);
ResetHosts
(
display
);
ResetHosts
(
display
);
...
@@ -802,11 +692,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time)
...
@@ -802,11 +692,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time)
ClientPtr
client
;
ClientPtr
client
;
if
(
if
(
#ifndef WIN32
fd
>=
lastfdesc
fd
>=
lastfdesc
#else
XFD_SETCOUNT
(
&
AllClients
)
>=
MaxClients
#endif
)
)
return
NullClient
;
return
NullClient
;
oc
=
(
OsCommPtr
)
malloc
(
sizeof
(
OsCommRec
));
oc
=
(
OsCommPtr
)
malloc
(
sizeof
(
OsCommRec
));
...
@@ -825,11 +711,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time)
...
@@ -825,11 +711,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time)
}
}
client
->
local
=
ComputeLocalClient
(
client
);
client
->
local
=
ComputeLocalClient
(
client
);
{
{
#if !defined(WIN32)
ConnectionTranslation
[
fd
]
=
client
->
index
;
ConnectionTranslation
[
fd
]
=
client
->
index
;
#else
SetConnectionTranslation
(
fd
,
client
->
index
);
#endif
if
(
GrabInProgress
)
if
(
GrabInProgress
)
{
{
FD_SET
(
fd
,
&
SavedAllClients
);
FD_SET
(
fd
,
&
SavedAllClients
);
...
@@ -893,11 +775,7 @@ EstablishNewConnections(ClientPtr clientUnused, void * closure)
...
@@ -893,11 +775,7 @@ EstablishNewConnections(ClientPtr clientUnused, void * closure)
if
(
newconn
<
lastfdesc
)
{
if
(
newconn
<
lastfdesc
)
{
int
clientid
;
int
clientid
;
#if !defined(WIN32)
clientid
=
ConnectionTranslation
[
newconn
];
clientid
=
ConnectionTranslation
[
newconn
];
#else
clientid
=
GetConnectionTranslation
(
newconn
);
#endif
if
(
clientid
&&
(
client
=
clients
[
clientid
]))
if
(
clientid
&&
(
client
=
clients
[
clientid
]))
CloseDownClient
(
client
);
CloseDownClient
(
client
);
}
}
...
@@ -990,11 +868,7 @@ CloseDownFileDescriptor(OsCommPtr oc)
...
@@ -990,11 +868,7 @@ CloseDownFileDescriptor(OsCommPtr oc)
}
}
FreeOsBuffers
(
oc
);
FreeOsBuffers
(
oc
);
free
(
oc
);
free
(
oc
);
#ifndef WIN32
ConnectionTranslation
[
connection
]
=
0
;
ConnectionTranslation
[
connection
]
=
0
;
#else
SetConnectionTranslation
(
connection
,
0
);
#endif
FD_CLR
(
connection
,
&
AllSockets
);
FD_CLR
(
connection
,
&
AllSockets
);
FD_CLR
(
connection
,
&
AllClients
);
FD_CLR
(
connection
,
&
AllClients
);
FD_CLR
(
connection
,
&
ClientsWithInput
);
FD_CLR
(
connection
,
&
ClientsWithInput
);
...
@@ -1023,22 +897,16 @@ CloseDownFileDescriptor(OsCommPtr oc)
...
@@ -1023,22 +897,16 @@ CloseDownFileDescriptor(OsCommPtr oc)
void
void
CheckConnections
(
void
)
CheckConnections
(
void
)
{
{
#ifndef WIN32
fd_mask
mask
;
fd_mask
mask
;
#endif
fd_set
tmask
;
fd_set
tmask
;
int
curclient
,
curoff
;
int
curclient
,
curoff
;
int
i
;
int
i
;
struct
timeval
notime
;
struct
timeval
notime
;
int
r
;
int
r
;
#ifdef WIN32
fd_set
savedAllClients
;
#endif
notime
.
tv_sec
=
0
;
notime
.
tv_sec
=
0
;
notime
.
tv_usec
=
0
;
notime
.
tv_usec
=
0
;
#ifndef WIN32
for
(
i
=
0
;
i
<
howmany
(
XFD_SETSIZE
,
NFDBITS
);
i
++
)
for
(
i
=
0
;
i
<
howmany
(
XFD_SETSIZE
,
NFDBITS
);
i
++
)
{
{
mask
=
AllClients
.
fds_bits
[
i
];
mask
=
AllClients
.
fds_bits
[
i
];
...
@@ -1054,18 +922,6 @@ CheckConnections(void)
...
@@ -1054,18 +922,6 @@ CheckConnections(void)
mask
&=
~
((
fd_mask
)
1
<<
curoff
);
mask
&=
~
((
fd_mask
)
1
<<
curoff
);
}
}
}
}
#else
XFD_COPYSET
(
&
AllClients
,
&
savedAllClients
);
for
(
i
=
0
;
i
<
XFD_SETCOUNT
(
&
savedAllClients
);
i
++
)
{
curclient
=
XFD_FD
(
&
savedAllClients
,
i
);
FD_ZERO
(
&
tmask
);
FD_SET
(
curclient
,
&
tmask
);
r
=
Select
(
curclient
+
1
,
&
tmask
,
NULL
,
NULL
,
&
notime
);
if
(
r
<
0
)
CloseDownClient
(
clients
[
GetConnectionTranslation
(
curclient
)]);
}
#endif
}
}
...
...
nx-X11/programs/Xserver/os/io.c
View file @
67599026
...
@@ -60,9 +60,6 @@ SOFTWARE.
...
@@ -60,9 +60,6 @@ SOFTWARE.
#if 0
#if 0
#define DEBUG_COMMUNICATION
#define DEBUG_COMMUNICATION
#endif
#endif
#ifdef WIN32
#include <nx-X11/Xwinsock.h>
#endif
#include <stdio.h>
#include <stdio.h>
#define XSERV_t
#define XSERV_t
#define TRANS_SERVER
#define TRANS_SERVER
...
@@ -70,9 +67,7 @@ SOFTWARE.
...
@@ -70,9 +67,7 @@ SOFTWARE.
#include <nx-X11/Xtrans/Xtrans.h>
#include <nx-X11/Xtrans/Xtrans.h>
#include <nx-X11/Xmd.h>
#include <nx-X11/Xmd.h>
#include <errno.h>
#include <errno.h>
#if !defined(WIN32)
#include <sys/uio.h>
#include <sys/uio.h>
#endif
#include <nx-X11/X.h>
#include <nx-X11/X.h>
#include <nx-X11/Xproto.h>
#include <nx-X11/Xproto.h>
#include "os.h"
#include "os.h"
...
@@ -88,7 +83,6 @@ CallbackListPtr FlushCallback;
...
@@ -88,7 +83,6 @@ CallbackListPtr FlushCallback;
/* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX
/* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX
* systems are broken and return EWOULDBLOCK when they should return EAGAIN
* systems are broken and return EWOULDBLOCK when they should return EAGAIN
*/
*/
#ifndef WIN32
#if defined(EAGAIN) && defined(EWOULDBLOCK)
#if defined(EAGAIN) && defined(EWOULDBLOCK)
#define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK)
#define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK)
#else
#else
...
@@ -98,9 +92,6 @@ CallbackListPtr FlushCallback;
...
@@ -98,9 +92,6 @@ CallbackListPtr FlushCallback;
#define ETEST(err) (err == EWOULDBLOCK)
#define ETEST(err) (err == EWOULDBLOCK)
#endif
#endif
#endif
#endif
#else
/* WIN32 The socket errorcodes differ from the normal errors*/
#define ETEST(err) (err == EAGAIN || err == WSAEWOULDBLOCK)
#endif
Bool
CriticalOutputPending
;
Bool
CriticalOutputPending
;
int
timesThisConnection
=
0
;
int
timesThisConnection
=
0
;
...
@@ -358,7 +349,7 @@ ReadRequestFromClient(ClientPtr client)
...
@@ -358,7 +349,7 @@ ReadRequestFromClient(ClientPtr client)
{
{
if
((
result
<
0
)
&&
ETEST
(
errno
))
if
((
result
<
0
)
&&
ETEST
(
errno
))
{
{
#if defined(SVR4) && defined(
i386
) && !defined(sun)
#if defined(SVR4) && defined(
__i386__
) && !defined(sun)
if
(
0
)
if
(
0
)
#endif
#endif
{
{
...
@@ -777,9 +768,6 @@ FlushAllOutput(void)
...
@@ -777,9 +768,6 @@ FlushAllOutput(void)
OsCommPtr
oc
;
OsCommPtr
oc
;
register
ClientPtr
client
;
register
ClientPtr
client
;
Bool
newoutput
=
NewOutputPending
;
Bool
newoutput
=
NewOutputPending
;
#if defined(WIN32)
fd_set
newOutputPending
;
#endif
if
(
!
newoutput
)
if
(
!
newoutput
)
return
;
return
;
...
@@ -792,7 +780,6 @@ FlushAllOutput(void)
...
@@ -792,7 +780,6 @@ FlushAllOutput(void)
CriticalOutputPending
=
FALSE
;
CriticalOutputPending
=
FALSE
;
NewOutputPending
=
FALSE
;
NewOutputPending
=
FALSE
;
#ifndef WIN32
for
(
base
=
0
;
base
<
howmany
(
XFD_SETSIZE
,
NFDBITS
);
base
++
)
for
(
base
=
0
;
base
<
howmany
(
XFD_SETSIZE
,
NFDBITS
);
base
++
)
{
{
mask
=
OutputPending
.
fds_bits
[
base
];
mask
=
OutputPending
.
fds_bits
[
base
];
...
@@ -817,28 +804,6 @@ FlushAllOutput(void)
...
@@ -817,28 +804,6 @@ FlushAllOutput(void)
(
void
)
FlushClient
(
client
,
oc
,
(
char
*
)
NULL
,
0
);
(
void
)
FlushClient
(
client
,
oc
,
(
char
*
)
NULL
,
0
);
}
}
}
}
#else
/* WIN32 */
FD_ZERO
(
&
newOutputPending
);
for
(
base
=
0
;
base
<
XFD_SETCOUNT
(
&
OutputPending
);
base
++
)
{
index
=
XFD_FD
(
&
OutputPending
,
base
);
if
((
index
=
GetConnectionTranslation
(
index
))
==
0
)
continue
;
client
=
clients
[
index
];
if
(
client
->
clientGone
)
continue
;
oc
=
(
OsCommPtr
)
client
->
osPrivate
;
if
(
FD_ISSET
(
oc
->
fd
,
&
ClientsWithInput
))
{
FD_SET
(
oc
->
fd
,
&
newOutputPending
);
/* set the bit again */
NewOutputPending
=
TRUE
;
}
else
(
void
)
FlushClient
(
client
,
oc
,
(
char
*
)
NULL
,
0
);
}
XFD_COPYSET
(
&
newOutputPending
,
&
OutputPending
);
#endif
/* WIN32 */
}
}
void
void
...
...
nx-X11/programs/Xserver/os/log.c
View file @
67599026
...
@@ -117,10 +117,6 @@ OR PERFORMANCE OF THIS SOFTWARE.
...
@@ -117,10 +117,6 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include "site.h"
#include "site.h"
#include "opaque.h"
#include "opaque.h"
#ifdef WIN32
#include <process.h>
#define getpid(x) _getpid(x)
#endif
#ifdef NX_TRANS_SOCKET
#ifdef NX_TRANS_SOCKET
...
@@ -268,9 +264,7 @@ LogInit(const char *fname, const char *backup)
...
@@ -268,9 +264,7 @@ LogInit(const char *fname, const char *backup)
if
(
saveBuffer
&&
bufferSize
>
0
)
{
if
(
saveBuffer
&&
bufferSize
>
0
)
{
fwrite
(
saveBuffer
,
bufferPos
,
1
,
logFile
);
fwrite
(
saveBuffer
,
bufferPos
,
1
,
logFile
);
fflush
(
logFile
);
fflush
(
logFile
);
#ifndef WIN32
fsync
(
fileno
(
logFile
));
fsync
(
fileno
(
logFile
));
#endif
}
}
}
}
...
@@ -398,10 +392,8 @@ LogVWrite(int verb, const char *f, va_list args)
...
@@ -398,10 +392,8 @@ LogVWrite(int verb, const char *f, va_list args)
fwrite
(
tmpBuffer
,
len
,
1
,
logFile
);
fwrite
(
tmpBuffer
,
len
,
1
,
logFile
);
if
(
logFlush
)
{
if
(
logFlush
)
{
fflush
(
logFile
);
fflush
(
logFile
);
#ifndef WIN32
if
(
logSync
)
if
(
logSync
)
fsync
(
fileno
(
logFile
));
fsync
(
fileno
(
logFile
));
#endif
}
}
}
else
if
(
needBuffer
)
{
}
else
if
(
needBuffer
)
{
/*
/*
...
@@ -730,11 +722,9 @@ ErrorF(const char * f, ...)
...
@@ -730,11 +722,9 @@ ErrorF(const char * f, ...)
#ifndef NEED_STRERROR
#ifndef NEED_STRERROR
#ifdef SYSV
#ifdef SYSV
#if !defined(ISC) || defined(ISC202) || defined(ISC22)
#define NEED_STRERROR
#define NEED_STRERROR
#endif
#endif
#endif
#endif
#endif
#if defined(NEED_STRERROR) && !defined(strerror)
#if defined(NEED_STRERROR) && !defined(strerror)
extern
char
*
sys_errlist
[];
extern
char
*
sys_errlist
[];
...
...
nx-X11/programs/Xserver/os/osdep.h
View file @
67599026
...
@@ -69,11 +69,6 @@ SOFTWARE.
...
@@ -69,11 +69,6 @@ SOFTWARE.
#undef _POSIX_SOURCE
#undef _POSIX_SOURCE
#endif
#endif
#else
/* X_NOT_POSIX */
#else
/* X_NOT_POSIX */
#ifdef WIN32
#define _POSIX_
#include <limits.h>
#undef _POSIX_
#endif
#endif
/* X_NOT_POSIX */
#endif
/* X_NOT_POSIX */
#ifndef OPEN_MAX
#ifndef OPEN_MAX
...
@@ -85,11 +80,7 @@ SOFTWARE.
...
@@ -85,11 +80,7 @@ SOFTWARE.
#if defined(NOFILE) && !defined(NOFILES_MAX)
#if defined(NOFILE) && !defined(NOFILES_MAX)
#define OPEN_MAX NOFILE
#define OPEN_MAX NOFILE
#else
#else
#if !defined(WIN32)
#define OPEN_MAX NOFILES_MAX
#define OPEN_MAX NOFILES_MAX
#else
#define OPEN_MAX 256
#endif
#endif
#endif
#endif
#endif
#endif
#endif
...
@@ -213,13 +204,7 @@ extern fd_set ClientsWriteBlocked;
...
@@ -213,13 +204,7 @@ extern fd_set ClientsWriteBlocked;
extern
fd_set
OutputPending
;
extern
fd_set
OutputPending
;
extern
fd_set
IgnoredClientsWithInput
;
extern
fd_set
IgnoredClientsWithInput
;
#ifndef WIN32
extern
int
*
ConnectionTranslation
;
extern
int
*
ConnectionTranslation
;
#else
extern
int
GetConnectionTranslation
(
int
conn
);
extern
void
SetConnectionTranslation
(
int
conn
,
int
client
);
extern
void
ClearConnectionTranslation
();
#endif
extern
Bool
NewOutputPending
;
extern
Bool
NewOutputPending
;
extern
Bool
AnyWritesPending
;
extern
Bool
AnyWritesPending
;
...
@@ -234,9 +219,6 @@ extern OsCommPtr AvailableInput;
...
@@ -234,9 +219,6 @@ extern OsCommPtr AvailableInput;
extern
WorkQueuePtr
workQueue
;
extern
WorkQueuePtr
workQueue
;
/* added by raphael */
/* added by raphael */
#ifdef WIN32
typedef
long
int
fd_mask
;
#endif
#define ffs mffs
#define ffs mffs
extern
int
mffs
(
fd_mask
);
extern
int
mffs
(
fd_mask
);
...
...
nx-X11/programs/Xserver/os/osinit.c
View file @
67599026
...
@@ -65,11 +65,8 @@ SOFTWARE.
...
@@ -65,11 +65,8 @@ SOFTWARE.
#endif
#endif
#endif
#endif
#if defined(__SCO__)
#include <sys/wait.h>
#endif
#if !defined(SYSV)
&& !defined(WIN32)
#if !defined(SYSV)
#include <sys/resource.h>
#include <sys/resource.h>
#endif
#endif
...
@@ -104,7 +101,7 @@ OsInit(void)
...
@@ -104,7 +101,7 @@ OsInit(void)
InitNotifyFds
();
InitNotifyFds
();
#if !defined(__
SCO__) && !defined(__CYGWIN__) && !defined(__UNIXWARE
__)
#if !defined(__
CYGWIN
__)
fclose
(
stdin
);
fclose
(
stdin
);
fclose
(
stdout
);
fclose
(
stdout
);
#endif
#endif
...
@@ -134,7 +131,7 @@ OsInit(void)
...
@@ -134,7 +131,7 @@ OsInit(void)
dup2
(
fileno
(
err
),
2
);
dup2
(
fileno
(
err
),
2
);
fclose
(
err
);
fclose
(
err
);
}
}
#if defined(SYSV) || defined(SVR4) || defined(
WIN32) || defined(
__CYGWIN__)
#if defined(SYSV) || defined(SVR4) || defined(__CYGWIN__)
{
{
static
char
buf
[
BUFSIZ
];
static
char
buf
[
BUFSIZ
];
setvbuf
(
stderr
,
buf
,
_IOLBF
,
BUFSIZ
);
setvbuf
(
stderr
,
buf
,
_IOLBF
,
BUFSIZ
);
...
@@ -148,7 +145,7 @@ OsInit(void)
...
@@ -148,7 +145,7 @@ OsInit(void)
if
(
getpgrp
()
==
0
)
if
(
getpgrp
()
==
0
)
setpgid
(
0
,
0
);
setpgid
(
0
,
0
);
#else
#else
#if !defined(SYSV)
&& !defined(WIN32)
#if !defined(SYSV)
if
(
getpgrp
(
0
)
==
0
)
if
(
getpgrp
(
0
)
==
0
)
setpgrp
(
0
,
getpid
());
setpgrp
(
0
,
getpid
());
#endif
#endif
...
...
nx-X11/programs/Xserver/os/utils.c
View file @
67599026
...
@@ -83,9 +83,6 @@ OR PERFORMANCE OF THIS SOFTWARE.
...
@@ -83,9 +83,6 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include <signal.h>
#include <signal.h>
#endif
#endif
#if defined(WIN32) && !defined(__CYGWIN__)
#include <nx-X11/Xwinsock.h>
#endif
#include <nx-X11/Xos.h>
#include <nx-X11/Xos.h>
#include <stdio.h>
#include <stdio.h>
#include "misc.h"
#include "misc.h"
...
@@ -115,10 +112,8 @@ OR PERFORMANCE OF THIS SOFTWARE.
...
@@ -115,10 +112,8 @@ OR PERFORMANCE OF THIS SOFTWARE.
#undef _POSIX_SOURCE
#undef _POSIX_SOURCE
#endif
#endif
#endif
#endif
#ifndef WIN32
#include <sys/wait.h>
#include <sys/wait.h>
#endif
#if !defined(SYSV)
#if !defined(SYSV) && !defined(WIN32)
#include <sys/resource.h>
#include <sys/resource.h>
#endif
#endif
#include <time.h>
#include <time.h>
...
@@ -132,9 +127,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
...
@@ -132,9 +127,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include <stdlib.h>
/* for malloc() */
#include <stdlib.h>
/* for malloc() */
#if defined(TCPCONN)
#if defined(TCPCONN)
# ifndef WIN32
# include <netdb.h>
# include <netdb.h>
# endif
#endif
#endif
#include "opaque.h"
#include "opaque.h"
...
@@ -910,7 +903,7 @@ ProcessCommandLine(int argc, char *argv[])
...
@@ -910,7 +903,7 @@ ProcessCommandLine(int argc, char *argv[])
#ifdef SERVER_LOCK
#ifdef SERVER_LOCK
else
if
(
strcmp
(
argv
[
i
],
"-nolock"
)
==
0
)
else
if
(
strcmp
(
argv
[
i
],
"-nolock"
)
==
0
)
{
{
#if
!defined(WIN32) &&
!defined(__CYGWIN__)
#if !defined(__CYGWIN__)
if
(
getuid
()
!=
0
)
if
(
getuid
()
!=
0
)
ErrorF
(
"Warning: the -nolock option can only be used by root
\n
"
);
ErrorF
(
"Warning: the -nolock option can only be used by root
\n
"
);
else
else
...
@@ -1230,7 +1223,7 @@ ExpandCommandLine(int *pargc, char ***pargv)
...
@@ -1230,7 +1223,7 @@ ExpandCommandLine(int *pargc, char ***pargv)
{
{
int
i
;
int
i
;
#if
!defined(WIN32) &&
!defined(__CYGWIN__)
#if !defined(__CYGWIN__)
if
(
getuid
()
!=
geteuid
())
if
(
getuid
()
!=
geteuid
())
return
;
return
;
#endif
#endif
...
@@ -1566,7 +1559,6 @@ OsReleaseSignals (void)
...
@@ -1566,7 +1559,6 @@ OsReleaseSignals (void)
#endif
#endif
}
}
#if !defined(WIN32)
/*
/*
* "safer" versions of system(3), popen(3) and pclose(3) which give up
* "safer" versions of system(3), popen(3) and pclose(3) which give up
* all privs before running a command.
* all privs before running a command.
...
@@ -1948,7 +1940,6 @@ Fclose(void * iop)
...
@@ -1948,7 +1940,6 @@ Fclose(void * iop)
#endif
#endif
}
}
#endif
/* !WIN32 */
/*
/*
...
@@ -1981,11 +1972,7 @@ Fclose(void * iop)
...
@@ -1981,11 +1972,7 @@ Fclose(void * iop)
/* Check args and env only if running setuid (euid == 0 && euid != uid) ? */
/* Check args and env only if running setuid (euid == 0 && euid != uid) ? */
#ifndef CHECK_EUID
#ifndef CHECK_EUID
#ifndef WIN32
#define CHECK_EUID 1
#define CHECK_EUID 1
#else
#define CHECK_EUID 0
#endif
#endif
#endif
/*
/*
...
@@ -2232,52 +2219,3 @@ CheckUserAuthorization(void)
...
@@ -2232,52 +2219,3 @@ CheckUserAuthorization(void)
#endif
#endif
}
}
#ifdef __SCO__
#include <fcntl.h>
static
void
lockit
(
int
fd
,
short
what
)
{
struct
flock
lck
;
lck
.
l_whence
=
0
;
lck
.
l_start
=
0
;
lck
.
l_len
=
1
;
lck
.
l_type
=
what
;
(
void
)
fcntl
(
fd
,
F_SETLKW
,
&
lck
);
}
/* SCO OpenServer 5 lacks pread/pwrite. Emulate them. */
ssize_t
pread
(
int
fd
,
void
*
buf
,
size_t
nbytes
,
off_t
offset
)
{
off_t
saved
;
ssize_t
ret
;
lockit
(
fd
,
F_RDLCK
);
saved
=
lseek
(
fd
,
0
,
SEEK_CUR
);
lseek
(
fd
,
offset
,
SEEK_SET
);
ret
=
read
(
fd
,
buf
,
nbytes
);
lseek
(
fd
,
saved
,
SEEK_SET
);
lockit
(
fd
,
F_UNLCK
);
return
ret
;
}
ssize_t
pwrite
(
int
fd
,
const
void
*
buf
,
size_t
nbytes
,
off_t
offset
)
{
off_t
saved
;
ssize_t
ret
;
lockit
(
fd
,
F_WRLCK
);
saved
=
lseek
(
fd
,
0
,
SEEK_CUR
);
lseek
(
fd
,
offset
,
SEEK_SET
);
ret
=
write
(
fd
,
buf
,
nbytes
);
lseek
(
fd
,
saved
,
SEEK_SET
);
lockit
(
fd
,
F_UNLCK
);
return
ret
;
}
#endif
/* __SCO__ */
nx-X11/programs/Xserver/os/xdmcp.c
View file @
67599026
...
@@ -17,22 +17,13 @@
...
@@ -17,22 +17,13 @@
#include <dix-config.h>
#include <dix-config.h>
#endif
#endif
#ifdef WIN32
#include <nx-X11/Xwinsock.h>
#define XSERV_t
#define TRANS_SERVER
#define TRANS_REOPEN
#include <nx-X11/Xtrans/Xtrans.h>
#endif
#include <nx-X11/Xos.h>
#include <nx-X11/Xos.h>
#if !defined(WIN32)
#include <sys/param.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/in.h>
#include <netdb.h>
#include <netdb.h>
#endif
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
...
@@ -1507,9 +1498,6 @@ get_addr_by_name(
...
@@ -1507,9 +1498,6 @@ get_addr_by_name(
#ifdef XTHREADS_NEEDS_BYNAMEPARAMS
#ifdef XTHREADS_NEEDS_BYNAMEPARAMS
_Xgethostbynameparams
hparams
;
_Xgethostbynameparams
hparams
;
#endif
#endif
#if defined(WIN32) && defined(TCPCONN)
_XSERVTransWSAStartup
();
#endif
if
(
!
(
hep
=
_XGethostbyname
(
namestr
,
hparams
)))
if
(
!
(
hep
=
_XGethostbyname
(
namestr
,
hparams
)))
{
{
FatalError
(
"Xserver: %s unknown host: %s
\n
"
,
argtype
,
namestr
);
FatalError
(
"Xserver: %s unknown host: %s
\n
"
,
argtype
,
namestr
);
...
...
nx-X11/programs/Xserver/xkb/xkbActions.c
View file @
67599026
...
@@ -84,7 +84,7 @@ XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc)
...
@@ -84,7 +84,7 @@ XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc)
void
void
XkbFreePrivates
(
DeviceIntPtr
device
)
XkbFreePrivates
(
DeviceIntPtr
device
)
{
{
if
(
device
&&
if
(
device
&&
device
->
devPrivates
&&
device
->
devPrivates
&&
device
->
nPrivates
>
0
&&
device
->
nPrivates
>
0
&&
xkbDevicePrivateIndex
!=
-
1
&&
xkbDevicePrivateIndex
!=
-
1
&&
...
...
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