Changeset View
Changeset View
Standalone View
Standalone View
activation.cpp
Show First 20 Lines • Show All 383 Lines • ▼ Show 20 Line(s) | 382 | } | |||
---|---|---|---|---|---|
384 | if (c->isShade()) { | 384 | if (c->isShade()) { | ||
385 | if (c->wantsInput() && (flags & ActivityFocus)) { | 385 | if (c->wantsInput() && (flags & ActivityFocus)) { | ||
386 | // client cannot accept focus, but at least the window should be active (window menu, et. al. ) | 386 | // client cannot accept focus, but at least the window should be active (window menu, et. al. ) | ||
387 | c->setActive(true); | 387 | c->setActive(true); | ||
388 | focusToNull(); | 388 | focusToNull(); | ||
389 | } | 389 | } | ||
390 | flags &= ~ActivityFocus; | 390 | flags &= ~ActivityFocus; | ||
391 | } | 391 | } | ||
392 | if (c->tabGroup() && c->tabGroup()->current() != c) | | |||
393 | c->tabGroup()->setCurrent(c); | | |||
394 | if (!c->isShown(true)) { // shouldn't happen, call activateClient() if needed | 392 | if (!c->isShown(true)) { // shouldn't happen, call activateClient() if needed | ||
395 | qCWarning(KWIN_CORE) << "takeActivity: not shown" ; | 393 | qCWarning(KWIN_CORE) << "takeActivity: not shown" ; | ||
396 | return; | 394 | return; | ||
397 | } | 395 | } | ||
398 | 396 | | |||
399 | if (flags & ActivityFocus) | 397 | if (flags & ActivityFocus) | ||
400 | c->takeFocus(); | 398 | c->takeFocus(); | ||
401 | if (flags & ActivityRaise) | 399 | if (flags & ActivityRaise) | ||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 458 | if (!focusChangeEnabled()) { | |||
462 | return true; | 460 | return true; | ||
463 | } | 461 | } | ||
464 | 462 | | |||
465 | if (!options->focusPolicyIsReasonable()) | 463 | if (!options->focusPolicyIsReasonable()) | ||
466 | return false; | 464 | return false; | ||
467 | 465 | | |||
468 | AbstractClient* get_focus = NULL; | 466 | AbstractClient* get_focus = NULL; | ||
469 | 467 | | |||
470 | // precedence on keeping the current tabgroup active. to the user that's the same window | | |||
471 | if (c && c->tabGroup() && c->isShown(false)) { | | |||
472 | if (c == c->tabGroup()->current()) | | |||
473 | c->tabGroup()->activateNext(); | | |||
474 | get_focus = c->tabGroup()->current(); | | |||
475 | if (get_focus == c) // single tab case - should not happen | | |||
476 | get_focus = NULL; | | |||
477 | } | | |||
478 | | ||||
479 | const int desktop = VirtualDesktopManager::self()->current(); | 468 | const int desktop = VirtualDesktopManager::self()->current(); | ||
480 | 469 | | |||
481 | if (!get_focus && showingDesktop()) | 470 | if (!get_focus && showingDesktop()) | ||
482 | get_focus = findDesktop(true, desktop); // to not break the state | 471 | get_focus = findDesktop(true, desktop); // to not break the state | ||
483 | 472 | | |||
484 | if (!get_focus && options->isNextFocusPrefersMouse()) { | 473 | if (!get_focus && options->isNextFocusPrefersMouse()) { | ||
485 | get_focus = clientUnderMouse(c ? c->screen() : screens()->current()); | 474 | get_focus = clientUnderMouse(c ? c->screen() : screens()->current()); | ||
486 | if (get_focus && (get_focus == c || get_focus->isDesktop())) { | 475 | if (get_focus && (get_focus == c || get_focus->isDesktop())) { | ||
▲ Show 20 Lines • Show All 409 Lines • Show Last 20 Lines |