/* * Check to see if the window the mouse is currently in has changed. * If so, generate enter and leave events as required. The newest * mouse window is remembered in mousewp. However, do not change the * window while it is grabbed. */ void GsCheckMouseWindow(void) { #if 1 GR_WINDOW *oldwp, *newwp; oldwp = grabbuttonwp; if (!oldwp) oldwp = mousewp; newwp = GsFindVisibleWindow(cursorx, cursory); if (oldwp != newwp) { GsDeliverGeneralEvent(oldwp, GR_EVENT_TYPE_MOUSE_EXIT, NULL); GsDeliverGeneralEvent(newwp, GR_EVENT_TYPE_MOUSE_ENTER, NULL); } mousewp = newwp; #endif #if 0 GR_WINDOW *wp; /* newest window for mouse */ wp = grabbuttonwp; if (wp == NULL) wp = GsFindVisibleWindow(cursorx, cursory); if (wp == mousewp) return; GsDeliverGeneralEvent(mousewp, GR_EVENT_TYPE_MOUSE_EXIT, NULL); mousewp = wp; GsDeliverGeneralEvent(wp, GR_EVENT_TYPE_MOUSE_ENTER, NULL); #endif }
/* * Check to see if the window the mouse is currently in has changed. * If so, generate enter and leave events as required. The newest * mouse window is remembered in mousewp. However, do not change the * window while it is grabbed. */ void GsCheckMouseWindow(void) { GR_WINDOW *wp; /* newest window for mouse */ wp = grabbuttonwp; if (wp == NULL) wp = GsFindVisibleWindow(cursorx, cursory); if (wp == mousewp) return; GsDeliverGeneralEvent(mousewp, GR_EVENT_TYPE_MOUSE_EXIT, NULL); mousewp = wp; GsDeliverGeneralEvent(wp, GR_EVENT_TYPE_MOUSE_ENTER, NULL); }