Changeset View
Changeset View
Standalone View
Standalone View
abstract_client.cpp
Show First 20 Lines • Show All 1505 Lines • ▼ Show 20 Line(s) | 1503 | for (int j = 0; j < screens()->count(); ++j) { | |||
---|---|---|---|---|---|
1506 | if (screens()->geometry(j).contains(pt)) { | 1506 | if (screens()->geometry(j).contains(pt)) { | ||
1507 | return true; | 1507 | return true; | ||
1508 | } | 1508 | } | ||
1509 | } | 1509 | } | ||
1510 | return false; | 1510 | return false; | ||
1511 | }; | 1511 | }; | ||
1512 | 1512 | | |||
1513 | QRect area = workspace()->clientArea(MaximizeArea, QPoint(xroot, yroot), desktop()); | 1513 | QRect area = workspace()->clientArea(MaximizeArea, QPoint(xroot, yroot), desktop()); | ||
1514 | if (options->electricBorderTiling()) { | 1514 | | ||
1515 | bool electricBorderTilingEnabled = options->electricBorderTiling() || options->electricBorderCornerTiling(); | ||||
1516 | if (electricBorderTilingEnabled) { | ||||
1515 | if (xroot <= area.x() + 20) { | 1517 | if (xroot <= area.x() + 20) { | ||
1516 | mode |= QuickTileFlag::Left; | 1518 | mode |= QuickTileFlag::Left; | ||
1517 | innerBorder = isInScreen(QPoint(area.x() - 1, yroot)); | 1519 | innerBorder = isInScreen(QPoint(area.x() - 1, yroot)); | ||
1518 | } else if (xroot >= area.x() + area.width() - 20) { | 1520 | } else if (xroot >= area.x() + area.width() - 20) { | ||
1519 | mode |= QuickTileFlag::Right; | 1521 | mode |= QuickTileFlag::Right; | ||
1520 | innerBorder = isInScreen(QPoint(area.right() + 1, yroot)); | 1522 | innerBorder = isInScreen(QPoint(area.right() + 1, yroot)); | ||
1521 | } | 1523 | } | ||
1522 | } | 1524 | } | ||
1523 | 1525 | | |||
1524 | if (mode != QuickTileMode(QuickTileFlag::None)) { | 1526 | if (mode != QuickTileMode(QuickTileFlag::None)) { | ||
1527 | if (options->electricBorderCornerTiling()) { | ||||
1525 | if (yroot <= area.y() + area.height() * options->electricBorderCornerRatio()) | 1528 | if (yroot <= area.y() + area.height() * options->electricBorderCornerRatio()) | ||
1526 | mode |= QuickTileFlag::Top; | 1529 | mode |= QuickTileFlag::Top; | ||
1527 | else if (yroot >= area.y() + area.height() - area.height() * options->electricBorderCornerRatio()) | 1530 | else if (yroot >= area.y() + area.height() - area.height() * options->electricBorderCornerRatio()) | ||
1528 | mode |= QuickTileFlag::Bottom; | 1531 | mode |= QuickTileFlag::Bottom; | ||
1532 | else if (!options->electricBorderTiling()) { // Discard middle border zones for corner only tiling | ||||
1533 | mode = QuickTileFlag::None; | ||||
1534 | innerBorder = false; | ||||
1535 | } | ||||
1536 | } | ||||
1529 | } else if (options->electricBorderMaximize() && yroot <= area.y() + 5 && isMaximizable()) { | 1537 | } else if (options->electricBorderMaximize() && yroot <= area.y() + 5 && isMaximizable()) { | ||
1530 | mode = QuickTileFlag::Maximize; | 1538 | mode = QuickTileFlag::Maximize; | ||
1531 | innerBorder = isInScreen(QPoint(xroot, area.y() - 1)); | 1539 | innerBorder = isInScreen(QPoint(xroot, area.y() - 1)); | ||
1532 | } | 1540 | } | ||
1533 | break; // no point in checking other screens to contain this... "point"... | 1541 | break; // no point in checking other screens to contain this... "point"... | ||
1534 | } | 1542 | } | ||
1535 | if (mode != electricBorderMode()) { | 1543 | if (mode != electricBorderMode()) { | ||
1536 | setElectricBorderMode(mode); | 1544 | setElectricBorderMode(mode); | ||
▲ Show 20 Lines • Show All 497 Lines • Show Last 20 Lines |