diff --git a/lib/xcore.js b/lib/xcore.js index 6df8e7d..6b4a41b 100644 --- a/lib/xcore.js +++ b/lib/xcore.js @@ -275,8 +275,8 @@ XClient.prototype.unpackEvent = function(type, seq, extra, code, raw, headerBuf) event.y = values[6]; event.buttons = values[7]; event.sameScreen = values[8]; - } else if (type == 7) { //EnterNotify - event.name = 'EnterNotify' + } else if (type == 7 || type == 8) { //EnterNotify || LeaveNotify + event.name = type === 7 ? 'EnterNotify' : 'LeaveNotify'; var values = raw.unpack('LLLssssSC'); event.root = values[0] event.wid = values[1]