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

Caolán McNamara caolanm at redhat.com
Sun Dec 11 23:19:28 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 104a31ea86ed3270ee5392bb09a66b4e063acb69
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>
    (cherry picked from commit abf54716da33b8252c32b545bd02b33eef3b9a07)
    Reviewed-on: https://gerrit.libreoffice.org/31876

diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx
index 98c96dd..037d213 100644
--- a/vcl/inc/unx/gtk/gtkdata.hxx
+++ b/vcl/inc/unx/gtk/gtkdata.hxx
@@ -138,7 +138,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 );
@@ -148,7 +147,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 3a22a6d..8db0513 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 4207995..d5cad5e 100644
--- a/vcl/unx/gtk3/gtk3gtkdata.cxx
+++ b/vcl/unx/gtk3/gtk3gtkdata.cxx
@@ -81,20 +81,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 17b9e27..d016d32 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 60fc82d..cdf4f08 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -3102,14 +3102,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