MCPcopy Create free account
hub / github.com/KDE/kwin / handleCustomQuickTileShortcut

Method handleCustomQuickTileShortcut

src/window.cpp:3634–3670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3632}
3633
3634void Window::handleCustomQuickTileShortcut(QuickTileMode mode)
3635{
3636 if (mode == QuickTileFlag::None) {
3637 return;
3638 }
3639 // if window is not tiled already, set it to nearest one
3640 Tile *tileAtPoint = workspace()->rootTile(workspace()->outputAt(moveResizeGeometry().center()))->pick(moveResizeGeometry().center());
3641 if (!tileAtPoint) {
3642 return;
3643 }
3644 if (tileAtPoint != m_requestedTile) {
3645 tileAtPoint->manage(this);
3646 return;
3647 }
3648 const auto customTile = qobject_cast<CustomTile *>(tileAtPoint);
3649 if (!customTile) {
3650 return;
3651 }
3652 // Get the next tile that is not a layout tile from the edge
3653 Qt::Edge edge;
3654 if (mode & QuickTileFlag::Left) {
3655 edge = Qt::LeftEdge;
3656 }
3657 if (mode & QuickTileFlag::Right) {
3658 edge = Qt::RightEdge;
3659 }
3660 if (mode & QuickTileFlag::Top) {
3661 edge = Qt::TopEdge;
3662 }
3663 if (mode & QuickTileFlag::Bottom) {
3664 edge = Qt::BottomEdge;
3665 }
3666 CustomTile *next = customTile->nextNonLayoutTileAt(edge);
3667 if (next) {
3668 next->manage(this);
3669 }
3670}
3671
3672void Window::setQuickTileModeAtCurrentPosition(QuickTileMode mode)
3673{

Callers 2

shortcutsMethod · 0.80
customQuickTileWindowMethod · 0.80

Calls 7

workspaceFunction · 0.85
outputAtMethod · 0.80
nextNonLayoutTileAtMethod · 0.80
pickMethod · 0.45
rootTileMethod · 0.45
centerMethod · 0.45
manageMethod · 0.45

Tested by 1

shortcutsMethod · 0.64