attempts at auto-focus

This commit is contained in:
David Rose 2007-03-20 21:08:46 +00:00
parent 5a2eca97ef
commit c1f598e117

View File

@ -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);
}