Changeset View
Changeset View
Standalone View
Standalone View
activation.cpp
Show First 20 Lines • Show All 552 Lines • ▼ Show 20 Line(s) | 549 | { | |||
---|---|---|---|---|---|
553 | // 2 - normal - focus stealing prevention is applied normally, when unsure, activation is not allowed, | 553 | // 2 - normal - focus stealing prevention is applied normally, when unsure, activation is not allowed, | ||
554 | // this is the default | 554 | // this is the default | ||
555 | // 3 - high - new window gets focus only if it belongs to the active application, | 555 | // 3 - high - new window gets focus only if it belongs to the active application, | ||
556 | // or when no window is currently active | 556 | // or when no window is currently active | ||
557 | // 4 - extreme - no window gets focus without user intervention | 557 | // 4 - extreme - no window gets focus without user intervention | ||
558 | if (time == -1U) | 558 | if (time == -1U) | ||
559 | time = c->userTime(); | 559 | time = c->userTime(); | ||
560 | int level = c->rules()->checkFSP(options->focusStealingPreventionLevel()); | 560 | int level = c->rules()->checkFSP(options->focusStealingPreventionLevel()); | ||
561 | if (session_saving && level <= FSP::Medium) { // <= normal | 561 | if (sessionManager()->state() == SessionState::Saving && level <= FSP::Medium) { // <= normal | ||
562 | return true; | 562 | return true; | ||
563 | } | 563 | } | ||
564 | AbstractClient* ac = mostRecentlyActivatedClient(); | 564 | AbstractClient* ac = mostRecentlyActivatedClient(); | ||
565 | if (focus_in) { | 565 | if (focus_in) { | ||
566 | if (should_get_focus.contains(const_cast< AbstractClient* >(c))) | 566 | if (should_get_focus.contains(const_cast< AbstractClient* >(c))) | ||
567 | return true; // FocusIn was result of KWin's action | 567 | return true; // FocusIn was result of KWin's action | ||
568 | // Before getting FocusIn, the active Client already | 568 | // Before getting FocusIn, the active Client already | ||
569 | // got FocusOut, and therefore got deactivated. | 569 | // got FocusOut, and therefore got deactivated. | ||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | |||||
630 | 630 | | |||
631 | // basically the same like allowClientActivation(), this time allowing | 631 | // basically the same like allowClientActivation(), this time allowing | ||
632 | // a window to be fully raised upon its own request (XRaiseWindow), | 632 | // a window to be fully raised upon its own request (XRaiseWindow), | ||
633 | // if refused, it will be raised only on top of windows belonging | 633 | // if refused, it will be raised only on top of windows belonging | ||
634 | // to the same application | 634 | // to the same application | ||
635 | bool Workspace::allowFullClientRaising(const KWin::AbstractClient *c, xcb_timestamp_t time) | 635 | bool Workspace::allowFullClientRaising(const KWin::AbstractClient *c, xcb_timestamp_t time) | ||
636 | { | 636 | { | ||
637 | int level = c->rules()->checkFSP(options->focusStealingPreventionLevel()); | 637 | int level = c->rules()->checkFSP(options->focusStealingPreventionLevel()); | ||
638 | if (session_saving && level <= 2) { // <= normal | 638 | if (sessionManager()->state() == SessionState::Saving && level <= 2) { // <= normal | ||
639 | return true; | 639 | return true; | ||
640 | } | 640 | } | ||
641 | AbstractClient* ac = mostRecentlyActivatedClient(); | 641 | AbstractClient* ac = mostRecentlyActivatedClient(); | ||
642 | if (level == 0) // none | 642 | if (level == 0) // none | ||
643 | return true; | 643 | return true; | ||
644 | if (level == 4) // extreme | 644 | if (level == 4) // extreme | ||
645 | return false; | 645 | return false; | ||
646 | if (ac == nullptr || ac->isDesktop()) { | 646 | if (ac == nullptr || ac->isDesktop()) { | ||
▲ Show 20 Lines • Show All 237 Lines • Show Last 20 Lines |