From 4059c6351d9dc07ef2ab88149079cb2c59e22c32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 10 Oct 2024 11:56:35 +0100 Subject: [PATCH] tdf#161479 make presentation work on fractionally scaled display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With fractional scaling on wayland the monitor sizes here are reported effectively with the fractional scaling factor rounded up to the next integer. So: 1920 x 1080 at 125% scaling which appears like, 1536 x 864 is reported the same as 200% scaling, i.e. 960 x 540 So using these values as constraints for GDK_HINT_MAX_SIZE with gtk_window_set_geometry_hints for m_bFullscreen are too small to allow filling the screen. Seeing as this was introduced as a workaround in the first place, drop the workaround under wayland. Change-Id: I7acfc929755728bbf77731d040f1f0f66cac836c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174761 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/unx/gtk3/gtkframe.cxx | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx index 7f812e1dd894..600276791e69 100644 --- a/vcl/unx/gtk3/gtkframe.cxx +++ b/vcl/unx/gtk3/gtkframe.cxx @@ -2473,8 +2473,25 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, SetType eType, tools::Rect // #i110881# for the benefit of compiz set a max size here // else setting to fullscreen fails for unknown reasons - m_aMaxSize.setWidth( aNewMonitor.width ); - m_aMaxSize.setHeight( aNewMonitor.height ); + // + // tdf#161479 With fractional scaling on wayland the monitor + // sizes here are reported effectively with the fractional + // scaling factor rounded up to the next integer, so, + // 1920 x 1080 at 125% scaling which appears like, + // 1536 x 864 is reported the same as 200% scaling, i.e. + // 960 x 540 which causes a problem on trying to set + // fullscreen on fractional scaling under wayland. Drop + // this old workaround when under wayland. +#if defined(GDK_WINDOWING_WAYLAND) + const bool bWayland = DLSYM_GDK_IS_WAYLAND_DISPLAY(GtkSalFrame::getGdkDisplay()); +#else + const bool bWayland = false; +#endif + if (!bWayland) + { + m_aMaxSize.setWidth( aNewMonitor.width ); + m_aMaxSize.setHeight( aNewMonitor.height ); + } } if( pSize && eType == SetType::UnFullscreen )