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