fix popup window can not receive events immediately when the mouse enters
This commit is contained in:
parent
31b9201a3c
commit
04f5364646
|
@ -4989,10 +4989,16 @@ void DisplayServerX11::process_events() {
|
||||||
|
|
||||||
last_mouse_pos = pos;
|
last_mouse_pos = pos;
|
||||||
|
|
||||||
if (focused_window_id != window_id) {
|
if (windows[focused_window_id].mpass || wd.is_popup) {
|
||||||
// Adjust event position relative to window distance when event is sent to a different window.
|
mm->set_window_id(window_id);
|
||||||
mm->set_position(mm->get_position() - window_get_position(focused_window_id) + window_get_position(window_id));
|
} else {
|
||||||
mm->set_global_position(mm->get_position());
|
int x, y;
|
||||||
|
Window child;
|
||||||
|
XTranslateCoordinates(x11_display, wd.x11_window, windows[focused_window_id].x11_window, event.xmotion.x, event.xmotion.y, &x, &y, &child);
|
||||||
|
|
||||||
|
Point2i pos_focused(x, y);
|
||||||
|
mm->set_position(pos_focused);
|
||||||
|
mm->set_global_position(pos_focused);
|
||||||
}
|
}
|
||||||
Input::get_singleton()->parse_input_event(mm);
|
Input::get_singleton()->parse_input_event(mm);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue