add: if (owin == wwin || !owin) return;  nowner = wWindowFor(wwin->transient_for);   if (nowner == owin) { owin->flags.semi_focused = 1; wWindowUnfocus(nowner); return; }   if (wwin == oowner) { wWindowUnfocus(owin); return; }  if (!nowner) { wWindowUnfocus(owin); return; }   oowner = wWindowFor(owin->transient_for); if (oowner == nowner) {  oowner->flags.semi_focused = 0; wWindowUnfocus(owin); oowner->flags.semi_focused = 1;  return; }   nowner->flags.semi_focused = 1; wWindowUnfocus(nowner); wWindowUnfocus(owin);
context: wWindowFocus(WWindow *wwin){#ifdef KEEP_XKB_LOCK_STATUS    if (wPreferences.modelock) {        if (!wwin->flags.focused) {            XkbLockGroup(dpy, XkbUseCoreKbd, wwin->languagemode);        }    }#endif /* KEEP_XKB_LOCK_STATUS */    wFrameWindowChangeState(wwin->frame, WS_FOCUSED);    wwin->flags.focused=1;    wWindowResetMouseGrabs(wwin);    UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);}