dmx: Eliminate use of AddEnabledDevice [v2]
Use SetNotifyFd instead, with the hope that someday someone will come fix this to be more efficient -- right now, the wakeup handler is doing the event reading, instead of the notify callback. v2: no need to patch dmxsigio.c as it has been removed. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
		
							parent
							
								
									6299ef3d74
								
							
						
					
					
						commit
						410bc04748
					
				| 
						 | 
					@ -480,17 +480,26 @@ dmxCommonXSelect(DMXScreenInfo * dmxScreen, void *closure)
 | 
				
			||||||
    return NULL;
 | 
					    return NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void
 | 
				
			||||||
 | 
					dmxCommonFdNotify(int fd, int ready, void *data)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /* This should process input on this fd, but instead all
 | 
				
			||||||
 | 
					     * of that is delayed until the block and wakeup handlers are called
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    ;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void *
 | 
					static void *
 | 
				
			||||||
dmxCommonAddEnabledDevice(DMXScreenInfo * dmxScreen, void *closure)
 | 
					dmxCommonAddEnabledDevice(DMXScreenInfo * dmxScreen, void *closure)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    AddEnabledDevice(XConnectionNumber(dmxScreen->beDisplay));
 | 
					    SetNotifyFd(XConnectionNumber(dmxScreen->beDisplay), dmxCommonFdNotify, X_NOTIFY_READ, closure);
 | 
				
			||||||
    return NULL;
 | 
					    return NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void *
 | 
					static void *
 | 
				
			||||||
dmxCommonRemoveEnabledDevice(DMXScreenInfo * dmxScreen, void *closure)
 | 
					dmxCommonRemoveEnabledDevice(DMXScreenInfo * dmxScreen, void *closure)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    RemoveEnabledDevice(XConnectionNumber(dmxScreen->beDisplay));
 | 
					    RemoveNotifyFd(XConnectionNumber(dmxScreen->beDisplay));
 | 
				
			||||||
    return NULL;
 | 
					    return NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -504,7 +513,7 @@ dmxCommonMouOn(DevicePtr pDev)
 | 
				
			||||||
    priv->eventMask |= DMX_POINTER_EVENT_MASK;
 | 
					    priv->eventMask |= DMX_POINTER_EVENT_MASK;
 | 
				
			||||||
    if (!priv->be) {
 | 
					    if (!priv->be) {
 | 
				
			||||||
        XSelectInput(priv->display, priv->window, priv->eventMask);
 | 
					        XSelectInput(priv->display, priv->window, priv->eventMask);
 | 
				
			||||||
        AddEnabledDevice(XConnectionNumber(priv->display));
 | 
					        SetNotifyFd(XConnectionNumber(priv->display), dmxCommonFdNotify,X_NOTIFY_READ, pDev);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
        dmxPropertyIterate(priv->be, dmxCommonXSelect, priv);
 | 
					        dmxPropertyIterate(priv->be, dmxCommonXSelect, priv);
 | 
				
			||||||
| 
						 | 
					@ -523,7 +532,7 @@ dmxCommonMouOff(DevicePtr pDev)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    priv->eventMask &= ~DMX_POINTER_EVENT_MASK;
 | 
					    priv->eventMask &= ~DMX_POINTER_EVENT_MASK;
 | 
				
			||||||
    if (!priv->be) {
 | 
					    if (!priv->be) {
 | 
				
			||||||
        RemoveEnabledDevice(XConnectionNumber(priv->display));
 | 
					        RemoveNotifyFd(XConnectionNumber(priv->display));
 | 
				
			||||||
        XSelectInput(priv->display, priv->window, priv->eventMask);
 | 
					        XSelectInput(priv->display, priv->window, priv->eventMask);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue