Improve virtual desktop selection for transients

a) When a group-transient is modal, it still needs to be
   on the current or all virtual desktops if *any* of the
   blocked clients is

BUG: 354090
FIXED-IN: 5.5

b) ignore demanded virtual desktop for transients. Notably modal transients
   should appear where their parent is, and not drag that around. All others
   also better show up above their parent and not a distant virtual desktop

REVIEW: 125758
This commit is contained in:
Thomas Lübking 2015-10-22 23:46:19 +02:00
parent 76cd1fdc34
commit 7339e9639f

View file

@ -196,8 +196,10 @@ bool Client::manage(xcb_window_t w, bool isMapped)
for (ClientList::ConstIterator it = mainclients.constBegin();
it != mainclients.constEnd();
++it) {
if (mainclients.count() > 1 && (*it)->isSpecialWindow())
continue; // Don't consider toolbars etc when placing
if (mainclients.count() > 1 && // A group-transient
(*it)->isSpecialWindow() && // Don't consider toolbars etc when placing
!(info->state() & NET::Modal)) // except when it's modal (blocks specials as well)
continue;
maincl = *it;
if ((*it)->isOnCurrentDesktop())
on_current = true;
@ -213,11 +215,12 @@ bool Client::manage(xcb_window_t w, bool isMapped)
if (maincl)
setOnActivities(maincl->activities());
} else { // a transient shall appear on its leader and not drag that around
if (info->desktop())
desk = info->desktop(); // Window had the initial desktop property, force it
if (desktop() == 0 && asn_valid && asn_data.desktop() != 0)
desk = asn_data.desktop();
}
if (info->desktop())
desk = info->desktop(); // Window had the initial desktop property, force it
if (desktop() == 0 && asn_valid && asn_data.desktop() != 0)
desk = asn_data.desktop();
#ifdef KWIN_BUILD_ACTIVITIES
if (Activities::self() && !isMapped && !noborder && isNormalWindow() && !activitiesDefined) {
//a new, regular window, when we're not recovering from a crash,