diff options
author | Ian Romanick <idr@us.ibm.com> | 2007-08-23 18:19:17 -0700 |
---|---|---|
committer | Ian Romanick <idr@us.ibm.com> | 2007-08-23 18:19:17 -0700 |
commit | 8b6b40b7271acd81a9548f502c18f46f3b640640 (patch) | |
tree | 1462cb63501a8bdd8845d7c62e038b6a86b78fd5 /dix/property.c | |
parent | ab7a6d860d4a275a810a64b1ba7b13726ed10575 (diff) | |
parent | 3305d17195e3a0a5555300555bd7703312fa489f (diff) |
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-reworkpci-rework
Conflicts:
hw/xfree86/common/xf86.h
hw/xfree86/common/xf86Init.c
hw/xfree86/common/xf86pciBus.c
hw/xfree86/int10/generic.c
hw/xfree86/int10/helper_exec.c
hw/xfree86/loader/xf86sym.c
hw/xfree86/os-support/bus/Pci.c
hw/xfree86/os-support/bus/Pci.h
hw/xfree86/os-support/bus/linuxPci.c
hw/xfree86/os-support/linux/int10/linux.c
Diffstat (limited to 'dix/property.c')
-rw-r--r-- | dix/property.c | 64 |
1 files changed, 21 insertions, 43 deletions
diff --git a/dix/property.c b/dix/property.c index 034d86f63..e281dd765 100644 --- a/dix/property.c +++ b/dix/property.c @@ -91,6 +91,19 @@ PrintPropertys(WindowPtr pWin) } #endif +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) { @@ -100,7 +113,6 @@ ProcRotateProperties(ClientPtr client) Atom * atoms; PropertyPtr * props; /* array of pointer */ PropertyPtr pProp; - xEvent event; REQUEST_FIXED_SIZE(xRotatePropertiesReq, stuff->nAtoms << 2); UpdateCurrentTime(); @@ -157,16 +169,9 @@ found: 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]; } } @@ -243,7 +248,6 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, Bool sendevent) { PropertyPtr pProp; - xEvent event; int sizeInBytes; int totalSize; pointer data; @@ -338,15 +342,10 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, 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); } @@ -354,7 +353,6 @@ int DeleteProperty(WindowPtr pWin, Atom propName) { PropertyPtr pProp, prevProp; - xEvent event; if (!(pProp = wUserProps (pWin))) return(Success); @@ -377,12 +375,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); xfree(pProp->data); xfree(pProp); } @@ -393,17 +386,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; xfree(pProp->data); xfree(pProp); @@ -537,16 +524,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) |