Changeset View
Changeset View
Standalone View
Standalone View
activation.cpp
Show First 20 Lines • Show All 603 Lines • ▼ Show 20 Line(s) | 603 | if (ac == NULL || ac->isDesktop()) { | |||
---|---|---|---|---|---|
604 | qCDebug(KWIN_CORE) << "Activation: No client active, allowing"; | 604 | qCDebug(KWIN_CORE) << "Activation: No client active, allowing"; | ||
605 | return true; // no active client -> always allow | 605 | return true; // no active client -> always allow | ||
606 | } | 606 | } | ||
607 | 607 | | |||
608 | // TODO window urgency -> return true? | 608 | // TODO window urgency -> return true? | ||
609 | 609 | | |||
610 | // Unconditionally allow intra-client passing around for lower stealing protections | 610 | // Unconditionally allow intra-client passing around for lower stealing protections | ||
611 | // unless the active client has High interest | 611 | // unless the active client has High interest | ||
612 | if (AbstractClient::belongToSameApplication(c, ac, true) && protection < FSP::High) { | 612 | if (AbstractClient::belongToSameApplication(c, ac, AbstractClient::SameApplicationCheck::RelaxedForActive) && protection < FSP::High) { | ||
613 | qCDebug(KWIN_CORE) << "Activation: Belongs to active application"; | 613 | qCDebug(KWIN_CORE) << "Activation: Belongs to active application"; | ||
614 | return true; | 614 | return true; | ||
615 | } | 615 | } | ||
616 | 616 | | |||
617 | if (!c->isOnCurrentDesktop()) // we allowed explicit self-activation across virtual desktops | 617 | if (!c->isOnCurrentDesktop()) // we allowed explicit self-activation across virtual desktops | ||
618 | return false; // inside a client or if no client was active, but not otherwise | 618 | return false; // inside a client or if no client was active, but not otherwise | ||
619 | 619 | | |||
620 | // High FPS, not intr-client change. Only allow if the active client has only minor interest | 620 | // High FPS, not intr-client change. Only allow if the active client has only minor interest | ||
Show All 33 Lines | 653 | if (level == 0) // none | |||
654 | return true; | 654 | return true; | ||
655 | if (level == 4) // extreme | 655 | if (level == 4) // extreme | ||
656 | return false; | 656 | return false; | ||
657 | if (ac == NULL || ac->isDesktop()) { | 657 | if (ac == NULL || ac->isDesktop()) { | ||
658 | qCDebug(KWIN_CORE) << "Raising: No client active, allowing"; | 658 | qCDebug(KWIN_CORE) << "Raising: No client active, allowing"; | ||
659 | return true; // no active client -> always allow | 659 | return true; // no active client -> always allow | ||
660 | } | 660 | } | ||
661 | // TODO window urgency -> return true? | 661 | // TODO window urgency -> return true? | ||
662 | if (AbstractClient::belongToSameApplication(c, ac, true)) { | 662 | if (AbstractClient::belongToSameApplication(c, ac, AbstractClient::SameApplicationCheck::RelaxedForActive)) { | ||
663 | qCDebug(KWIN_CORE) << "Raising: Belongs to active application"; | 663 | qCDebug(KWIN_CORE) << "Raising: Belongs to active application"; | ||
664 | return true; | 664 | return true; | ||
665 | } | 665 | } | ||
666 | if (level == 3) // high | 666 | if (level == 3) // high | ||
667 | return false; | 667 | return false; | ||
668 | xcb_timestamp_t user_time = ac->userTime(); | 668 | xcb_timestamp_t user_time = ac->userTime(); | ||
669 | qCDebug(KWIN_CORE) << "Raising, compared:" << time << ":" << user_time | 669 | qCDebug(KWIN_CORE) << "Raising, compared:" << time << ":" << user_time | ||
670 | << ":" << (NET::timestampCompare(time, user_time) >= 0); | 670 | << ":" << (NET::timestampCompare(time, user_time) >= 0); | ||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 747 | if (time == -1U) { | |||
748 | // The window doesn't have any timestamp. | 748 | // The window doesn't have any timestamp. | ||
749 | // If it's the first window for its application | 749 | // If it's the first window for its application | ||
750 | // (i.e. there's no other window from the same app), | 750 | // (i.e. there's no other window from the same app), | ||
751 | // use the _KDE_NET_WM_USER_CREATION_TIME trick. | 751 | // use the _KDE_NET_WM_USER_CREATION_TIME trick. | ||
752 | // Otherwise, refuse activation of a window | 752 | // Otherwise, refuse activation of a window | ||
753 | // from already running application if this application | 753 | // from already running application if this application | ||
754 | // is not the active one (unless focus stealing prevention is turned off). | 754 | // is not the active one (unless focus stealing prevention is turned off). | ||
755 | Client* act = dynamic_cast<Client*>(workspace()->mostRecentlyActivatedClient()); | 755 | Client* act = dynamic_cast<Client*>(workspace()->mostRecentlyActivatedClient()); | ||
756 | if (act != NULL && !belongToSameApplication(act, this, true)) { | 756 | if (act != NULL && !belongToSameApplication(act, this, SameApplicationCheck::RelaxedForActive)) { | ||
757 | bool first_window = true; | 757 | bool first_window = true; | ||
758 | auto sameApplicationActiveHackPredicate = [this](const Client *cl) { | 758 | auto sameApplicationActiveHackPredicate = [this](const Client *cl) { | ||
759 | // ignore already existing splashes, toolbars, utilities and menus, | 759 | // ignore already existing splashes, toolbars, utilities and menus, | ||
760 | // as the app may show those before the main window | 760 | // as the app may show those before the main window | ||
761 | return !cl->isSplash() && !cl->isToolbar() && !cl->isUtility() && !cl->isMenu() | 761 | return !cl->isSplash() && !cl->isToolbar() && !cl->isUtility() && !cl->isMenu() | ||
762 | && cl != this && Client::belongToSameApplication(cl, this, true); | 762 | && cl != this && Client::belongToSameApplication(cl, this, SameApplicationCheck::RelaxedForActive); | ||
763 | }; | 763 | }; | ||
764 | if (isTransient()) { | 764 | if (isTransient()) { | ||
765 | auto clientMainClients = [this] () -> ClientList { | 765 | auto clientMainClients = [this] () -> ClientList { | ||
766 | ClientList ret; | 766 | ClientList ret; | ||
767 | const auto mcs = mainClients(); | 767 | const auto mcs = mainClients(); | ||
768 | for (auto mc: mcs) { | 768 | for (auto mc: mcs) { | ||
769 | if (Client *c = dynamic_cast<Client*>(mc)) { | 769 | if (Client *c = dynamic_cast<Client*>(mc)) { | ||
770 | ret << c; | 770 | ret << c; | ||
▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines |