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
a9787fc2
Unverified
Commit
a9787fc2
authored
Feb 26, 2018
by
Mihai Moldovan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/update_dix' into 3.6.x
Attributes GH PR #646:
https://github.com/ArcticaProject/nx-libs/pull/646
parents
b40dec98
6dcfcbab
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
328 additions
and
131 deletions
+328
-131
atom.c
nx-X11/programs/Xserver/dix/atom.c
+2
-0
colormap.c
nx-X11/programs/Xserver/dix/colormap.c
+10
-0
devices.c
nx-X11/programs/Xserver/dix/devices.c
+3
-38
dispatch.c
nx-X11/programs/Xserver/dix/dispatch.c
+16
-5
events.c
nx-X11/programs/Xserver/dix/events.c
+9
-18
extension.c
nx-X11/programs/Xserver/dix/extension.c
+50
-1
ffs.c
nx-X11/programs/Xserver/dix/ffs.c
+2
-0
globals.c
nx-X11/programs/Xserver/dix/globals.c
+5
-8
main.c
nx-X11/programs/Xserver/dix/main.c
+2
-1
pixmap.c
nx-X11/programs/Xserver/dix/pixmap.c
+9
-0
privates.c
nx-X11/programs/Xserver/dix/privates.c
+58
-0
swaprep.c
nx-X11/programs/Xserver/dix/swaprep.c
+2
-4
swapreq.c
nx-X11/programs/Xserver/dix/swapreq.c
+0
-2
window.c
nx-X11/programs/Xserver/dix/window.c
+69
-11
xpstubs.c
nx-X11/programs/Xserver/dix/xpstubs.c
+2
-0
NXevents.c
nx-X11/programs/Xserver/hw/nxagent/NXevents.c
+2
-3
NXproperty.c
nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
+3
-5
NXwindow.c
nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
+33
-23
nxagent.1
nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1
+0
-5
colormapst.h
nx-X11/programs/Xserver/include/colormapst.h
+16
-3
extension.h
nx-X11/programs/Xserver/include/extension.h
+12
-0
extnsionst.h
nx-X11/programs/Xserver/include/extnsionst.h
+3
-0
opaque.h
nx-X11/programs/Xserver/include/opaque.h
+1
-1
pixmapstr.h
nx-X11/programs/Xserver/include/pixmapstr.h
+12
-1
window.h
nx-X11/programs/Xserver/include/window.h
+7
-0
utils.c
nx-X11/programs/Xserver/os/utils.c
+0
-2
No files found.
nx-X11/programs/Xserver/dix/atom.c
View file @
a9787fc2
...
...
@@ -52,6 +52,8 @@ SOFTWARE.
#include <nx-X11/X.h>
#include <nx-X11/Xatom.h>
#include <stdio.h>
#include <string.h>
#include "misc.h"
#include "resource.h"
#include "dix.h"
...
...
nx-X11/programs/Xserver/dix/colormap.c
View file @
a9787fc2
...
...
@@ -52,6 +52,9 @@ SOFTWARE.
#include <nx-X11/X.h>
#include <nx-X11/Xproto.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include "misc.h"
#include "dix.h"
#include "colormapst.h"
...
...
@@ -273,6 +276,13 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
pmap
=
(
ColormapPtr
)
malloc
(
sizebytes
);
if
(
!
pmap
)
return
(
BadAlloc
);
#if defined(_XSERVER64)
pmap
->
pad0
=
0
;
pmap
->
pad1
=
0
;
#if (X_BYTE_ORDER == X_LITTLE_ENDIAN)
pmap
->
pad2
=
0
;
#endif
#endif
pmap
->
red
=
(
EntryPtr
)((
char
*
)
pmap
+
sizeof
(
ColormapRec
));
sizebytes
=
size
*
sizeof
(
Entry
);
pmap
->
clientPixelsRed
=
(
Pixel
**
)((
char
*
)
pmap
->
red
+
sizebytes
);
...
...
nx-X11/programs/Xserver/dix/devices.c
View file @
a9787fc2
...
...
@@ -74,7 +74,7 @@ SOFTWARE.
#include "dixevents.h"
DeviceIntPtr
_
AddInputDevice
(
DeviceProc
deviceProc
,
Bool
autoStart
)
AddInputDevice
(
DeviceProc
deviceProc
,
Bool
autoStart
)
{
register
DeviceIntPtr
dev
;
...
...
@@ -348,7 +348,7 @@ NumMotionEvents()
}
void
_
RegisterPointerDevice
(
DeviceIntPtr
device
)
RegisterPointerDevice
(
DeviceIntPtr
device
)
{
inputInfo
.
pointer
=
device
;
#ifdef XKB
...
...
@@ -371,7 +371,7 @@ _RegisterPointerDevice(DeviceIntPtr device)
}
void
_
RegisterKeyboardDevice
(
DeviceIntPtr
device
)
RegisterKeyboardDevice
(
DeviceIntPtr
device
)
{
inputInfo
.
keyboard
=
device
;
#ifdef XKB
...
...
@@ -1611,38 +1611,3 @@ ProcQueryKeymap(ClientPtr client)
WriteReplyToClient
(
client
,
sizeof
(
xQueryKeymapReply
),
&
rep
);
return
Success
;
}
/******************************************************************************
* The following entrypoints are provided for binary compatibility with
* previous versions (they make casts, where the current version changes types
* for more stringent prototype checking).
******************************************************************************/
#ifdef AddInputDevice
#undef AddInputDevice
DevicePtr
AddInputDevice
(
DeviceProc
deviceProc
,
Bool
autoStart
)
{
return
(
DevicePtr
)
_AddInputDevice
(
deviceProc
,
autoStart
);
}
#endif
/* AddInputDevice */
#ifdef RegisterPointerDevice
#undef RegisterPointerDevice
void
RegisterPointerDevice
(
DevicePtr
device
)
{
_RegisterPointerDevice
((
DeviceIntPtr
)
device
);
}
#endif
/* RegisterPointerDevice */
#ifdef RegisterKeyboardDevice
#undef RegisterKeyboardDevice
void
RegisterKeyboardDevice
(
DevicePtr
device
)
{
_RegisterKeyboardDevice
((
DeviceIntPtr
)
device
);
}
#endif
/* RegisterKeyboardDevice */
nx-X11/programs/Xserver/dix/dispatch.c
View file @
a9787fc2
...
...
@@ -2453,7 +2453,7 @@ ProcCreateColormap(register ClientPtr client)
return
(
result
);
}
client
->
errorValue
=
stuff
->
visual
;
return
(
Bad
Value
);
return
(
Bad
Match
);
}
int
...
...
@@ -3608,6 +3608,10 @@ CloseDownRetainedResources()
}
}
extern
int
clientPrivateLen
;
extern
unsigned
*
clientPrivateSizes
;
extern
unsigned
totalClientSize
;
void
InitClient
(
ClientPtr
client
,
int
i
,
void
*
ospriv
)
{
client
->
index
=
i
;
...
...
@@ -3648,10 +3652,6 @@ void InitClient(ClientPtr client, int i, void * ospriv)
client
->
clientIds
=
NULL
;
}
extern
int
clientPrivateLen
;
extern
unsigned
*
clientPrivateSizes
;
extern
unsigned
totalClientSize
;
#ifndef NXAGENT_SERVER
int
InitClientPrivates
(
ClientPtr
client
)
...
...
@@ -3685,6 +3685,17 @@ InitClientPrivates(ClientPtr client)
else
ppriv
->
ptr
=
(
void
*
)
NULL
;
}
/* Allow registrants to initialize the serverClient devPrivates */
if
(
!
client
->
index
&&
ClientStateCallback
)
{
NewClientInfoRec
clientinfo
;
clientinfo
.
client
=
client
;
clientinfo
.
prefix
=
(
xConnSetupPrefix
*
)
NULL
;
clientinfo
.
setup
=
(
xConnSetup
*
)
NULL
;
CallCallbacks
((
&
ClientStateCallback
),
(
void
*
)
&
clientinfo
);
}
return
1
;
}
#endif
/* NXAGENT_SERVER */
...
...
nx-X11/programs/Xserver/dix/events.c
View file @
a9787fc2
...
...
@@ -2837,9 +2837,6 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
butc
->
buttonsDown
++
;
butc
->
motionMask
=
ButtonMotionMask
;
*
kptr
|=
bit
;
#if !defined(XFree86Server) || !defined(XINPUT)
xE
->
u
.
u
.
detail
=
butc
->
map
[
key
];
#endif
if
(
xE
->
u
.
u
.
detail
==
0
)
return
;
if
(
xE
->
u
.
u
.
detail
<=
5
)
...
...
@@ -2856,9 +2853,6 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
if
(
!
butc
->
buttonsDown
)
butc
->
motionMask
=
0
;
*
kptr
&=
~
bit
;
#if !defined(XFree86Server) || !defined(XINPUT)
xE
->
u
.
u
.
detail
=
butc
->
map
[
key
];
#endif
if
(
xE
->
u
.
u
.
detail
==
0
)
return
;
if
(
xE
->
u
.
u
.
detail
<=
5
)
...
...
@@ -3033,7 +3027,7 @@ EventSuppressForWindow(register WindowPtr pWin, register ClientPtr client,
{
register
int
i
,
free
;
if
(
(
mask
&
~
PropagateMask
)
&&
!
permitOldBugs
)
if
(
mask
&
~
PropagateMask
)
{
client
->
errorValue
=
mask
;
return
BadValue
;
...
...
@@ -3587,7 +3581,7 @@ ProcGrabPointer(ClientPtr client)
client
->
errorValue
=
stuff
->
ownerEvents
;
return
BadValue
;
}
if
(
(
stuff
->
eventMask
&
~
PointerGrabMask
)
&&
!
permitOldBugs
)
if
(
stuff
->
eventMask
&
~
PointerGrabMask
)
{
client
->
errorValue
=
stuff
->
eventMask
;
return
BadValue
;
...
...
@@ -3674,7 +3668,7 @@ ProcChangeActivePointerGrab(ClientPtr client)
TimeStamp
time
;
REQUEST_SIZE_MATCH
(
xChangeActivePointerGrabReq
);
if
(
(
stuff
->
eventMask
&
~
PointerGrabMask
)
&&
!
permitOldBugs
)
if
(
stuff
->
eventMask
&
~
PointerGrabMask
)
{
client
->
errorValue
=
stuff
->
eventMask
;
return
BadValue
;
...
...
@@ -3975,13 +3969,12 @@ ProcSendEvent(ClientPtr client)
if
(
stuff
->
event
.
u
.
u
.
type
==
ClientMessage
&&
stuff
->
event
.
u
.
u
.
detail
!=
8
&&
stuff
->
event
.
u
.
u
.
detail
!=
16
&&
stuff
->
event
.
u
.
u
.
detail
!=
32
&&
!
permitOldBugs
)
stuff
->
event
.
u
.
u
.
detail
!=
32
)
{
client
->
errorValue
=
stuff
->
event
.
u
.
u
.
detail
;
return
BadValue
;
}
if
(
(
stuff
->
eventMask
&
~
AllEventMasks
)
&&
!
permitOldBug
s
)
if
(
stuff
->
eventMask
&
~
AllEventMask
s
)
{
client
->
errorValue
=
stuff
->
eventMask
;
return
BadValue
;
...
...
@@ -4199,12 +4192,10 @@ ProcGrabButton(ClientPtr client)
grab
=
CreateGrab
(
client
->
index
,
inputInfo
.
pointer
,
pWin
,
permitOldBugs
?
(
Mask
)(
stuff
->
eventMask
|
ButtonPressMask
|
ButtonReleaseMask
)
:
(
Mask
)
stuff
->
eventMask
,
(
Bool
)
stuff
->
ownerEvents
,
(
Bool
)
stuff
->
keyboardMode
,
(
Bool
)
stuff
->
pointerMode
,
inputInfo
.
keyboard
,
stuff
->
modifiers
,
ButtonPress
,
stuff
->
button
,
confineTo
,
cursor
);
(
Mask
)
stuff
->
eventMask
,
(
Bool
)
stuff
->
ownerEvents
,
(
Bool
)
stuff
->
keyboardMode
,
(
Bool
)
stuff
->
pointerMode
,
inputInfo
.
keyboard
,
stuff
->
modifiers
,
ButtonPress
,
stuff
->
button
,
confineTo
,
cursor
);
if
(
!
grab
)
return
BadAlloc
;
return
AddPassiveGrabToList
(
grab
);
...
...
nx-X11/programs/Xserver/dix/extension.c
View file @
a9787fc2
...
...
@@ -75,6 +75,39 @@ int lastEvent = EXTENSION_EVENT_BASE;
static
int
lastError
=
FirstExtensionError
;
static
unsigned
int
NumExtensions
=
0
;
extern
int
extensionPrivateLen
;
extern
unsigned
*
extensionPrivateSizes
;
extern
unsigned
totalExtensionSize
;
static
void
InitExtensionPrivates
(
ExtensionEntry
*
ext
)
{
register
char
*
ptr
;
DevUnion
*
ppriv
;
register
unsigned
*
sizes
;
register
unsigned
size
;
register
int
i
;
if
(
totalExtensionSize
==
sizeof
(
ExtensionEntry
))
ppriv
=
(
DevUnion
*
)
NULL
;
else
ppriv
=
(
DevUnion
*
)(
ext
+
1
);
ext
->
devPrivates
=
ppriv
;
sizes
=
extensionPrivateSizes
;
ptr
=
(
char
*
)(
ppriv
+
extensionPrivateLen
);
for
(
i
=
extensionPrivateLen
;
--
i
>=
0
;
ppriv
++
,
sizes
++
)
{
if
(
(
size
=
*
sizes
)
)
{
ppriv
->
ptr
=
(
void
*
)
ptr
;
ptr
+=
size
;
}
else
ppriv
->
ptr
=
(
void
*
)
NULL
;
}
}
ExtensionEntry
*
AddExtension
(
char
*
name
,
int
NumEvents
,
int
NumErrors
,
int
(
*
MainProc
)(
ClientPtr
c1
),
...
...
@@ -91,9 +124,11 @@ AddExtension(char *name, int NumEvents, int NumErrors,
(
unsigned
)(
lastError
+
NumErrors
>
LAST_ERROR
))
return
((
ExtensionEntry
*
)
NULL
);
ext
=
(
ExtensionEntry
*
)
malloc
(
sizeof
(
ExtensionEntry
)
);
ext
=
(
ExtensionEntry
*
)
malloc
(
totalExtensionSize
);
if
(
!
ext
)
return
((
ExtensionEntry
*
)
NULL
);
bzero
(
ext
,
totalExtensionSize
);
InitExtensionPrivates
(
ext
);
ext
->
name
=
(
char
*
)
malloc
(
strlen
(
name
)
+
1
);
ext
->
num_aliases
=
0
;
ext
->
aliases
=
(
char
**
)
NULL
;
...
...
@@ -206,6 +241,20 @@ CheckExtension(const char *extname)
return
NULL
;
}
/*
* Added as part of Xace.
*/
ExtensionEntry
*
GetExtensionEntry
(
int
major
)
{
if
(
major
<
EXTENSION_BASE
)
return
NULL
;
major
-=
EXTENSION_BASE
;
if
(
major
>=
NumExtensions
)
return
NULL
;
return
extensions
[
major
];
}
void
DeclareExtensionSecurity
(
char
*
extname
,
Bool
secure
)
{
...
...
nx-X11/programs/Xserver/dix/ffs.c
View file @
a9787fc2
...
...
@@ -30,6 +30,8 @@ int
ffs
(
int
i
)
{
int
j
;
if
(
i
==
0
)
return
0
;
for
(
j
=
1
;
(
i
&
1
)
==
0
;
j
++
)
i
>>=
1
;
return
j
;
...
...
nx-X11/programs/Xserver/dix/globals.c
View file @
a9787fc2
...
...
@@ -89,7 +89,7 @@ unsigned long serverGeneration = 0;
/* these next four are initialized in main.c */
CARD32
ScreenSaverTime
;
CARD32
ScreenSaverInterval
;
int
ScreenSaverBlanking
;
int
ScreenSaverBlanking
;
int
ScreenSaverAllowExposures
;
#ifdef DPMSExtension
...
...
@@ -103,15 +103,15 @@ int ScreenSaverAllowExposures;
# define DEFAULT_OFF_TIME DEFAULT_SCREEN_SAVER_TIME * 4
# endif
# ifndef DEFAULT_DPMS_ENABLED
# define DEFAULT_DPMS_ENABLED
FALS
E
# define DEFAULT_DPMS_ENABLED
TRU
E
# endif
CARD32
defaultDPMSStandbyTime
=
DEFAULT_STANDBY_TIME
;
CARD32
defaultDPMSSuspendTime
=
DEFAULT_SUSPEND_TIME
;
CARD32
defaultDPMSOffTime
=
DEFAULT_OFF_TIME
;
CARD16
DPMSPowerLevel
=
0
;
Bool
defaultDPMSEnabled
=
DEFAULT_DPMS_ENABLED
;
Bool
DPMSEnabledSwitch
=
FALSE
;
/* these denote the DPMS command line
*/
Bool
DPMSDisabledSwitch
=
FALSE
;
/*
switch states */
Bool
DPMSEnabledSwitch
=
FALSE
;
/* these denote the DPMS command
*/
Bool
DPMSDisabledSwitch
=
FALSE
;
/* line
switch states */
Bool
DPMSCapableFlag
=
FALSE
;
CARD32
DPMSStandbyTime
;
CARD32
DPMSSuspendTime
;
...
...
@@ -140,15 +140,12 @@ FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in
Bool
loadableFonts
=
FALSE
;
CursorPtr
rootCursor
;
Bool
blackRoot
=
FALSE
;
Bool
whiteRoot
=
FALSE
;
ClientPtr
requestingClient
;
/* XXX this should be obsolete now, remove? */
TimeStamp
currentTime
;
TimeStamp
lastDeviceEventTime
;
Bool
permitOldBugs
=
FALSE
;
/* turn off some error checking, to permit certain
* old broken clients (like R2/R3 xterms) to work
*/
int
defaultColorVisualClass
=
-
1
;
int
monitorResolution
=
0
;
...
...
nx-X11/programs/Xserver/dix/main.c
View file @
a9787fc2
...
...
@@ -167,7 +167,7 @@ ReplyNotSwappd(
int
main
(
int
argc
,
char
*
argv
[],
char
*
envp
[])
{
int
i
,
error
;
int
i
;
char
*
xauthfile
;
HWEventQueueType
alwaysCheckForInput
[
2
];
...
...
@@ -263,6 +263,7 @@ main(int argc, char *argv[], char *envp[])
#else
InitGlyphCaching
();
#endif
/* of HAS_XFONT2 */
ResetExtensionPrivates
();
ResetClientPrivates
();
ResetScreenPrivates
();
ResetWindowPrivates
();
...
...
nx-X11/programs/Xserver/dix/pixmap.c
View file @
a9787fc2
...
...
@@ -124,6 +124,7 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize)
* is a quick workaround intended to fix a problem reported
* by Valgrind due to fbBlt() writing just after the end of
* the pixmap buffer. This may be a RENDER bug.
* This is not included in xorg upstream!
*/
pPixmap
=
(
PixmapPtr
)
calloc
(
1
,
pScreen
->
totalPixmapSize
+
pixDataSize
+
4
);
...
...
@@ -146,5 +147,13 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize)
#else
pPixmap
=
(
PixmapPtr
)
calloc
(
1
,
sizeof
(
PixmapRec
)
+
pixDataSize
);
#endif
#ifdef _XSERVER64
if
(
pPixmap
)
{
pPixmap
->
drawable
.
pad0
=
0
;
pPixmap
->
drawable
.
pad1
=
0
;
}
#endif
return
pPixmap
;
}
nx-X11/programs/Xserver/dix/privates.c
View file @
a9787fc2
...
...
@@ -42,6 +42,7 @@ from The Open Group.
#include "servermd.h"
#include "site.h"
#include "inputstr.h"
#include "extnsionst.h"
/*
* See the Wrappers and devPrivates section in "Definition of the
...
...
@@ -50,6 +51,63 @@ from The Open Group.
*/
/*
* extension private machinery
*/
static
int
extensionPrivateCount
;
int
extensionPrivateLen
;
unsigned
*
extensionPrivateSizes
;
unsigned
totalExtensionSize
;
void
ResetExtensionPrivates
()
{
extensionPrivateCount
=
0
;
extensionPrivateLen
=
0
;
free
(
extensionPrivateSizes
);
extensionPrivateSizes
=
(
unsigned
*
)
NULL
;
totalExtensionSize
=
((
sizeof
(
ExtensionEntry
)
+
sizeof
(
long
)
-
1
)
/
sizeof
(
long
))
*
sizeof
(
long
);
}
int
AllocateExtensionPrivateIndex
()
{
return
extensionPrivateCount
++
;
}
Bool
AllocateExtensionPrivate
(
int
index2
,
unsigned
amount
)
{
unsigned
oldamount
;
/* Round up sizes for proper alignment */
amount
=
((
amount
+
(
sizeof
(
long
)
-
1
))
/
sizeof
(
long
))
*
sizeof
(
long
);
if
(
index2
>=
extensionPrivateLen
)
{
unsigned
*
nsizes
;
nsizes
=
(
unsigned
*
)
realloc
(
extensionPrivateSizes
,
(
index2
+
1
)
*
sizeof
(
unsigned
));
if
(
!
nsizes
)
return
FALSE
;
while
(
extensionPrivateLen
<=
index2
)
{
nsizes
[
extensionPrivateLen
++
]
=
0
;
totalExtensionSize
+=
sizeof
(
DevUnion
);
}
extensionPrivateSizes
=
nsizes
;
}
oldamount
=
extensionPrivateSizes
[
index2
];
if
(
amount
>
oldamount
)
{
extensionPrivateSizes
[
index2
]
=
amount
;
totalExtensionSize
+=
(
amount
-
oldamount
);
}
return
TRUE
;
}
/*
* client private machinery
*/
...
...
nx-X11/programs/Xserver/dix/swaprep.c
View file @
a9787fc2
...
...
@@ -354,8 +354,7 @@ SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply *pRep)
WriteToClient
(
pClient
,
size
,
pRep
);
}
static
void
static
void
SwapCharInfo
(
xCharInfo
*
pInfo
)
{
swaps
(
&
pInfo
->
leftSideBearing
);
...
...
@@ -380,8 +379,7 @@ SwapFontInfo(xQueryFontReply *pr)
swapl
(
&
pr
->
nCharInfos
);
}
static
void
static
void
SwapFont
(
xQueryFontReply
*
pr
,
Bool
hasGlyphs
)
{
unsigned
i
;
...
...
nx-X11/programs/Xserver/dix/swapreq.c
View file @
a9787fc2
...
...
@@ -61,7 +61,6 @@ SOFTWARE.
/* Thanks to Jack Palevich for testing and subsequently rewriting all this */
/* Byte swap a list of longs */
void
SwapLongs
(
register
CARD32
*
list
,
register
unsigned
long
count
)
{
...
...
@@ -86,7 +85,6 @@ SwapLongs (register CARD32 *list, register unsigned long count)
}
/* Byte swap a list of shorts */
void
SwapShorts
(
register
short
*
list
,
register
unsigned
long
count
)
{
...
...
nx-X11/programs/Xserver/dix/window.c
View file @
a9787fc2
/*
Copyright (c) 2006, Red Hat, Inc.
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
RED HAT 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 Red Hat shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Red Hat.
Copyright 1987, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
...
...
@@ -320,9 +342,6 @@ MakeRootTile(WindowPtr pWin)
for
(
j
=
len
;
j
>
0
;
j
--
)
*
to
++
=
*
from
;
if
(
blackRoot
)
bzero
(
back
,
sizeof
(
back
));
(
*
pGC
->
ops
->
PutImage
)((
DrawablePtr
)
pWin
->
background
.
pixmap
,
pGC
,
1
,
0
,
0
,
len
,
4
,
0
,
XYBitmap
,
(
char
*
)
back
);
...
...
@@ -358,6 +377,10 @@ AllocateWindow(ScreenPtr pScreen)
else
ppriv
->
ptr
=
(
void
*
)
NULL
;
}
#if _XSERVER64
pWin
->
drawable
.
pad0
=
0
;
pWin
->
drawable
.
pad1
=
0
;
#endif
}
return
pWin
;
}
...
...
@@ -481,6 +504,7 @@ void
InitRootWindow
(
WindowPtr
pWin
)
{
ScreenPtr
pScreen
=
pWin
->
drawable
.
pScreen
;
int
backFlag
=
CWBorderPixel
|
CWCursor
|
CWBackingStore
;
if
(
!
(
*
pScreen
->
CreateWindow
)(
pWin
))
return
;
/* XXX */
...
...
@@ -489,12 +513,23 @@ InitRootWindow(WindowPtr pWin)
pWin
->
cursorIsNone
=
FALSE
;
pWin
->
optional
->
cursor
=
rootCursor
;
rootCursor
->
refcnt
++
;
MakeRootTile
(
pWin
);
if
(
!
blackRoot
&&
!
whiteRoot
)
{
MakeRootTile
(
pWin
);
backFlag
|=
CWBackPixmap
;
}
else
{
if
(
blackRoot
)
pWin
->
background
.
pixel
=
pScreen
->
blackPixel
;
else
pWin
->
background
.
pixel
=
pScreen
->
whitePixel
;
backFlag
|=
CWBackPixel
;
}
pWin
->
backingStore
=
defaultBackingStore
;
pWin
->
forcedBS
=
(
defaultBackingStore
!=
NotUseful
);
/* We SHOULD check for an error value here XXX */
(
*
pScreen
->
ChangeWindowAttributes
)(
pWin
,
CWBackPixmap
|
CWBorderPixel
|
CWCursor
|
CWBackingStore
);
(
*
pScreen
->
ChangeWindowAttributes
)(
pWin
,
backFlag
);
MapWindow
(
pWin
,
serverClient
);
}
...
...
@@ -2059,7 +2094,7 @@ WhereDoIGoInTheStack(
else
return
NullWindow
;
case
TopIf
:
if
((
!
pWin
->
mapped
||
(
pSib
&&
!
pSib
->
mapped
))
&&
!
permitOldBugs
)
if
((
!
pWin
->
mapped
||
(
pSib
&&
!
pSib
->
mapped
)))
return
(
pWin
->
nextSib
);
else
if
(
pSib
)
{
...
...
@@ -2074,7 +2109,7 @@ WhereDoIGoInTheStack(
else
return
(
pWin
->
nextSib
);
case
BottomIf
:
if
((
!
pWin
->
mapped
||
(
pSib
&&
!
pSib
->
mapped
))
&&
!
permitOldBugs
)
if
((
!
pWin
->
mapped
||
(
pSib
&&
!
pSib
->
mapped
)))
return
(
pWin
->
nextSib
);
else
if
(
pSib
)
{
...
...
@@ -2089,7 +2124,7 @@ WhereDoIGoInTheStack(
else
return
(
pWin
->
nextSib
);
case
Opposite
:
if
((
!
pWin
->
mapped
||
(
pSib
&&
!
pSib
->
mapped
))
&&
!
permitOldBugs
)
if
((
!
pWin
->
mapped
||
(
pSib
&&
!
pSib
->
mapped
)))
return
(
pWin
->
nextSib
);
else
if
(
pSib
)
{
...
...
@@ -2709,7 +2744,7 @@ MapWindow(register WindowPtr pWin, ClientPtr client)
}
pWin
->
mapped
=
TRUE
;
if
(
SubStrSend
(
pWin
,
pParent
))
if
(
SubStrSend
(
pWin
,
pParent
)
&&
MapUnmapEventsEnabled
(
pWin
)
)
{
memset
(
&
event
,
0
,
sizeof
(
xEvent
));
event
.
u
.
u
.
type
=
MapNotify
;
...
...
@@ -2968,7 +3003,7 @@ UnmapWindow(register WindowPtr pWin, Bool fromConfigure)
if
((
!
pWin
->
mapped
)
||
(
!
(
pParent
=
pWin
->
parent
)))
return
(
Success
);
if
(
SubStrSend
(
pWin
,
pParent
))
if
(
SubStrSend
(
pWin
,
pParent
)
&&
MapUnmapEventsEnabled
(
pWin
)
)
{
memset
(
&
event
,
0
,
sizeof
(
xEvent
));
event
.
u
.
u
.
type
=
UnmapNotify
;
...
...
@@ -3271,6 +3306,29 @@ SendVisibilityNotify(WindowPtr pWin)
DeliverEvents
(
pWin
,
&
event
,
1
,
NullWindow
);
}
static
WindowPtr
windowDisableMapUnmapEvents
;
void
DisableMapUnmapEvents
(
WindowPtr
pWin
)
{
assert
(
windowDisableMapUnmapEvents
==
NULL
);
windowDisableMapUnmapEvents
=
pWin
;
}
void
EnableMapUnmapEvents
(
WindowPtr
pWin
)
{
assert
(
windowDisableMapUnmapEvents
!=
NULL
);
windowDisableMapUnmapEvents
=
NULL
;
}
Bool
MapUnmapEventsEnabled
(
WindowPtr
pWin
)
{
return
pWin
!=
windowDisableMapUnmapEvents
;
}
#define RANDOM_WIDTH 32
...
...
nx-X11/programs/Xserver/dix/xpstubs.c
View file @
a9787fc2
...
...
@@ -31,6 +31,8 @@ from The Open Group.
#include "misc.h"
#include <X11/fonts/font.h>
extern
Bool
XpClientIsBitmapClient
(
ClientPtr
client
);
extern
Bool
XpClientIsPrintClient
(
ClientPtr
client
,
FontPathElementPtr
fpe
);
Bool
XpClientIsBitmapClient
(
...
...
nx-X11/programs/Xserver/hw/nxagent/NXevents.c
View file @
a9787fc2
...
...
@@ -547,13 +547,12 @@ ProcSendEvent(ClientPtr client)
if
(
stuff
->
event
.
u
.
u
.
type
==
ClientMessage
&&
stuff
->
event
.
u
.
u
.
detail
!=
8
&&
stuff
->
event
.
u
.
u
.
detail
!=
16
&&
stuff
->
event
.
u
.
u
.
detail
!=
32
&&
!
permitOldBugs
)
stuff
->
event
.
u
.
u
.
detail
!=
32
)
{
client
->
errorValue
=
stuff
->
event
.
u
.
u
.
detail
;
return
BadValue
;
}
if
(
(
stuff
->
eventMask
&
~
AllEventMasks
)
&&
!
permitOldBug
s
)
if
(
stuff
->
eventMask
&
~
AllEventMask
s
)
{
client
->
errorValue
=
stuff
->
eventMask
;
return
BadValue
;
...
...
nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
View file @
a9787fc2
...
...
@@ -208,14 +208,11 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
Bool
sendevent
)
{
PropertyPtr
pProp
;
xEvent
event
;
int
sizeInBytes
;
int
totalSize
;
void
*
data
;
int
copySize
;
memset
(
&
event
,
0
,
sizeof
(
xEvent
));
sizeInBytes
=
format
>>
3
;
totalSize
=
len
*
sizeInBytes
;
...
...
@@ -278,7 +275,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
{
if
(
totalSize
!=
pProp
->
size
*
(
pProp
->
format
>>
3
))
{
data
=
(
void
*
)
realloc
(
pProp
->
data
,
totalSize
);
data
=
(
void
*
)
realloc
(
pProp
->
data
,
totalSize
);
if
(
!
data
&&
len
)
return
(
BadAlloc
);
pProp
->
data
=
data
;
...
...
@@ -320,6 +317,8 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
}
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
;
...
...
@@ -350,7 +349,6 @@ ProcGetProperty(ClientPtr client)
REQUEST
(
xGetPropertyReq
);
REQUEST_SIZE_MATCH
(
xGetPropertyReq
);
if
(
stuff
->
delete
)
UpdateCurrentTime
();
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
...
...
nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
View file @
a9787fc2
...
...
@@ -138,9 +138,7 @@ extern void nxagentSetVersionProperty(WindowPtr pWin);
void
nxagentClearSplash
(
WindowPtr
pW
)
{
ScreenPtr
pScreen
;
pScreen
=
pW
->
drawable
.
pScreen
;
ScreenPtr
pScreen
=
pW
->
drawable
.
pScreen
;
if
(
pW
->
backgroundState
==
BackgroundPixmap
)
{
...
...
@@ -189,9 +187,6 @@ MakeRootTile(WindowPtr pWin)
for
(
j
=
len
;
j
>
0
;
j
--
)
*
to
++
=
*
from
;
if
(
blackRoot
)
bzero
(
back
,
sizeof
(
back
));
(
*
pGC
->
ops
->
PutImage
)((
DrawablePtr
)
pWin
->
background
.
pixmap
,
pGC
,
1
,
0
,
0
,
len
,
4
,
0
,
XYBitmap
,
(
char
*
)
back
);
...
...
@@ -203,7 +198,8 @@ MakeRootTile(WindowPtr pWin)
void
InitRootWindow
(
WindowPtr
pWin
)
{
ScreenPtr
pScreen
;
ScreenPtr
pScreen
=
pWin
->
drawable
.
pScreen
;
int
backFlag
=
CWBorderPixel
|
CWCursor
|
CWBackingStore
;
#ifdef TEST
fprintf
(
stderr
,
"InitRootWindow: Called for window at [%p][%ld] with parent [%p].
\n
"
,
...
...
@@ -220,8 +216,6 @@ InitRootWindow(WindowPtr pWin)
nxagentRootlessWindow
=
pWin
;
}
pScreen
=
pWin
->
drawable
.
pScreen
;
/*
* A root window is created for each screen by main
* and the pointer is saved in screenInfo.screens as
...
...
@@ -254,20 +248,34 @@ InitRootWindow(WindowPtr pWin)
pWin
->
cursorIsNone
=
FALSE
;
pWin
->
optional
->
cursor
=
rootCursor
;
rootCursor
->
refcnt
++
;
#ifdef NXAGENT_SPLASH
if
(
blackRoot
)
pWin
->
background
.
pixel
=
pScreen
->
blackPixel
;
else
pWin
->
background
.
pixel
=
pScreen
->
whitePixel
;
backFlag
|=
CWBackPixel
;
MakeRootTile
(
pWin
);
#else
if
(
!
blackRoot
&&
!
whiteRoot
)
{
MakeRootTile
(
pWin
);
backFlag
|=
CWBackPixmap
;
}
else
{
if
(
blackRoot
)
pWin
->
background
.
pixel
=
pScreen
->
blackPixel
;
else
pWin
->
background
.
pixel
=
pScreen
->
whitePixel
;
backFlag
|=
CWBackPixel
;
}
#endif
pWin
->
backingStore
=
defaultBackingStore
;
pWin
->
forcedBS
=
(
defaultBackingStore
!=
NotUseful
);
#ifdef NXAGENT_SPLASH
/* We SHOULD check for an error value here XXX */
pWin
->
background
.
pixel
=
pScreen
->
blackPixel
;
(
*
pScreen
->
ChangeWindowAttributes
)(
pWin
,
CWBackPixel
|
CWBorderPixel
|
CWCursor
|
CWBackingStore
);
#else
(
*
pScreen
->
ChangeWindowAttributes
)(
pWin
,
CWBackPixmap
|
CWBorderPixel
|
CWCursor
|
CWBackingStore
);
#endif
MakeRootTile
(
pWin
);
(
*
pScreen
->
ChangeWindowAttributes
)(
pWin
,
backFlag
);
/*
* Map both the root and the default agent window.
...
...
@@ -310,6 +318,7 @@ DeleteWindow(void * value, XID wid)
{
register
WindowPtr
pParent
;
register
WindowPtr
pWin
=
(
WindowPtr
)
value
;
xEvent
event
;
UnmapWindow
(
pWin
,
FALSE
);
...
...
@@ -318,7 +327,7 @@ DeleteWindow(void * value, XID wid)
pParent
=
pWin
->
parent
;
if
(
wid
&&
pParent
&&
SubStrSend
(
pWin
,
pParent
))
{
xEvent
event
=
{
0
}
;
memset
(
&
event
,
0
,
sizeof
(
xEvent
))
;
event
.
u
.
u
.
type
=
DestroyNotify
;
event
.
u
.
destroyNotify
.
window
=
pWin
->
drawable
.
id
;
DeliverEvents
(
pWin
,
&
event
,
1
,
NullWindow
);
...
...
@@ -874,7 +883,7 @@ MapWindow(register WindowPtr pWin, ClientPtr client)
}
pWin
->
mapped
=
TRUE
;
if
(
SubStrSend
(
pWin
,
pParent
))
if
(
SubStrSend
(
pWin
,
pParent
)
&&
MapUnmapEventsEnabled
(
pWin
)
)
{
memset
(
&
event
,
0
,
sizeof
(
xEvent
));
event
.
u
.
u
.
type
=
MapNotify
;
...
...
@@ -945,6 +954,7 @@ int
UnmapWindow
(
register
WindowPtr
pWin
,
Bool
fromConfigure
)
{
register
WindowPtr
pParent
;
xEvent
event
;
Bool
wasRealized
=
(
Bool
)
pWin
->
realized
;
Bool
wasViewable
=
(
Bool
)
pWin
->
viewable
;
ScreenPtr
pScreen
=
pWin
->
drawable
.
pScreen
;
...
...
@@ -960,9 +970,9 @@ UnmapWindow(register WindowPtr pWin, Bool fromConfigure)
if
((
!
pWin
->
mapped
)
||
(
!
(
pParent
=
pWin
->
parent
)))
return
(
Success
);
if
(
SubStrSend
(
pWin
,
pParent
))
if
(
SubStrSend
(
pWin
,
pParent
)
&&
MapUnmapEventsEnabled
(
pWin
)
)
{
xEvent
event
=
{
0
}
;
memset
(
&
event
,
0
,
sizeof
(
xEvent
))
;
event
.
u
.
u
.
type
=
UnmapNotify
;
event
.
u
.
unmapNotify
.
window
=
pWin
->
drawable
.
id
;
event
.
u
.
unmapNotify
.
fromConfigure
=
fromConfigure
;
...
...
nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1
View file @
a9787fc2
...
...
@@ -139,11 +139,6 @@ specifies a file which contains a collection of authorization records used
to authenticate access. See also the \fIxdm\fP(1) and
\fIXsecurity\fP(__miscmansuffix__) manual pages.
.TP 8
.B bc
disables certain kinds of error checking, for bug compatibility with
previous releases (e.g., to work around bugs in R2 and R3 xterms and toolkits).
Deprecated.
.TP 8
.B \-bs
disables backing store support on all screens.
.TP 8
...
...
nx-X11/programs/Xserver/include/colormapst.h
View file @
a9787fc2
...
...
@@ -48,6 +48,8 @@ SOFTWARE.
#ifndef CMAPSTRUCT_H
#define CMAPSTRUCT_H 1
#include <nx-X11/Xarch.h>
#include "colormap.h"
#include "screenint.h"
...
...
@@ -88,15 +90,26 @@ typedef struct _CMEntry
Bool
fShared
;
}
Entry
;
/* COLORMAPs can be used for either Direct or Pseudo color. PseudoColor
/*
* COLORMAPs can be used for either Direct or Pseudo color. PseudoColor
* only needs one cell table, we arbitrarily pick red. We keep track
* of that table with freeRed, numPixelsRed, and clientPixelsRed */
* of that table with freeRed, numPixelsRed, and clientPixelsRed
*
* The padN variables are unfortunate ABI BC. See fdo bug #6924.
*/
typedef
struct
_ColormapRec
{
VisualPtr
pVisual
;
short
class
;
/* PseudoColor or DirectColor */
long
mid
;
/* client's name for colormap */
#if defined(_XSERVER64)
short
pad0
;
XID
pad1
;
#endif
XID
mid
;
/* client's name for colormap */
#if defined(_XSERVER64) && (X_BYTE_ORDER == X_LITTLE_ENDIAN)
XID
pad2
;
#endif
ScreenPtr
pScreen
;
/* screen map is associated with */
short
flags
;
/* 1 = IsDefault
* 2 = AllAllocated */
...
...
nx-X11/programs/Xserver/include/extension.h
View file @
a9787fc2
...
...
@@ -54,6 +54,18 @@ extern unsigned short StandardMinorOpcode(ClientPtr /*client*/);
extern
unsigned
short
MinorOpcodeOfRequest
(
ClientPtr
/*client*/
);
extern
Bool
EnableDisableExtension
(
char
*
name
,
Bool
enable
);
extern
void
EnableDisableExtensionError
(
char
*
name
,
Bool
enable
);
extern
void
ResetExtensionPrivates
(
void
);
extern
int
AllocateExtensionPrivateIndex
(
void
);
extern
Bool
AllocateExtensionPrivate
(
int
/*index*/
,
unsigned
/*amount*/
);
extern
void
InitExtensions
(
int
argc
,
char
**
argv
);
extern
void
InitVisualWrap
(
void
);
...
...
nx-X11/programs/Xserver/include/extnsionst.h
View file @
a9787fc2
...
...
@@ -48,6 +48,7 @@ SOFTWARE.
#ifndef EXTENSIONSTRUCT_H
#define EXTENSIONSTRUCT_H
#include "dix.h"
#include "misc.h"
#include "screenint.h"
#include "extension.h"
...
...
@@ -71,6 +72,7 @@ typedef struct _ExtensionEntry {
#ifdef XCSECURITY
Bool
secure
;
/* extension visible to untrusted clients? */
#endif
DevUnion
*
devPrivates
;
}
ExtensionEntry
;
/*
...
...
@@ -127,6 +129,7 @@ extern Bool AddExtensionAlias(
ExtensionEntry
*
/*extension*/
);
extern
ExtensionEntry
*
CheckExtension
(
const
char
*
extname
);
extern
ExtensionEntry
*
GetExtensionEntry
(
int
major
);
extern
ExtensionLookupProc
LookupProc
(
char
*
/*name*/
,
...
...
nx-X11/programs/Xserver/include/opaque.h
View file @
a9787fc2
...
...
@@ -72,10 +72,10 @@ extern int limitStackSpace;
#ifdef RLIMIT_NOFILE
extern
int
limitNoFile
;
#endif
extern
Bool
permitOldBugs
;
extern
Bool
defeatAccessControl
;
extern
long
maxBigRequestSize
;
extern
Bool
blackRoot
;
extern
Bool
whiteRoot
;
extern
Bool
CoreDump
;
extern
Bool
NoListenAll
;
...
...
nx-X11/programs/Xserver/include/pixmapstr.h
View file @
a9787fc2
...
...
@@ -47,16 +47,27 @@ SOFTWARE.
#ifndef PIXMAPSTRUCT_H
#define PIXMAPSTRUCT_H
#include <nx-X11/Xarch.h>
#include "pixmap.h"
#include "screenint.h"
#include "regionstr.h"
/*
* The padN members are unfortunate ABI BC. See fdo bug #6924.
*/
typedef
struct
_Drawable
{
unsigned
char
type
;
/* DRAWABLE_<type> */
unsigned
char
class
;
/* specific to type */
unsigned
char
depth
;
unsigned
char
bitsPerPixel
;
unsigned
long
id
;
/* resource id */
#if defined(_XSERVER64)
XID
pad0
;
#endif
XID
id
;
/* resource id */
#if defined(_XSERVER64)
XID
pad1
;
#endif
short
x
;
/* window: screen absolute, pixmap: 0 */
short
y
;
/* window: screen absolute, pixmap: 0 */
unsigned
short
width
;
...
...
nx-X11/programs/Xserver/include/window.h
View file @
a9787fc2
...
...
@@ -264,4 +264,11 @@ extern RegionPtr CreateBoundingShape(
extern
RegionPtr
CreateClipShape
(
WindowPtr
/* pWin */
);
extern
void
DisableMapUnmapEvents
(
WindowPtr
/* pWin */
);
extern
void
EnableMapUnmapEvents
(
WindowPtr
/* pWin */
);
extern
Bool
MapUnmapEventsEnabled
(
WindowPtr
/* pWin */
);
#endif
/* WINDOW_H */
nx-X11/programs/Xserver/os/utils.c
View file @
a9787fc2
...
...
@@ -753,8 +753,6 @@ ProcessCommandLine(int argc, char *argv[])
else
UseMsg
();
}
else
if
(
strcmp
(
argv
[
i
],
"bc"
)
==
0
)
permitOldBugs
=
TRUE
;
else
if
(
strcmp
(
argv
[
i
],
"-br"
)
==
0
)
blackRoot
=
TRUE
;
else
if
(
strcmp
(
argv
[
i
],
"+bs"
)
==
0
)
...
...
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