ev->state indicates the state of the buttons and modifier keys, so it's not
just workspace changes but any time these buttons are down. This heuristic
breaks focus with mouse buttons down and when creating new terminals with
m-s-enter, among other things.
- /*
- * state is set when we are switching workspaces and focus is set when
- * scrotwm launches via a restart
- */
- if (ev->state || ev->focus) {
+ /* Focus is set when the window being entered already has focus. */
+ if (ev->focus) {
DNPRINTF(SWM_D_EVENT, "ignoring enternotify: focus\n");
return;
}
DNPRINTF(SWM_D_EVENT, "ignoring enternotify: focus\n");
return;
}