activateNextClient precedence for next client in tabgroup

BUG: 309765
FIXED-IN: 4.10
REVIEW: 107258
This commit is contained in:
Thomas Lübking 2012-11-08 22:26:09 +01:00
parent 01adbe6dc5
commit 320c5cc287

View file

@ -457,16 +457,24 @@ bool Workspace::activateNextClient(Client* c)
Client* get_focus = NULL;
if (options->isNextFocusPrefersMouse()) {
// precedence on keeping the current tabgroup active. to the user that's the same window
if (c && c->tabGroup()) {
if (c == c->tabGroup()->current())
c->tabGroup()->activateNext();
get_focus = c->tabGroup()->current();
if (get_focus == c) // single tab case - should not happen
get_focus = NULL;
}
if (!get_focus && options->isNextFocusPrefersMouse()) {
get_focus = clientUnderMouse(c ? c->screen() : activeScreen());
if (get_focus && (get_focus == c || get_focus->isDesktop())) {
// should rather not happen, but it cannot get the focus. rest of usability is tested above
get_focus = 0;
get_focus = NULL;
}
}
if (!get_focus) { // no suitable window under the mouse -> find sth. else
// first try to pass the focus to the (former) active clients leader
if (c && (get_focus = c->transientFor()) && isUsableFocusCandidate(get_focus, c, options->isSeparateScreenFocus())) {
raiseClient(get_focus); // also raise - we don't know where it came from