Compare commits
6 Commits
master
...
wip/dixget
Author | SHA1 | Date | |
---|---|---|---|
|
65ca0f6a4f | ||
|
26b3537499 | ||
|
27364a0cc5 | ||
|
658d811257 | ||
|
922a22b6ef | ||
|
a750176ce7 |
|
@ -261,10 +261,9 @@ ProcSELinuxGetPropertyContext(ClientPtr client, void *privKey)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rc = dixLookupProperty(&pProp, pWin, stuff->property, client,
|
pProp = dixLookupProperty(pWin, stuff->property, client, DixGetAttrAccess);
|
||||||
DixGetAttrAccess);
|
if (!pProp)
|
||||||
if (rc != Success)
|
return BadMatch;
|
||||||
return rc;
|
|
||||||
|
|
||||||
obj = dixLookupPrivate(&pProp->devPrivates, privKey);
|
obj = dixLookupPrivate(&pProp->devPrivates, privKey);
|
||||||
return SELinuxSendContextReply(client, obj->sid);
|
return SELinuxSendContextReply(client, obj->sid);
|
||||||
|
|
|
@ -689,4 +689,6 @@ static inline ClientPtr dixLookupXIDOwner(XID xid)
|
||||||
return NullClient;
|
return NullClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dixFreeAllScreens(void);
|
||||||
|
|
||||||
#endif /* _XSERVER_DIX_PRIV_H */
|
#endif /* _XSERVER_DIX_PRIV_H */
|
||||||
|
|
14
dix/main.c
14
dix/main.c
|
@ -317,20 +317,8 @@ dix_main(int argc, char *argv[], char *envp[])
|
||||||
screenInfo.screens[i]->root = NullWindow;
|
screenInfo.screens[i]->root = NullWindow;
|
||||||
|
|
||||||
CloseDownDevices();
|
CloseDownDevices();
|
||||||
|
|
||||||
CloseDownEvents();
|
CloseDownEvents();
|
||||||
|
dixFreeAllScreens();
|
||||||
for (i = screenInfo.numGPUScreens - 1; i >= 0; i--) {
|
|
||||||
dixFreeScreen(screenInfo.gpuscreens[i]);
|
|
||||||
screenInfo.numGPUScreens = i;
|
|
||||||
}
|
|
||||||
memset(&screenInfo.numGPUScreens, 0, sizeof(screenInfo.numGPUScreens));
|
|
||||||
|
|
||||||
for (i = screenInfo.numScreens - 1; i >= 0; i--) {
|
|
||||||
dixFreeScreen(screenInfo.screens[i]);
|
|
||||||
screenInfo.numScreens = i;
|
|
||||||
}
|
|
||||||
memset(&screenInfo.screens, 0, sizeof(screenInfo.numGPUScreens));
|
|
||||||
|
|
||||||
ReleaseClientIds(serverClient);
|
ReleaseClientIds(serverClient);
|
||||||
dixFreePrivates(serverClient->devPrivates, PRIVATE_CLIENT);
|
dixFreePrivates(serverClient->devPrivates, PRIVATE_CLIENT);
|
||||||
|
|
|
@ -92,23 +92,22 @@ PrintPropertys(WindowPtr pWin)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
PropertyPtr dixLookupProperty(WindowPtr pWin, Atom propertyName,
|
||||||
dixLookupProperty(PropertyPtr *result, WindowPtr pWin, Atom propertyName,
|
ClientPtr client, Mask access_mode)
|
||||||
ClientPtr client, Mask access_mode)
|
|
||||||
{
|
{
|
||||||
PropertyPtr pProp;
|
PropertyPtr pProp;
|
||||||
int rc = BadMatch;
|
int rc = BadMatch;
|
||||||
|
|
||||||
client->errorValue = propertyName;
|
client->errorValue = propertyName;
|
||||||
|
|
||||||
for (pProp = pWin->properties; pProp; pProp = pProp->next)
|
for (pProp = wUserProps(pWin); pProp; pProp = pProp->next)
|
||||||
if (pProp->propertyName == propertyName)
|
if (pProp->propertyName == propertyName) {
|
||||||
break;
|
if (XaceHookPropertyAccess(client, pWin, &pProp, access_mode) != Success)
|
||||||
|
return NULL;
|
||||||
|
return pProp;
|
||||||
|
}
|
||||||
|
|
||||||
if (pProp)
|
return NULL;
|
||||||
rc = XaceHookPropertyAccess(client, pWin, &pProp, access_mode);
|
|
||||||
*result = pProp;
|
|
||||||
return rc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -223,6 +222,7 @@ ProcRotateProperties(ClientPtr client)
|
||||||
|
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
props[i] = pProp;
|
props[i] = pProp;
|
||||||
saved[i] = *pProp;
|
saved[i] = *pProp;
|
||||||
|
@ -333,7 +333,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
|
||||||
access_mode = (mode == PropModeReplace) ? DixWriteAccess : DixBlendAccess;
|
access_mode = (mode == PropModeReplace) ? DixWriteAccess : DixBlendAccess;
|
||||||
|
|
||||||
/* first see if property already exists */
|
/* first see if property already exists */
|
||||||
rc = dixLookupProperty(&pProp, pWin, property, pClient, access_mode);
|
pProp = dixLookupProperty(pWin, property, pClient, access_mode);
|
||||||
|
|
||||||
if (rc == BadMatch) { /* just add to list */
|
if (rc == BadMatch) { /* just add to list */
|
||||||
if (!MakeWindowOptional(pWin))
|
if (!MakeWindowOptional(pWin))
|
||||||
|
@ -365,7 +365,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
|
||||||
pProp->next = pWin->properties;
|
pProp->next = pWin->properties;
|
||||||
pWin->properties = pProp;
|
pWin->properties = pProp;
|
||||||
}
|
}
|
||||||
else if (rc == Success) {
|
else {
|
||||||
/* To append or prepend to a property the request format and type
|
/* To append or prepend to a property the request format and type
|
||||||
must match those of the already defined property. The
|
must match those of the already defined property. The
|
||||||
existing format and type are irrelevant when using the mode
|
existing format and type are irrelevant when using the mode
|
||||||
|
@ -427,8 +427,6 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
return rc;
|
|
||||||
|
|
||||||
if (sendevent) {
|
if (sendevent) {
|
||||||
deliverPropertyNotifyEvent(pWin, PropertyNewValue, pProp);
|
deliverPropertyNotifyEvent(pWin, PropertyNewValue, pProp);
|
||||||
|
@ -444,8 +442,8 @@ DeleteProperty(ClientPtr client, WindowPtr pWin, Atom propName)
|
||||||
PropertyPtr pProp, prevProp;
|
PropertyPtr pProp, prevProp;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
rc = dixLookupProperty(&pProp, pWin, propName, client, DixDestroyAccess);
|
pProp = dixLookupProperty(pWin, propName, client, DixDestroyAccess);
|
||||||
if (rc == BadMatch)
|
if (!pProp)
|
||||||
return Success; /* Succeed if property does not exist */
|
return Success; /* Succeed if property does not exist */
|
||||||
|
|
||||||
if (rc == Success) {
|
if (rc == Success) {
|
||||||
|
@ -467,7 +465,19 @@ DeleteProperty(ClientPtr client, WindowPtr pWin, Atom propName)
|
||||||
free(pProp->data);
|
free(pProp->data);
|
||||||
dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY);
|
dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY);
|
||||||
}
|
}
|
||||||
return rc;
|
else {
|
||||||
|
/* Need to traverse to find the previous element */
|
||||||
|
prevProp = pWin->optional->userProps;
|
||||||
|
while (prevProp->next != pProp)
|
||||||
|
prevProp = prevProp->next;
|
||||||
|
prevProp->next = pProp->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp);
|
||||||
|
free(pProp->data);
|
||||||
|
dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY);
|
||||||
|
|
||||||
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -94,8 +94,8 @@ typedef struct _PropertyFilterParam {
|
||||||
|
|
||||||
extern CallbackListPtr PropertyFilterCallback;
|
extern CallbackListPtr PropertyFilterCallback;
|
||||||
|
|
||||||
int dixLookupProperty(PropertyPtr *result, WindowPtr pWin, Atom proprty,
|
PropertyPtr dixLookupProperty(WindowPtr pWin, Atom proprty,
|
||||||
ClientPtr pClient, Mask access_mode);
|
ClientPtr pClient, Mask access_mode);
|
||||||
|
|
||||||
void DeleteAllWindowProperties(WindowPtr pWin);
|
void DeleteAllWindowProperties(WindowPtr pWin);
|
||||||
|
|
||||||
|
|
17
dix/screen.c
17
dix/screen.c
|
@ -10,7 +10,7 @@
|
||||||
#include "include/screenint.h"
|
#include "include/screenint.h"
|
||||||
#include "include/scrnintstr.h"
|
#include "include/scrnintstr.h"
|
||||||
|
|
||||||
void dixFreeScreen(ScreenPtr pScreen)
|
static void dixFreeScreen(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
if (!pScreen)
|
if (!pScreen)
|
||||||
return;
|
return;
|
||||||
|
@ -27,3 +27,18 @@ void dixFreeScreen(ScreenPtr pScreen)
|
||||||
DeleteCallbackList(&pScreen->hookPixmapDestroy);
|
DeleteCallbackList(&pScreen->hookPixmapDestroy);
|
||||||
free(pScreen);
|
free(pScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dixFreeAllScreens(void)
|
||||||
|
{
|
||||||
|
for (int i = screenInfo.numGPUScreens - 1; i >= 0; i--) {
|
||||||
|
dixFreeScreen(screenInfo.gpuscreens[i]);
|
||||||
|
screenInfo.numGPUScreens = i;
|
||||||
|
}
|
||||||
|
memset(&screenInfo.numGPUScreens, 0, sizeof(screenInfo.numGPUScreens));
|
||||||
|
|
||||||
|
for (int i = screenInfo.numScreens - 1; i >= 0; i--) {
|
||||||
|
dixFreeScreen(screenInfo.screens[i]);
|
||||||
|
screenInfo.numScreens = i;
|
||||||
|
}
|
||||||
|
memset(&screenInfo.screens, 0, sizeof(screenInfo.numGPUScreens));
|
||||||
|
}
|
||||||
|
|
|
@ -370,6 +370,23 @@ ddxProcessArgument(int argc, char **argv, int i)
|
||||||
return KdProcessArgument(argc, argv, i);
|
return KdProcessArgument(argc, argv, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
EphyrInit(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* make sure at least one screen
|
||||||
|
* has been added to the system.
|
||||||
|
*/
|
||||||
|
if (!KdCardInfoLast()) {
|
||||||
|
processScreenArg("640x480", NULL);
|
||||||
|
}
|
||||||
|
return hostx_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
KdOsFuncs EphyrOsFuncs = {
|
||||||
|
.Init = EphyrInit,
|
||||||
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
OsVendorInit(void)
|
OsVendorInit(void)
|
||||||
{
|
{
|
||||||
|
@ -381,12 +398,7 @@ OsVendorInit(void)
|
||||||
if (hostx_want_host_cursor())
|
if (hostx_want_host_cursor())
|
||||||
ephyrFuncs.initCursor = &ephyrCursorInit;
|
ephyrFuncs.initCursor = &ephyrCursorInit;
|
||||||
|
|
||||||
if (serverGeneration == 1) {
|
KdOsInit(&EphyrOsFuncs);
|
||||||
if (!KdCardInfoLast()) {
|
|
||||||
processScreenArg("640x480", NULL);
|
|
||||||
}
|
|
||||||
hostx_init();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
KdCardFuncs ephyrFuncs = {
|
KdCardFuncs ephyrFuncs = {
|
||||||
|
|
|
@ -91,6 +91,14 @@ const char *kdGlobalXkbLayout = NULL;
|
||||||
const char *kdGlobalXkbVariant = NULL;
|
const char *kdGlobalXkbVariant = NULL;
|
||||||
const char *kdGlobalXkbOptions = NULL;
|
const char *kdGlobalXkbOptions = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Carry arguments from InitOutput through driver initialization
|
||||||
|
* to KdScreenInit
|
||||||
|
*/
|
||||||
|
|
||||||
|
KdOsFuncs *kdOsFuncs = NULL;
|
||||||
|
|
||||||
void
|
void
|
||||||
KdDisableScreen(ScreenPtr pScreen)
|
KdDisableScreen(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
|
@ -517,6 +525,19 @@ KdProcessArgument(int argc, char **argv, int i)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
KdOsInit(KdOsFuncs * pOsFuncs)
|
||||||
|
{
|
||||||
|
kdOsFuncs = pOsFuncs;
|
||||||
|
if (pOsFuncs) {
|
||||||
|
if (serverGeneration == 1) {
|
||||||
|
KdDoSwitchCmd("start");
|
||||||
|
if (pOsFuncs->Init)
|
||||||
|
(*pOsFuncs->Init) ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
KdAllocatePrivates(ScreenPtr pScreen)
|
KdAllocatePrivates(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
|
|
|
@ -278,6 +278,16 @@ int KdAddConfigKeyboard(char *pointer);
|
||||||
int KdAddKeyboard(KdKeyboardInfo * ki);
|
int KdAddKeyboard(KdKeyboardInfo * ki);
|
||||||
void KdRemoveKeyboard(KdKeyboardInfo * ki);
|
void KdRemoveKeyboard(KdKeyboardInfo * ki);
|
||||||
|
|
||||||
|
typedef struct _KdOsFuncs {
|
||||||
|
int (*Init) (void); /* Only called when the X server is started, when serverGeneration == 1 */
|
||||||
|
void (*Enable) (void);
|
||||||
|
Bool (*SpecialKey) (KeySym);
|
||||||
|
void (*Disable) (void);
|
||||||
|
void (*Fini) (void);
|
||||||
|
void (*pollEvents) (void);
|
||||||
|
void (*Bell) (int, int, int);
|
||||||
|
} KdOsFuncs;
|
||||||
|
|
||||||
typedef struct _KdPointerMatrix {
|
typedef struct _KdPointerMatrix {
|
||||||
int matrix[2][3];
|
int matrix[2][3];
|
||||||
} KdPointerMatrix;
|
} KdPointerMatrix;
|
||||||
|
@ -289,6 +299,8 @@ extern DevPrivateKeyRec kdScreenPrivateKeyRec;
|
||||||
extern Bool kdEmulateMiddleButton;
|
extern Bool kdEmulateMiddleButton;
|
||||||
extern Bool kdDisableZaphod;
|
extern Bool kdDisableZaphod;
|
||||||
|
|
||||||
|
extern KdOsFuncs *kdOsFuncs;
|
||||||
|
|
||||||
#define KdGetScreenPriv(pScreen) ((KdPrivScreenPtr) \
|
#define KdGetScreenPriv(pScreen) ((KdPrivScreenPtr) \
|
||||||
dixLookupPrivate(&(pScreen)->devPrivates, kdScreenPrivateKey))
|
dixLookupPrivate(&(pScreen)->devPrivates, kdScreenPrivateKey))
|
||||||
#define KdSetScreenPriv(pScreen,v) \
|
#define KdSetScreenPriv(pScreen,v) \
|
||||||
|
@ -345,6 +357,9 @@ void
|
||||||
int
|
int
|
||||||
KdProcessArgument(int argc, char **argv, int i);
|
KdProcessArgument(int argc, char **argv, int i);
|
||||||
|
|
||||||
|
void
|
||||||
|
KdOsInit(KdOsFuncs * pOsFuncs);
|
||||||
|
|
||||||
void
|
void
|
||||||
KdOsAddInputDrivers(void);
|
KdOsAddInputDrivers(void);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue