Skip to content

Commit

Permalink
qt: do not try to restore window geometry after exiting full-screen
Browse files Browse the repository at this point in the history
On X11, Wayland, Windows the window itself restores the old geometry
when it is no longer fullscreen. There is no need to manually restore
the geometry, and it causes issues on certain platforms such as Wayland
where clients do not have authority on window placement with xdg-shell.
  • Loading branch information
fuzun authored and robUx4 committed Nov 2, 2024
1 parent 2701486 commit 04efc4c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
9 changes: 1 addition & 8 deletions modules/gui/qt/maininterface/video_window_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ void VideoWindowHandler::setVideoFullScreen( bool fs )
m_videoFullScreen = fs;
if( fs )
{
m_lastWinGeometry = m_window->geometry();

int numscreen = var_InheritInteger( m_intf, "qt-fullscreen-screennumber" );

auto screenList = QApplication::screens();
Expand All @@ -141,15 +139,10 @@ void VideoWindowHandler::setVideoFullScreen( bool fs )
}
else
{
bool hold = WindowStateHolder::holdFullscreen(m_window, WindowStateHolder::VIDEO, false);
WindowStateHolder::holdFullscreen(m_window, WindowStateHolder::VIDEO, false);

if( m_lastWinScreen != NULL && !m_hasWayland )
m_window->setScreen(m_lastWinScreen);
if( !hold && m_lastWinGeometry.isNull() == false )
{
m_window->setGeometry( m_lastWinGeometry );
m_lastWinGeometry = QRect();
}
}
}

Expand Down
1 change: 0 additions & 1 deletion modules/gui/qt/maininterface/video_window_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ protected slots:
bool m_videoFullScreen = false;
bool m_autoresize = false;

QRect m_lastWinGeometry;
QScreen* m_lastWinScreen = nullptr;

bool m_hasWayland = false;
Expand Down

0 comments on commit 04efc4c

Please sign in to comment.