mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
attempts at auto-focus
This commit is contained in:
parent
5a2eca97ef
commit
c1f598e117
@ -361,6 +361,9 @@ process_events() {
|
||||
case MapNotify:
|
||||
properties.set_minimized(false);
|
||||
system_changed_properties(properties);
|
||||
|
||||
// Auto-focus the window when it is mapped.
|
||||
XSetInputFocus(_display, _xwindow, RevertToPointerRoot, CurrentTime);
|
||||
break;
|
||||
|
||||
case ClientMessage:
|
||||
@ -514,6 +517,15 @@ set_properties_now(WindowProperties &properties) {
|
||||
properties.clear_cursor_hidden();
|
||||
}
|
||||
|
||||
if (properties.has_foreground()) {
|
||||
if (properties.get_foreground()) {
|
||||
XSetInputFocus(_display, _xwindow, RevertToPointerRoot, CurrentTime);
|
||||
} else {
|
||||
XSetInputFocus(_display, PointerRoot, RevertToPointerRoot, CurrentTime);
|
||||
}
|
||||
properties.clear_foreground();
|
||||
}
|
||||
|
||||
set_wm_properties(wm_properties, true);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user