[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - vcl/inc vcl/unx

Caolán McNamara caolanm at redhat.com
Sun Dec 11 16:33:03 UTC 2016


 vcl/inc/unx/gtk/gtkdata.hxx               |    2 --
 vcl/unx/gtk/gtkdata.cxx                   |    1 -
 vcl/unx/gtk3/gtk3gtkdata.cxx              |   14 --------------
 vcl/unx/gtk3/gtk3gtkframe.cxx             |    2 +-
 vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx |    8 +-------
 5 files changed, 2 insertions(+), 25 deletions(-)

New commits:
commit abf54716da33b8252c32b545bd02b33eef3b9a07
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 24 10:19:43 2016 +0000

    Resolves: rhbz#1362453 use the cairo scaling approach on both wayland and X
    
    so have the same hidpi solution on both setups
    
    Change-Id: I669eba55830a28c1850f4679dfa824798bd3a383
    Reviewed-on: https://gerrit.libreoffice.org/31540
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>
    (cherry picked from commit 3a9609653697ac851ee1c55a41aa143d3bca335e)
    Reviewed-on: https://gerrit.libreoffice.org/31836
    Tested-by: Khaled Hosny <khaledhosny at eglug.org>

diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx
index c59d7a2..ffb0fb7 100644
--- a/vcl/inc/unx/gtk/gtkdata.hxx
+++ b/vcl/inc/unx/gtk/gtkdata.hxx
@@ -137,7 +137,6 @@ class GtkSalDisplay : public SalDisplay
     o3tl::enumarray<PointerStyle, GdkCursor*> m_aCursors;
     bool                            m_bStartupCompleted;
     bool                            m_bX11Display;
-    bool                            m_bOwnHiDpiScale;
 
     GdkCursor* getFromXBM( const unsigned char *pBitmap, const unsigned char *pMask,
                            int nWidth, int nHeight, int nXHot, int nYHot );
@@ -147,7 +146,6 @@ public:
 
     GdkDisplay* GetGdkDisplay() const { return m_pGdkDisplay; }
     bool        IsX11Display() const { return m_bX11Display; }
-    bool        IsOwnHiDpiScale() const { return m_bOwnHiDpiScale; }
 
     GtkSalSystem* getSystem() const { return m_pSys; }
 
diff --git a/vcl/unx/gtk/gtkdata.cxx b/vcl/unx/gtk/gtkdata.cxx
index 2de555e..e621f47 100644
--- a/vcl/unx/gtk/gtkdata.cxx
+++ b/vcl/unx/gtk/gtkdata.cxx
@@ -80,7 +80,6 @@ GtkSalDisplay::GtkSalDisplay( GdkDisplay* pDisplay ) :
         GetGenericData()->ErrorTrapPush(); // and leak the trap
 
     m_bX11Display = true;
-    m_bOwnHiDpiScale = true;
 
     gtk_widget_set_default_direction(AllSettings::GetLayoutRTL() ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
 }
diff --git a/vcl/unx/gtk3/gtk3gtkdata.cxx b/vcl/unx/gtk3/gtk3gtkdata.cxx
index 464a865..f911d38 100644
--- a/vcl/unx/gtk3/gtk3gtkdata.cxx
+++ b/vcl/unx/gtk3/gtk3gtkdata.cxx
@@ -83,20 +83,6 @@ GtkSalDisplay::GtkSalDisplay( GdkDisplay* pDisplay ) :
         GetGenericData()->ErrorTrapPush(); // and leak the trap
 
     m_bX11Display = GDK_IS_X11_DISPLAY( m_pGdkDisplay );
-    m_bOwnHiDpiScale = false;
-
-#if GTK_CHECK_VERSION(3,10,0)
-#ifdef GDK_WINDOWING_X11
-    if (m_bX11Display)
-    {
-        if (!getenv("GDK_SCALE"))
-        {
-            gdk_x11_display_set_window_scale(m_pGdkDisplay, 1);
-            m_bOwnHiDpiScale = true;
-        }
-    }
-#endif
-#endif
 
     gtk_widget_set_default_direction(AllSettings::GetLayoutRTL() ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
 }
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index eb8b718..ab10260 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -1576,7 +1576,7 @@ void GtkSalFrame::AllocateFrame()
 
 #if GTK_CHECK_VERSION(3,10,0)
 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
-        int scale = getDisplay()->IsOwnHiDpiScale() ? 1 : gtk_widget_get_scale_factor(m_pWindow);
+        int scale = gtk_widget_get_scale_factor(m_pWindow);
 #else
         int scale = 1;
 #endif
diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index f8be136..8b654d9 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -3123,14 +3123,8 @@ void GtkSalGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY)
     double fResolution = -1.0;
     g_object_get(pScreen, "resolution", &fResolution, nullptr);
 
-    int nScaleFactor = 1;
-
-#if GTK_CHECK_VERSION(3, 10, 0)
-    nScaleFactor = GtkSalFrame::getDisplay()->IsOwnHiDpiScale() ? gtk_widget_get_scale_factor(mpWindow) : 1;
-#endif
-
     if (fResolution > 0.0)
-        rDPIX = rDPIY = sal_Int32(fResolution * nScaleFactor);
+        rDPIX = rDPIY = sal_Int32(fResolution);
     else
         rDPIX = rDPIY = 96;
 }


More information about the Libreoffice-commits mailing list