Changeset View
Changeset View
Standalone View
Standalone View
placement.cpp
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
43 | 43 | | |||
44 | Placement::Placement(QObject*) | 44 | Placement::Placement(QObject*) | ||
45 | { | 45 | { | ||
46 | reinitCascading(0); | 46 | reinitCascading(0); | ||
47 | } | 47 | } | ||
48 | 48 | | |||
49 | Placement::~Placement() | 49 | Placement::~Placement() | ||
50 | { | 50 | { | ||
51 | s_self = NULL; | 51 | s_self = nullptr; | ||
52 | } | 52 | } | ||
53 | 53 | | |||
54 | /** | 54 | /** | ||
55 | * Places the client \a c according to the workspace's layout policy | 55 | * Places the client \a c according to the workspace's layout policy | ||
56 | */ | 56 | */ | ||
57 | void Placement::place(AbstractClient *c, const QRect &area) | 57 | void Placement::place(AbstractClient *c, const QRect &area) | ||
58 | { | 58 | { | ||
59 | Policy policy = c->rules()->checkPlacement(Default); | 59 | Policy policy = c->rules()->checkPlacement(Default); | ||
▲ Show 20 Lines • Show All 497 Lines • ▼ Show 20 Line(s) | 546 | { | |||
557 | for (auto it = mainwindows.constBegin(); | 557 | for (auto it = mainwindows.constBegin(); | ||
558 | it != mainwindows.constEnd(); | 558 | it != mainwindows.constEnd(); | ||
559 | ++it) { | 559 | ++it) { | ||
560 | if (mainwindows.count() > 1 && (*it)->isSpecialWindow()) | 560 | if (mainwindows.count() > 1 && (*it)->isSpecialWindow()) | ||
561 | continue; // don't consider toolbars etc when placing | 561 | continue; // don't consider toolbars etc when placing | ||
562 | ++mains_count; | 562 | ++mains_count; | ||
563 | place_on2 = *it; | 563 | place_on2 = *it; | ||
564 | if ((*it)->isOnCurrentDesktop()) { | 564 | if ((*it)->isOnCurrentDesktop()) { | ||
565 | if (place_on == NULL) | 565 | if (place_on == nullptr) | ||
566 | place_on = *it; | 566 | place_on = *it; | ||
567 | else { | 567 | else { | ||
568 | // two or more on current desktop -> center | 568 | // two or more on current desktop -> center | ||
569 | // That's the default at least. However, with maximizing placement | 569 | // That's the default at least. However, with maximizing placement | ||
570 | // policy as the default, the dialog should be either maximized or | 570 | // policy as the default, the dialog should be either maximized or | ||
571 | // made as large as its maximum size and then placed centered. | 571 | // made as large as its maximum size and then placed centered. | ||
572 | // So the nextPlacement argument allows chaining. In this case, nextPlacement | 572 | // So the nextPlacement argument allows chaining. In this case, nextPlacement | ||
573 | // is Maximizing and it will call placeCentered(). | 573 | // is Maximizing and it will call placeCentered(). | ||
574 | place(c, area, Centered); | 574 | place(c, area, Centered); | ||
575 | return; | 575 | return; | ||
576 | } | 576 | } | ||
577 | } | 577 | } | ||
578 | } | 578 | } | ||
579 | if (place_on == NULL) { | 579 | if (place_on == nullptr) { | ||
580 | // 'mains_count' is used because it doesn't include ignored mainwindows | 580 | // 'mains_count' is used because it doesn't include ignored mainwindows | ||
581 | if (mains_count != 1) { | 581 | if (mains_count != 1) { | ||
582 | place(c, area, Centered); | 582 | place(c, area, Centered); | ||
583 | return; | 583 | return; | ||
584 | } | 584 | } | ||
585 | place_on = place_on2; // use the only window filtered together with 'mains_count' | 585 | place_on = place_on2; // use the only window filtered together with 'mains_count' | ||
586 | } | 586 | } | ||
587 | if (place_on->isDesktop()) { | 587 | if (place_on->isDesktop()) { | ||
▲ Show 20 Lines • Show All 370 Lines • Show Last 20 Lines |