Changeset View
Changeset View
Standalone View
Standalone View
manage.cpp
Show First 20 Lines • Show All 590 Lines • ▼ Show 20 Line(s) | 590 | if (isShown(true)) { | |||
---|---|---|---|---|---|
591 | bool allow; | 591 | bool allow; | ||
592 | if (session) | 592 | if (session) | ||
593 | allow = session->active && | 593 | allow = session->active && | ||
594 | (!workspace()->wasUserInteraction() || workspace()->activeClient() == NULL || | 594 | (!workspace()->wasUserInteraction() || workspace()->activeClient() == NULL || | ||
595 | workspace()->activeClient()->isDesktop()); | 595 | workspace()->activeClient()->isDesktop()); | ||
596 | else | 596 | else | ||
597 | allow = workspace()->allowClientActivation(this, userTime(), false); | 597 | allow = workspace()->allowClientActivation(this, userTime(), false); | ||
598 | 598 | | |||
599 | if (!(isMapped || session)) { | 599 | // If session saving, force showing new windows (i.e. "save file?" dialogs etc.) | ||
600 | if (workspace()->sessionSaving()) { | | |||
601 | /* | | |||
602 | * If we get a new window during session saving, we assume it's some 'save file?' dialog | | |||
603 | * which the user really needs to see (to know why logout's stalled). | | |||
604 | * | | |||
605 | * Given the current session management protocol, I can't see a nicer way of doing this. | | |||
606 | * Someday I'd like to see a protocol that tells the windowmanager who's doing SessionInteract. | | |||
607 | */ | | |||
608 | needsSessionInteract = true; | | |||
609 | //show the parent too | | |||
610 | auto mainclients = mainClients(); | | |||
611 | for (auto it = mainclients.constBegin(); | | |||
612 | it != mainclients.constEnd(); ++it) { | | |||
613 | if (Client *mc = dynamic_cast<Client*>((*it))) { | | |||
614 | mc->setSessionInteract(true); | | |||
615 | } | | |||
616 | (*it)->unminimize(); | | |||
617 | } | | |||
618 | } else if (allow) { | | |||
619 | // also force if activation is allowed | 600 | // also force if activation is allowed | ||
620 | if (!isOnCurrentDesktop() && options->focusPolicyIsReasonable()) { | 601 | if( !isOnCurrentDesktop() && !isMapped && !session && ( allow || workspace()->sessionSaving() )) | ||
621 | VirtualDesktopManager::self()->setCurrent(desktop()); | 602 | VirtualDesktopManager::self()->setCurrent( desktop()); | ||
622 | } | | |||
623 | /*if (!isOnCurrentActivity()) { | | |||
624 | workspace()->setCurrentActivity( activities().first() ); | | |||
625 | } FIXME no such method*/ | | |||
626 | } | | |||
627 | } | | |||
628 | 603 | | |||
629 | if (isOnCurrentDesktop() && !isMapped && !allow && (!session || session->stackingOrder < 0)) | 604 | if (isOnCurrentDesktop() && !isMapped && !allow && (!session || session->stackingOrder < 0)) | ||
630 | workspace()->restackClientUnderActive(this); | 605 | workspace()->restackClientUnderActive(this); | ||
631 | 606 | | |||
632 | updateVisibility(); | 607 | updateVisibility(); | ||
633 | 608 | | |||
634 | if (!isMapped) { | 609 | if (!isMapped) { | ||
635 | if (allow && isOnCurrentDesktop()) { | 610 | if (allow && isOnCurrentDesktop()) { | ||
▲ Show 20 Lines • Show All 171 Lines • Show Last 20 Lines |