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

Method sendToOutput

src/window.cpp:3874–3918  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3872}
3873
3874void Window::sendToOutput(LogicalOutput *newOutput)
3875{
3876 newOutput = rules()->checkOutput(newOutput);
3877 if (isActive()) {
3878 workspace()->setActiveOutput(newOutput);
3879 // might impact the layer of a fullscreen window
3880 const auto windows = workspace()->windows();
3881 for (Window *other : windows) {
3882 if (other->isFullScreen() && other->output() == newOutput) {
3883 other->updateLayer();
3884 }
3885 }
3886 }
3887 if (moveResizeOutput() == newOutput) {
3888 return;
3889 }
3890
3891 LogicalOutput *oldOutput = m_output;
3892 const RectF oldGeom = moveResizeGeometry();
3893 const RectF oldScreenArea = workspace()->clientArea(MaximizeArea, this, moveResizeOutput());
3894 const RectF screenArea = workspace()->clientArea(MaximizeArea, this, newOutput);
3895
3896 if (requestedQuickTileMode() == QuickTileMode(QuickTileFlag::Custom)) {
3897 workspace()->tileManager(moveResizeOutput())->forgetWindow(this, nullptr);
3898 } else {
3899 Tile *newTile = workspace()->tileManager(newOutput)->quickTile(requestedQuickTileMode());
3900 if (newTile) {
3901 newTile->manage(this);
3902 }
3903 }
3904
3905 RectF newGeom = moveToArea(oldGeom, oldScreenArea, screenArea);
3906 newGeom = ensureSpecialStateGeometry(newGeom);
3907 moveResize(newGeom);
3908
3909 // move geometry restores to the new output as well
3910 setFullscreenGeometryRestore(moveToArea(m_fullscreenGeometryRestore, oldScreenArea, screenArea));
3911 setGeometryRestore(moveToArea(m_maximizeGeometryRestore, oldScreenArea, screenArea));
3912
3913 auto tso = workspace()->ensureStackingOrder(transients());
3914 for (auto it = tso.constBegin(), end = tso.constEnd(); it != end; ++it) {
3915 (*it)->sendToOutput(newOutput);
3916 }
3917 finishInteractiveOutputChange(oldOutput);
3918}
3919
3920void Window::checkWorkspacePosition(RectF oldGeometry, LogicalOutput *oldOutput)
3921{

Callers 10

slotWindowToScreenMethod · 0.45
sendClientToScreenMethod · 0.45
windowToScreenMethod · 0.45

Calls 15

rulesFunction · 0.85
isActiveFunction · 0.85
workspaceFunction · 0.85
setActiveOutputMethod · 0.80
updateLayerMethod · 0.80
forgetWindowMethod · 0.80
tileManagerMethod · 0.80
quickTileMethod · 0.80
ensureStackingOrderMethod · 0.80
checkOutputMethod · 0.45
windowsMethod · 0.45
isFullScreenMethod · 0.45

Tested by

no test coverage detected