XQuartz: Only set MotionNotify on activation if it is updated.
(cherry picked from commit ae8077a251ef27381a755d57ff974767bda16148)
This commit is contained in:
parent
5e55becddc
commit
8522a759c9
|
@ -83,6 +83,7 @@ extern int darwinFakeButtons;
|
||||||
* location when we become the foreground application
|
* location when we become the foreground application
|
||||||
*/
|
*/
|
||||||
static NSPoint bgMouseLocation;
|
static NSPoint bgMouseLocation;
|
||||||
|
static BOOL bgMouseLocationUpdated = FALSE;
|
||||||
|
|
||||||
X11Application *X11App;
|
X11Application *X11App;
|
||||||
|
|
||||||
|
@ -192,7 +193,8 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
|
||||||
size_t i;
|
size_t i;
|
||||||
DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active)
|
DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active)
|
||||||
if (state) {
|
if (state) {
|
||||||
DarwinSendPointerEvents(darwinPointer, MotionNotify, 0, bgMouseLocation.x, bgMouseLocation.y, 0.0, 0.0, 0.0);
|
if(bgMouseLocationUpdated)
|
||||||
|
DarwinSendPointerEvents(darwinPointer, MotionNotify, 0, bgMouseLocation.x, bgMouseLocation.y, 0.0, 0.0, 0.0);
|
||||||
DarwinSendDDXEvent(kXquartzActivate, 0);
|
DarwinSendDDXEvent(kXquartzActivate, 0);
|
||||||
|
|
||||||
if (!_x_active) {
|
if (!_x_active) {
|
||||||
|
@ -1087,9 +1089,11 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
bgMouseLocation = location;
|
bgMouseLocation = location;
|
||||||
|
bgMouseLocationUpdated = TRUE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
bgMouseLocationUpdated = FALSE;
|
||||||
DarwinSendPointerEvents(pDev, MotionNotify, 0, location.x,
|
DarwinSendPointerEvents(pDev, MotionNotify, 0, location.x,
|
||||||
location.y, pressure, tilt.x, tilt.y);
|
location.y, pressure, tilt.x, tilt.y);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue