+ if (focus_mode != SWM_FOCUS_FOLLOW &&
+ !(win->quirks & SWM_Q_NOFOCUSONMAP)) {
+ if (win->quirks & SWM_Q_FOCUSONMAP_SINGLE) {
+ /* See if other wins of same type are already mapped. */
+ TAILQ_FOREACH(w, &win->ws->winlist, entry) {
+ if (w == win || !w->mapped)
+ continue;
+
+ if (!strcmp(w->ch.class_name,
+ win->ch.class_name) &&
+ !strcmp(w->ch.instance_name,
+ win->ch.instance_name))
+ break;
+ }
+ }
+
+ if (w == NULL)
+ win->ws->focus_pending = get_focus_magic(win);
+ }