| 3872 | } |
| 3873 | |
| 3874 | void 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 | |
| 3920 | void Window::checkWorkspacePosition(RectF oldGeometry, LogicalOutput *oldOutput) |
| 3921 | { |
no test coverage detected