vcl/unx/gtk3/gtkframe.cxx |   21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

New commits:
commit f162a9210d48efff096d8de8ae08cc4d0b6e30e5
Author:     Caolán McNamara <[email protected]>
AuthorDate: Thu Oct 10 11:56:35 2024 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sat Oct 12 21:56:24 2024 +0200

    tdf#161479 make presentation work on fractionally scaled display
    
    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 <[email protected]>
    (cherry picked from commit 4059c6351d9dc07ef2ab88149079cb2c59e22c32)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174782
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index a1b7f619983d..707c61fdc8bc 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -2477,8 +2477,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 )

Reply via email to