Commit 5cfa4bae authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

wayland: Simplify xdg-shell's fullscreen mode implementation

XdgToplevelClient::setFullScreen() won't change the geometry
immediately, so workspace()->updateFocusMousePosition() can be removed.

Also, input handling code takes care of updating the cached mouse
position in the workspace.
parent 77f712d3
Pipeline #132700 passed with stage
in 27 minutes and 2 seconds
......@@ -1567,9 +1567,7 @@ void XdgToplevelClient::installPalette(ServerSideDecorationPaletteInterface *pal
void XdgToplevelClient::setFullScreen(bool set, bool user)
{
set = rules()->checkFullScreen(set);
const bool wasFullscreen = isRequestedFullScreen();
if (wasFullscreen == set) {
if (m_isRequestedFullScreen == set) {
return;
}
if (isSpecialWindow()) {
......@@ -1579,17 +1577,12 @@ void XdgToplevelClient::setFullScreen(bool set, bool user)
return;
}
if (wasFullscreen) {
workspace()->updateFocusMousePosition(Cursors::self()->mouse()->pos()); // may cause leave event
} else {
setFullscreenGeometryRestore(moveResizeGeometry());
}
m_isRequestedFullScreen = set;
configureDecoration();
if (set) {
const AbstractOutput *output = m_fullScreenRequestedOutput ? m_fullScreenRequestedOutput.data() : kwinApp()->platform()->outputAt(moveResizeGeometry().center());
setFullscreenGeometryRestore(moveResizeGeometry());
moveResize(workspace()->clientArea(FullScreenArea, this, output));
} else {
m_fullScreenRequestedOutput.clear();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment