mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
fix 'lost' button events when mouse wanders out of window
This commit is contained in:
parent
bddbd6788b
commit
8440f4bb3e
@ -858,12 +858,9 @@ do_transmit_data(const DataNodeTransmit &input, DataNodeTransmit &output) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_has_mouse = false;
|
_has_mouse = false;
|
||||||
// If the mouse is outside the window, do nothing; let all the
|
|
||||||
// events continue down the pipe unmolested.
|
|
||||||
clear_current_regions();
|
clear_current_regions();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
} else {
|
||||||
// The mouse is within the window. Get the current mouse position.
|
// The mouse is within the window. Get the current mouse position.
|
||||||
const EventStoreVec2 *xy;
|
const EventStoreVec2 *xy;
|
||||||
DCAST_INTO_V(xy, input.get_data(_xy_input).get_ptr());
|
DCAST_INTO_V(xy, input.get_data(_xy_input).get_ptr());
|
||||||
@ -884,6 +881,7 @@ do_transmit_data(const DataNodeTransmit &input, DataNodeTransmit &output) {
|
|||||||
VRegions regions;
|
VRegions regions;
|
||||||
get_over_regions(regions, _mouse);
|
get_over_regions(regions, _mouse);
|
||||||
set_current_regions(regions);
|
set_current_regions(regions);
|
||||||
|
}
|
||||||
|
|
||||||
_suppress_flags = 0;
|
_suppress_flags = 0;
|
||||||
if (_preferred_region != (MouseWatcherRegion *)NULL) {
|
if (_preferred_region != (MouseWatcherRegion *)NULL) {
|
||||||
@ -915,7 +913,8 @@ do_transmit_data(const DataNodeTransmit &input, DataNodeTransmit &output) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((_suppress_flags & MouseWatcherRegion::SF_mouse_position) == 0) {
|
if (_has_mouse &&
|
||||||
|
(_suppress_flags & MouseWatcherRegion::SF_mouse_position) == 0) {
|
||||||
// Transmit the mouse position.
|
// Transmit the mouse position.
|
||||||
output.set_data(_xy_output, input.get_data(_xy_input));
|
output.set_data(_xy_output, input.get_data(_xy_input));
|
||||||
output.set_data(_pixel_xy_output, input.get_data(_pixel_xy_input));
|
output.set_data(_pixel_xy_output, input.get_data(_pixel_xy_input));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user