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