[PATCH 1/6] XKB: Don't send unnecessary NewKeyboardNotifies

Daniel Stone daniel at fooishbar.org
Wed May 4 18:37:45 PDT 2011


In the XKB GetKeyboardByName handler, we had the following pseudocode:
    if (device was last slave of its MD) {
        XkbCopyDeviceKeymap(master, slave);
        XkbSendNewKeyboardNotify(slave, &notify);
    }

Even if the SendNewKeyboardNotify line nominated the correct device,
which it didn't, it's unnecessary as XkbCopyDeviceKeymap already sends a
NewKeyboardNotify on the destination device.

Signed-off-by: Daniel Stone <daniel at fooishbar.org>
---
 xkb/xkb.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/xkb/xkb.c b/xkb/xkb.c
index 4044d33..c4cb740 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -5902,10 +5902,8 @@ ProcXkbGetKbdByName(ClientPtr client)
 
 	if (!IsMaster(dev)) {
 	    DeviceIntPtr master = GetMaster(dev, MASTER_KEYBOARD);
-	    if (master && master->lastSlave == dev) {
+	    if (master && master->lastSlave == dev)
 		XkbCopyDeviceKeymap(master, dev);
-		XkbSendNewKeyboardNotify(dev,&nkn);
-	    }
 	}
     }
     if ((new!=NULL)&&(new!=xkb)) {
-- 
1.7.4.4



More information about the xorg-devel mailing list