summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-08-02 14:27:03 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-08-02 14:27:03 -0400
commite34fcd2bf42dbd72ab6ce2df80f2dcaa13416e74 (patch)
treec9639b11acb0ff6c90d774574b0392d81320e84e /dix
parent32c0dcc8c0d1edba5d7e418fd2dc916847a4f069 (diff)
parentf3955c0a020b39021050cd33c20a17f14fc4b579 (diff)
Merge branch 'master' into XACE-SELINUX
Conflicts: dix/devices.c dix/property.c include/dix.h
Diffstat (limited to 'dix')
-rw-r--r--dix/Makefile.am5
-rw-r--r--dix/cursor.c22
-rw-r--r--dix/devices.c77
-rw-r--r--dix/events.c32
-rw-r--r--dix/getevents.c95
-rw-r--r--dix/grabs.c47
-rw-r--r--dix/main.c30
-rw-r--r--dix/property.c64
-rw-r--r--dix/resource.c2
-rw-r--r--dix/window.c14
-rw-r--r--dix/xpstubs.c1
11 files changed, 260 insertions, 129 deletions
diff --git a/dix/Makefile.am b/dix/Makefile.am
index ff0d5d68c..1004255dd 100644
--- a/dix/Makefile.am
+++ b/dix/Makefile.am
@@ -58,3 +58,8 @@ noinst_PROGRAMS = dix.O
dix.O: dtrace-dix.o $(am_libdix_la_OBJECTS)
ld -r -o $@ .libs/*.o
endif
+
+dix.c:
+ touch $@
+
+CLEANFILES = dix.c
diff --git a/dix/cursor.c b/dix/cursor.c
index 5ab562ead..d903124c4 100644
--- a/dix/cursor.c
+++ b/dix/cursor.c
@@ -430,25 +430,41 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
*************************************************************/
CursorPtr
-CreateRootCursor(char *pfilename, unsigned glyph)
+CreateRootCursor(char *unused1, unsigned int unused2)
{
CursorPtr curs;
+#ifdef NULL_ROOT_CURSOR
+ CursorMetricRec cm;
+#else
FontPtr cursorfont;
int err;
XID fontID;
+#endif
+
+#ifdef NULL_ROOT_CURSOR
+ cm.width = 0;
+ cm.height = 0;
+ cm.xhot = 0;
+ cm.yhot = 0;
+ curs = AllocCursor(NULL, NULL, &cm, 0, 0, 0, 0, 0, 0);
+
+ if (curs == NullCursor)
+ return NullCursor;
+#else
fontID = FakeClientID(0);
err = OpenFont(serverClient, fontID, FontLoadAll | FontOpenSync,
- (unsigned)strlen( pfilename), pfilename);
+ (unsigned)strlen(defaultCursorFont), defaultCursorFont);
if (err != Success)
return NullCursor;
cursorfont = (FontPtr)LookupIDByType(fontID, RT_FONT);
if (!cursorfont)
return NullCursor;
- if (AllocGlyphCursor(fontID, glyph, fontID, glyph + 1,
+ if (AllocGlyphCursor(fontID, 0, fontID, 1,
0, 0, 0, ~0, ~0, ~0, &curs, serverClient) != Success)
return NullCursor;
+#endif
if (!AddResource(FakeClientID(0), RT_CURSOR, (pointer)curs))
return NullCursor;
diff --git a/dix/devices.c b/dix/devices.c
index 45833d037..4ddfa63da 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -81,9 +81,20 @@ SOFTWARE.
#include "exglobals.h"
#include "exevents.h"
+/** @file
+ * This file handles input device-related stuff.
+ */
+
int CoreDevicePrivatesIndex = 0;
static int CoreDevicePrivatesGeneration = -1;
+/**
+ * Create a new input device and init it to sane values. The device is added
+ * to the server's off_devices list.
+ *
+ * @param deviceProc Callback for device control function (switch dev on/off).
+ * @return The newly created device.
+ */
DeviceIntPtr
AddInputDevice(DeviceProc deviceProc, Bool autoStart)
{
@@ -139,6 +150,7 @@ AddInputDevice(DeviceProc deviceProc, Bool autoStart)
#ifdef XKB
dev->xkb_interest = NULL;
#endif
+ dev->config_info = NULL;
/* must pre-allocate one private for the new devPrivates support */
dev->nPrivates = 1;
dev->devPrivates = (DevUnion *)xcalloc(1, sizeof(DevUnion));
@@ -160,6 +172,15 @@ AddInputDevice(DeviceProc deviceProc, Bool autoStart)
return dev;
}
+/**
+ * Switch device ON through the driver and push it onto the global device
+ * list. All clients are notified about the device being enabled.
+ *
+ * A device will send events once enabled.
+ *
+ * @param The device to be enabled.
+ * @return TRUE on success or FALSE otherwise.
+ */
Bool
EnableDevice(DeviceIntPtr dev)
{
@@ -196,6 +217,13 @@ EnableDevice(DeviceIntPtr dev)
return TRUE;
}
+/**
+ * Switch a device off through the driver and push it onto the off_devices
+ * list. A device will not send events while disabled. All clients are
+ * notified about the device being disabled.
+ *
+ * @return TRUE on success or FALSE otherwise.
+ */
Bool
DisableDevice(DeviceIntPtr dev)
{
@@ -226,6 +254,14 @@ DisableDevice(DeviceIntPtr dev)
return TRUE;
}
+/**
+ * Initialise a new device through the driver and tell all clients about the
+ * new device.
+ *
+ * The device will NOT send events until it is enabled!
+ *
+ * @return Success or an error code on failure.
+ */
int
ActivateDevice(DeviceIntPtr dev)
{
@@ -250,6 +286,10 @@ ActivateDevice(DeviceIntPtr dev)
return ret;
}
+/**
+ * Ring the bell.
+ * The actual task of ringing the bell is the job of the DDX.
+ */
static void
CoreKeyboardBell(int volume, DeviceIntPtr pDev, pointer arg, int something)
{
@@ -264,6 +304,9 @@ CoreKeyboardCtl(DeviceIntPtr pDev, KeybdCtrl *ctrl)
return;
}
+/**
+ * Device control function for the Virtual Core Keyboard.
+ */
static int
CoreKeyboardProc(DeviceIntPtr pDev, int what)
{
@@ -324,6 +367,9 @@ CoreKeyboardProc(DeviceIntPtr pDev, int what)
return Success;
}
+/**
+ * Device control function for the Virtual Core Pointer.
+ */
static int
CorePointerProc(DeviceIntPtr pDev, int what)
{
@@ -354,6 +400,12 @@ CorePointerProc(DeviceIntPtr pDev, int what)
return Success;
}
+/**
+ * Initialise the two core devices, VCP and VCK (see events.c).
+ * The devices are activated but not enabled.
+ * Note that the server MUST have two core devices at all times, even if there
+ * is no physical device connected.
+ */
void
InitCoreDevices(void)
{
@@ -413,6 +465,14 @@ InitCoreDevices(void)
}
}
+/**
+ * Activate all switched-off devices and then enable all those devices.
+ *
+ * Will return an error if no core keyboard or core pointer is present.
+ * In theory this should never happen if you call InitCoreDevices() first.
+ *
+ * @return Success or error code on failure.
+ */
int
InitAndStartDevices(void)
{
@@ -448,6 +508,13 @@ InitAndStartDevices(void)
return Success;
}
+/**
+ * Close down a device and free all resources.
+ * Once closed down, the driver will probably not expect you that you'll ever
+ * enable it again and free associated structs. If you want the device to just
+ * be disabled, DisableDevice().
+ * Don't call this function directly, use RemoveDevice() instead.
+ */
static void
CloseDevice(DeviceIntPtr dev)
{
@@ -550,6 +617,10 @@ CloseDevice(DeviceIntPtr dev)
xfree(dev);
}
+/**
+ * Shut down all devices, free all resources, etc.
+ * Only useful if you're shutting down the server!
+ */
void
CloseDownDevices(void)
{
@@ -571,6 +642,12 @@ CloseDownDevices(void)
inputInfo.pointer = NULL;
}
+/**
+ * Remove a device from the device list, closes it and thus frees all
+ * resources.
+ * Removes both enabled and disabled devices and notifies all devices about
+ * the removal of the device.
+ */
int
RemoveDevice(DeviceIntPtr dev)
{
diff --git a/dix/events.c b/dix/events.c
index b97be4f01..3fbe9b829 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -160,7 +160,6 @@ extern Mask xevieFilters[128];
extern int xevieEventSent;
extern int xevieKBEventSent;
int xeviegrabState = 0;
-static xEvent *xeviexE;
#endif
#include <X11/extensions/XIproto.h>
@@ -2629,6 +2628,7 @@ BorderSizeNotEmpty(WindowPtr pWin)
/**
* "CheckPassiveGrabsOnWindow" checks to see if the event passed in causes a
* passive grab set on the window to be activated.
+ * If a passive grab is activated, the event will be delivered to the client.
*
* @param pWin The window that may be subject to a passive grab.
* @param device Device that caused the event.
@@ -2728,16 +2728,26 @@ CheckPassiveGrabsOnWindow(
}
/**
-"CheckDeviceGrabs" handles both keyboard and pointer events that may cause
-a passive grab to be activated. If the event is a keyboard event, the
-ancestors of the focus window are traced down and tried to see if they have
-any passive grabs to be activated. If the focus window itself is reached and
-it's descendants contain they pointer, the ancestors of the window that the
-pointer is in are then traced down starting at the focus window, otherwise no
-grabs are activated. If the event is a pointer event, the ancestors of the
-window that the pointer is in are traced down starting at the root until
-CheckPassiveGrabs causes a passive grab to activate or all the windows are
-tried. PRH
+ * CheckDeviceGrabs handles both keyboard and pointer events that may cause
+ * a passive grab to be activated.
+ *
+ * If the event is a keyboard event, the ancestors of the focus window are
+ * traced down and tried to see if they have any passive grabs to be
+ * activated. If the focus window itself is reached and it's descendants
+ * contain the pointer, the ancestors of the window that the pointer is in
+ * are then traced down starting at the focus window, otherwise no grabs are
+ * activated.
+ * If the event is a pointer event, the ancestors of the window that the
+ * pointer is in are traced down starting at the root until CheckPassiveGrabs
+ * causes a passive grab to activate or all the windows are
+ * tried. PRH
+ *
+ * If a grab is activated, the event has been sent to the client already!
+ *
+ * @param device The device that caused the event.
+ * @param xE The event to handle (most likely {Device}ButtonPress).
+ * @param count Number of events in list.
+ * @return TRUE if a grab has been activated or false otherwise.
*/
Bool
diff --git a/dix/getevents.c b/dix/getevents.c
index 6969f782f..2a10038bc 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1,23 +1,25 @@
/*
* Copyright © 2006 Nokia Corporation
- * Copyright © 2006 Daniel Stone
+ * Copyright © 2006-2007 Daniel Stone
*
- * 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 this copyright notice and this permission notice appear in
- * supporting electronic documentation.
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
*
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) 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 COPYRIGHT HOLDERS OR AUTHORS 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.
+ * 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 AUTHORS OR COPYRIGHT HOLDERS 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.
*
* Author: Daniel Stone <daniel@fooishbar.org>
*/
@@ -443,9 +445,17 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type,
ms = GetTimeInMillis();
+ if (pDev->coreEvents) {
+ events->u.keyButtonPointer.time = ms;
+ events->u.u.type = type;
+ events->u.u.detail = key_code;
+ events++;
+ }
+
kbp = (deviceKeyButtonPointer *) events;
kbp->time = ms;
kbp->deviceid = pDev->id;
+ kbp->detail = key_code;
if (type == KeyPress)
kbp->type = DeviceKeyPress;
else if (type == KeyRelease)
@@ -459,12 +469,6 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type,
num_valuators, valuators);
}
- if (pDev->coreEvents) {
- events->u.keyButtonPointer.time = ms;
- events->u.u.type = type;
- events->u.u.detail = key_code;
- }
-
return numEvents;
}
@@ -498,14 +502,18 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
if ((type == ButtonPress || type == ButtonRelease) && !pDev->button)
return 0;
+ /* FIXME: I guess it should, in theory, be possible to post button events
+ * from devices without valuators. */
+ if (!pDev->valuator)
+ return 0;
+
if (!coreOnly && pDev->coreEvents)
num_events = 2;
else
num_events = 1;
- if (type == MotionNotify && num_valuators <= 0) {
+ if (type == MotionNotify && num_valuators <= 0)
return 0;
- }
/* Do we need to send a DeviceValuator event? */
if (!coreOnly && sendValuators) {
@@ -599,8 +607,27 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
pDev->valuator->lastx = x;
pDev->valuator->lasty = y;
- if (!coreOnly)
- {
+ /* for some reason inputInfo.pointer does not have coreEvents set */
+ if (coreOnly || pDev->coreEvents) {
+ events->u.u.type = type;
+ events->u.keyButtonPointer.time = ms;
+ events->u.keyButtonPointer.rootX = x;
+ events->u.keyButtonPointer.rootY = y;
+
+ if (type == ButtonPress || type == ButtonRelease) {
+ /* We hijack SetPointerMapping to work on all core-sending
+ * devices, so we use the device-specific map here instead of
+ * the core one. */
+ events->u.u.detail = pDev->button->map[buttons];
+ }
+ else {
+ events->u.u.detail = 0;
+ }
+
+ events++;
+ }
+
+ if (!coreOnly) {
kbp = (deviceKeyButtonPointer *) events;
kbp->time = ms;
kbp->deviceid = pDev->id;
@@ -628,24 +655,6 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
}
}
- /* for some reason inputInfo.pointer does not have coreEvents set */
- if (coreOnly || pDev->coreEvents) {
- events->u.u.type = type;
- events->u.keyButtonPointer.time = ms;
- events->u.keyButtonPointer.rootX = x;
- events->u.keyButtonPointer.rootY = y;
-
- if (type == ButtonPress || type == ButtonRelease) {
- /* We hijack SetPointerMapping to work on all core-sending
- * devices, so we use the device-specific map here instead of
- * the core one. */
- events->u.u.detail = pDev->button->map[buttons];
- }
- else {
- events->u.u.detail = 0;
- }
- }
-
return num_events;
}
diff --git a/dix/grabs.c b/dix/grabs.c
index 714fea3e5..2210cd05e 100644
--- a/dix/grabs.c
+++ b/dix/grabs.c
@@ -269,6 +269,42 @@ GrabMatchesSecond(GrabPtr pFirstGrab, GrabPtr pSecondGrab)
return FALSE;
}
+static Bool
+GrabsAreIdentical(GrabPtr pFirstGrab, GrabPtr pSecondGrab)
+{
+ if (pFirstGrab->device != pSecondGrab->device ||
+ (pFirstGrab->modifierDevice != pSecondGrab->modifierDevice) ||
+ (pFirstGrab->type != pSecondGrab->type))
+ return FALSE;
+
+ if (!(DetailSupersedesSecond(pFirstGrab->detail,
+ pSecondGrab->detail,
+ (unsigned short)AnyKey) &&
+ DetailSupersedesSecond(pSecondGrab->detail,
+ pFirstGrab->detail,
+ (unsigned short)AnyKey)))
+ return FALSE;
+
+ if (!(DetailSupersedesSecond(pFirstGrab->modifiersDetail,
+ pSecondGrab->modifiersDetail,
+ (unsigned short)AnyModifier) &&
+ DetailSupersedesSecond(pSecondGrab->modifiersDetail,
+ pFirstGrab->modifiersDetail,
+ (unsigned short)AnyModifier)))
+ return FALSE;
+
+ return TRUE;
+}
+
+
+/**
+ * Prepend the new grab to the list of passive grabs on the window.
+ * Any previously existing grab that matches the new grab will be removed.
+ * Adding a new grab that would override another client's grab will result in
+ * a BadAccess.
+ *
+ * @return Success or X error code on failure.
+ */
int
AddPassiveGrabToList(GrabPtr pGrab)
{
@@ -286,11 +322,22 @@ AddPassiveGrabToList(GrabPtr pGrab)
}
}
+ /* Remove all grabs that match the new one exactly */
+ for (grab = wPassiveGrabs(pGrab->window); grab; grab = grab->next)
+ {
+ if (GrabsAreIdentical(pGrab, grab))
+ {
+ DeletePassiveGrabFromList(grab);
+ break;
+ }
+ }
+
if (!pGrab->window->optional && !MakeWindowOptional (pGrab->window))
{
FreeGrab(pGrab);
return BadAlloc;
}
+
pGrab->next = pGrab->window->optional->passiveGrabs;
pGrab->window->optional->passiveGrabs = pGrab;
if (AddResource(pGrab->resource, RT_PASSIVEGRAB, (pointer)pGrab))
diff --git a/dix/main.c b/dix/main.c
index 922a32499..4ae09dc4e 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -74,8 +74,6 @@ Equipment Corporation.
******************************************************************/
-/* $TOG: main.c /main/86 1998/02/09 14:20:03 kaleb $ */
-
#define NEED_EVENTS
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
@@ -314,7 +312,7 @@ main(int argc, char *argv[], char *envp[])
InitBlockAndWakeupHandlers();
/* Perform any operating system dependent initializations you'd like */
OsInit();
- configInitialise();
+ config_init();
if(serverGeneration == 1)
{
CreateWellKnownSockets();
@@ -397,14 +395,10 @@ main(int argc, char *argv[], char *envp[])
FatalError("failed to initialize core devices");
InitFonts();
-#ifdef BUILTIN_FONTS
- defaultFontPath = "built-ins";
-#else
if (loadableFonts) {
SetFontPath(0, 0, (unsigned char *)defaultFontPath, &error);
- } else
-#endif
- {
+ }
+ else {
if (SetDefaultFontPath(defaultFontPath) != Success)
ErrorF("failed to set default font path '%s'",
defaultFontPath);
@@ -412,22 +406,12 @@ main(int argc, char *argv[], char *envp[])
if (!SetDefaultFont(defaultTextFont)) {
FatalError("could not open default font '%s'", defaultTextFont);
}
-#ifdef NULL_ROOT_CURSOR
- cm.width = 0;
- cm.height = 0;
- cm.xhot = 0;
- cm.yhot = 0;
-
- if (!(rootCursor = AllocCursor(NULL, NULL, &cm, 0, 0, 0, 0, 0, 0))) {
- FatalError("could not create empty root cursor");
- }
- AddResource(FakeClientID(0), RT_CURSOR, (pointer)rootCursor);
-#else
- if (!(rootCursor = CreateRootCursor(defaultCursorFont, 0))) {
+
+ if (!(rootCursor = CreateRootCursor(NULL, 0))) {
FatalError("could not open default cursor font '%s'",
defaultCursorFont);
}
-#endif
+
#ifdef DPMSExtension
/* check all screens, looking for DPMS Capabilities */
DPMSCapableFlag = DPMSSupported();
@@ -480,7 +464,7 @@ main(int argc, char *argv[], char *envp[])
FreeAllResources();
#endif
- configFini();
+ config_fini();
CloseDownDevices();
for (i = screenInfo.numScreens - 1; i >= 0; i--)
{
diff --git a/dix/property.c b/dix/property.c
index 09f9e3152..c0de5b3f4 100644
--- a/dix/property.c
+++ b/dix/property.c
@@ -104,6 +104,19 @@ FindProperty(WindowPtr pWin, Atom propertyName)
return pProp;
}
+static void
+deliverPropertyNotifyEvent(WindowPtr pWin, int state, Atom atom)
+{
+ xEvent event;
+
+ event.u.u.type = PropertyNotify;
+ event.u.property.window = pWin->drawable.id;
+ event.u.property.state = state;
+ event.u.property.atom = atom;
+ event.u.property.time = currentTime.milliseconds;
+ DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
+}
+
int
ProcRotateProperties(ClientPtr client)
{
@@ -113,7 +126,6 @@ ProcRotateProperties(ClientPtr client)
Atom * atoms;
PropertyPtr * props; /* array of pointer */
PropertyPtr pProp;
- xEvent event;
REQUEST_FIXED_SIZE(xRotatePropertiesReq, stuff->nAtoms << 2);
UpdateCurrentTime();
@@ -164,16 +176,9 @@ ProcRotateProperties(ClientPtr client)
delta += stuff->nAtoms;
for (i = 0; i < stuff->nAtoms; i++)
{
- /* Generate a PropertyNotify event for each property whose value
- is changed in the order in which they appear in the request. */
+ deliverPropertyNotifyEvent(pWin, PropertyNewValue,
+ props[i]->propertyName);
- event.u.u.type = PropertyNotify;
- event.u.property.window = pWin->drawable.id;
- event.u.property.state = PropertyNewValue;
- event.u.property.atom = props[i]->propertyName;
- event.u.property.time = currentTime.milliseconds;
- DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
-
props[i]->propertyName = atoms[(i + delta) % stuff->nAtoms];
}
}
@@ -241,7 +246,6 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
pointer value, Bool sendevent)
{
PropertyPtr pProp;
- xEvent event;
int sizeInBytes, totalSize, rc;
pointer data;
@@ -344,15 +348,10 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
pProp->size += len;
}
}
+
if (sendevent)
- {
- 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);
- }
+ deliverPropertyNotifyEvent(pWin, PropertyNewValue, pProp->propertyName);
+
return(Success);
}
@@ -369,7 +368,6 @@ int
DeleteProperty(WindowPtr pWin, Atom propName)
{
PropertyPtr pProp, prevProp;
- xEvent event;
if (!(pProp = wUserProps (pWin)))
return(Success);
@@ -392,12 +390,7 @@ DeleteProperty(WindowPtr pWin, Atom propName)
{
prevProp->next = pProp->next;
}
- event.u.u.type = PropertyNotify;
- event.u.property.window = pWin->drawable.id;
- event.u.property.state = PropertyDelete;
- event.u.property.atom = pProp->propertyName;
- event.u.property.time = currentTime.milliseconds;
- DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
+ deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp->propertyName);
dixFreePrivates(pProp->devPrivates);
xfree(pProp->data);
xfree(pProp);
@@ -409,17 +402,11 @@ void
DeleteAllWindowProperties(WindowPtr pWin)
{
PropertyPtr pProp, pNextProp;
- xEvent event;
pProp = wUserProps (pWin);
while (pProp)
{
- event.u.u.type = PropertyNotify;
- event.u.property.window = pWin->drawable.id;
- event.u.property.state = PropertyDelete;
- event.u.property.atom = pProp->propertyName;
- event.u.property.time = currentTime.milliseconds;
- DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
+ deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp->propertyName);
pNextProp = pProp->next;
dixFreePrivates(pProp->devPrivates);
xfree(pProp->data);
@@ -553,16 +540,7 @@ ProcGetProperty(ClientPtr client)
reply.propertyType = pProp->type;
if (stuff->delete && (reply.bytesAfter == 0))
- { /* send the event */
- xEvent event;
-
- event.u.u.type = PropertyNotify;
- event.u.property.window = pWin->drawable.id;
- event.u.property.state = PropertyDelete;
- event.u.property.atom = pProp->propertyName;
- event.u.property.time = currentTime.milliseconds;
- DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
- }
+ deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp->propertyName);
WriteReplyToClient(client, sizeof(xGenericReply), &reply);
if (len)
diff --git a/dix/resource.c b/dix/resource.c
index e89ad1fdd..ea0a3105c 100644
--- a/dix/resource.c
+++ b/dix/resource.c
@@ -101,8 +101,6 @@ Equipment Corporation.
* of the copyright holder.
*/
-/* $TOG: resource.c /main/41 1998/02/09 14:20:31 kaleb $ */
-
/* Routines to manage various kinds of resources:
*
* CreateNewResourceType, CreateNewResourceClass, InitClientResources,
diff --git a/dix/window.c b/dix/window.c
index 95b7b168c..2f151b09c 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -299,7 +299,7 @@ SetWindowToDefaults(WindowPtr pWin)
pWin->dontPropagate = 0;
pWin->forcedBS = FALSE;
#ifdef COMPOSITE
- pWin->redirectDraw = 0;
+ pWin->redirectDraw = RedirectDrawNone;
#endif
}
@@ -1693,10 +1693,14 @@ _X_EXPORT void
SetWinSize (WindowPtr pWin)
{
#ifdef COMPOSITE
- if (pWin->redirectDraw)
+ if (pWin->redirectDraw != RedirectDrawNone)
{
BoxRec box;
+ /*
+ * Redirected clients get clip list equal to their
+ * own geometry, not clipped to their parent
+ */
box.x1 = pWin->drawable.x;
box.y1 = pWin->drawable.y;
box.x2 = pWin->drawable.x + pWin->drawable.width;
@@ -1736,10 +1740,14 @@ SetBorderSize (WindowPtr pWin)
if (HasBorder (pWin)) {
bw = wBorderWidth (pWin);
#ifdef COMPOSITE
- if (pWin->redirectDraw)
+ if (pWin->redirectDraw != RedirectDrawNone)
{
BoxRec box;
+ /*
+ * Redirected clients get clip list equal to their
+ * own geometry, not clipped to their parent
+ */
box.x1 = pWin->drawable.x - bw;
box.y1 = pWin->drawable.y - bw;
box.x2 = pWin->drawable.x + pWin->drawable.width + bw;
diff --git a/dix/xpstubs.c b/dix/xpstubs.c
index 3276d9dfe..59340ad21 100644
--- a/dix/xpstubs.c
+++ b/dix/xpstubs.c
@@ -1,4 +1,3 @@
-/* $XFree86$ */
/*
Copyright 1996, 1998 The Open Group