fixed scrolling lists with the mousewheel for some X11 windowmanagers.

some WMs not only send 'crossing' events when really moving from one
window to another, but also when mousewheeling.
distinguishing those events 'mode' property fixed this.

brecht++ for figuring out the details.
This commit is contained in:
M.G. Kishalmi 2011-05-09 12:46:59 +00:00
parent 99ee18c684
commit 88a13d7395

@ -700,19 +700,24 @@ GHOST_SystemX11::processEvent(XEvent *xe)
case EnterNotify:
case LeaveNotify:
{
// XCrossingEvents pointer leave enter window.
// also do cursor move here, MotionNotify only
// happens when motion starts & ends inside window
/* XCrossingEvents pointer leave enter window.
also do cursor move here, MotionNotify only
happens when motion starts & ends inside window.
we only do moves when the crossing mode is 'normal'
(really crossing between windows) since some windowmanagers
also send grab/ungrab crossings for mousewheel events.
*/
XCrossingEvent &xce = xe->xcrossing;
g_event = new
GHOST_EventCursor(
getMilliSeconds(),
GHOST_kEventCursorMove,
window,
xce.x_root,
xce.y_root
);
if( xce.mode == NotifyNormal ) {
g_event = new
GHOST_EventCursor(
getMilliSeconds(),
GHOST_kEventCursorMove,
window,
xce.x_root,
xce.y_root
);
}
break;
}
case MapNotify: