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)
|
||||
return rc;
|
||||
|
||||
rc = dixLookupProperty(&pProp, pWin, stuff->property, client,
|
||||
DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
pProp = dixLookupProperty(pWin, stuff->property, client, DixGetAttrAccess);
|
||||
if (!pProp)
|
||||
return BadMatch;
|
||||
|
||||
obj = dixLookupPrivate(&pProp->devPrivates, privKey);
|
||||
return SELinuxSendContextReply(client, obj->sid);
|
||||
|
|
|
@ -689,4 +689,6 @@ static inline ClientPtr dixLookupXIDOwner(XID xid)
|
|||
return NullClient;
|
||||
}
|
||||
|
||||
void dixFreeAllScreens(void);
|
||||
|
||||
#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;
|
||||
|
||||
CloseDownDevices();
|
||||
|
||||
CloseDownEvents();
|
||||
|
||||
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));
|
||||
dixFreeAllScreens();
|
||||
|
||||
ReleaseClientIds(serverClient);
|
||||
dixFreePrivates(serverClient->devPrivates, PRIVATE_CLIENT);
|
||||
|
|
|
@ -92,8 +92,7 @@ PrintPropertys(WindowPtr pWin)
|
|||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
dixLookupProperty(PropertyPtr *result, WindowPtr pWin, Atom propertyName,
|
||||
PropertyPtr dixLookupProperty(WindowPtr pWin, Atom propertyName,
|
||||
ClientPtr client, Mask access_mode)
|
||||
{
|
||||
PropertyPtr pProp;
|
||||
|
@ -101,14 +100,14 @@ dixLookupProperty(PropertyPtr *result, WindowPtr pWin, Atom propertyName,
|
|||
|
||||
client->errorValue = propertyName;
|
||||
|
||||
for (pProp = pWin->properties; pProp; pProp = pProp->next)
|
||||
if (pProp->propertyName == propertyName)
|
||||
break;
|
||||
for (pProp = wUserProps(pWin); pProp; pProp = pProp->next)
|
||||
if (pProp->propertyName == propertyName) {
|
||||
if (XaceHookPropertyAccess(client, pWin, &pProp, access_mode) != Success)
|
||||
return NULL;
|
||||
return pProp;
|
||||
}
|
||||
|
||||
if (pProp)
|
||||
rc = XaceHookPropertyAccess(client, pWin, &pProp, access_mode);
|
||||
*result = pProp;
|
||||
return rc;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -223,6 +222,7 @@ ProcRotateProperties(ClientPtr client)
|
|||
|
||||
if (rc != Success)
|
||||
goto out;
|
||||
}
|
||||
|
||||
props[i] = pProp;
|
||||
saved[i] = *pProp;
|
||||
|
@ -333,7 +333,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
|
|||
access_mode = (mode == PropModeReplace) ? DixWriteAccess : DixBlendAccess;
|
||||
|
||||
/* 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 (!MakeWindowOptional(pWin))
|
||||
|
@ -365,7 +365,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
|
|||
pProp->next = pWin->properties;
|
||||
pWin->properties = pProp;
|
||||
}
|
||||
else if (rc == Success) {
|
||||
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
|
||||
|
@ -427,8 +427,6 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
|
|||
return rc;
|
||||
}
|
||||
}
|
||||
else
|
||||
return rc;
|
||||
|
||||
if (sendevent) {
|
||||
deliverPropertyNotifyEvent(pWin, PropertyNewValue, pProp);
|
||||
|
@ -444,8 +442,8 @@ DeleteProperty(ClientPtr client, WindowPtr pWin, Atom propName)
|
|||
PropertyPtr pProp, prevProp;
|
||||
int rc;
|
||||
|
||||
rc = dixLookupProperty(&pProp, pWin, propName, client, DixDestroyAccess);
|
||||
if (rc == BadMatch)
|
||||
pProp = dixLookupProperty(pWin, propName, client, DixDestroyAccess);
|
||||
if (!pProp)
|
||||
return Success; /* Succeed if property does not exist */
|
||||
|
||||
if (rc == Success) {
|
||||
|
@ -467,7 +465,19 @@ DeleteProperty(ClientPtr client, WindowPtr pWin, Atom propName)
|
|||
free(pProp->data);
|
||||
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
|
||||
|
|
|
@ -94,7 +94,7 @@ typedef struct _PropertyFilterParam {
|
|||
|
||||
extern CallbackListPtr PropertyFilterCallback;
|
||||
|
||||
int dixLookupProperty(PropertyPtr *result, WindowPtr pWin, Atom proprty,
|
||||
PropertyPtr dixLookupProperty(WindowPtr pWin, Atom proprty,
|
||||
ClientPtr pClient, Mask access_mode);
|
||||
|
||||
void DeleteAllWindowProperties(WindowPtr pWin);
|
||||
|
|
17
dix/screen.c
17
dix/screen.c
|
@ -10,7 +10,7 @@
|
|||
#include "include/screenint.h"
|
||||
#include "include/scrnintstr.h"
|
||||
|
||||
void dixFreeScreen(ScreenPtr pScreen)
|
||||
static void dixFreeScreen(ScreenPtr pScreen)
|
||||
{
|
||||
if (!pScreen)
|
||||
return;
|
||||
|
@ -27,3 +27,18 @@ void dixFreeScreen(ScreenPtr pScreen)
|
|||
DeleteCallbackList(&pScreen->hookPixmapDestroy);
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
OsVendorInit(void)
|
||||
{
|
||||
|
@ -381,12 +398,7 @@ OsVendorInit(void)
|
|||
if (hostx_want_host_cursor())
|
||||
ephyrFuncs.initCursor = &ephyrCursorInit;
|
||||
|
||||
if (serverGeneration == 1) {
|
||||
if (!KdCardInfoLast()) {
|
||||
processScreenArg("640x480", NULL);
|
||||
}
|
||||
hostx_init();
|
||||
}
|
||||
KdOsInit(&EphyrOsFuncs);
|
||||
}
|
||||
|
||||
KdCardFuncs ephyrFuncs = {
|
||||
|
|
|
@ -91,6 +91,14 @@ const char *kdGlobalXkbLayout = NULL;
|
|||
const char *kdGlobalXkbVariant = NULL;
|
||||
const char *kdGlobalXkbOptions = NULL;
|
||||
|
||||
|
||||
/*
|
||||
* Carry arguments from InitOutput through driver initialization
|
||||
* to KdScreenInit
|
||||
*/
|
||||
|
||||
KdOsFuncs *kdOsFuncs = NULL;
|
||||
|
||||
void
|
||||
KdDisableScreen(ScreenPtr pScreen)
|
||||
{
|
||||
|
@ -517,6 +525,19 @@ KdProcessArgument(int argc, char **argv, int i)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
KdOsInit(KdOsFuncs * pOsFuncs)
|
||||
{
|
||||
kdOsFuncs = pOsFuncs;
|
||||
if (pOsFuncs) {
|
||||
if (serverGeneration == 1) {
|
||||
KdDoSwitchCmd("start");
|
||||
if (pOsFuncs->Init)
|
||||
(*pOsFuncs->Init) ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static Bool
|
||||
KdAllocatePrivates(ScreenPtr pScreen)
|
||||
{
|
||||
|
|
|
@ -278,6 +278,16 @@ int KdAddConfigKeyboard(char *pointer);
|
|||
int KdAddKeyboard(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 {
|
||||
int matrix[2][3];
|
||||
} KdPointerMatrix;
|
||||
|
@ -289,6 +299,8 @@ extern DevPrivateKeyRec kdScreenPrivateKeyRec;
|
|||
extern Bool kdEmulateMiddleButton;
|
||||
extern Bool kdDisableZaphod;
|
||||
|
||||
extern KdOsFuncs *kdOsFuncs;
|
||||
|
||||
#define KdGetScreenPriv(pScreen) ((KdPrivScreenPtr) \
|
||||
dixLookupPrivate(&(pScreen)->devPrivates, kdScreenPrivateKey))
|
||||
#define KdSetScreenPriv(pScreen,v) \
|
||||
|
@ -345,6 +357,9 @@ void
|
|||
int
|
||||
KdProcessArgument(int argc, char **argv, int i);
|
||||
|
||||
void
|
||||
KdOsInit(KdOsFuncs * pOsFuncs);
|
||||
|
||||
void
|
||||
KdOsAddInputDrivers(void);
|
||||
|
||||
|
|
Loading…
Reference in New Issue