Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
2a19bb85
Kaydet (Commit)
2a19bb85
authored
Tem 13, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
GTK3 HiDPI: disable window scaling and get display DPI via GTK3
Change-Id: I66b92146757352408a331f9e23289839f443ff79
üst
07ff2841
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
0 deletions
+38
-0
gtkgdi.hxx
vcl/inc/unx/gtk/gtkgdi.hxx
+1
-0
gtkdata.cxx
vcl/unx/gtk/app/gtkdata.cxx
+19
-0
gtk3salnativewidgets-gtk.cxx
vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+18
-0
No files found.
vcl/inc/unx/gtk/gtkgdi.hxx
Dosyayı görüntüle @
2a19bb85
...
@@ -61,6 +61,7 @@ public:
...
@@ -61,6 +61,7 @@ public:
cairo_t
*
getCairoContext
()
const
;
cairo_t
*
getCairoContext
()
const
;
virtual
void
GetResolution
(
sal_Int32
&
rDPIX
,
sal_Int32
&
rDPIY
)
SAL_OVERRIDE
;
private
:
private
:
GtkWidget
*
mpWindow
;
GtkWidget
*
mpWindow
;
static
GtkStyleContext
*
mpButtonStyle
;
static
GtkStyleContext
*
mpButtonStyle
;
...
...
vcl/unx/gtk/app/gtkdata.cxx
Dosyayı görüntüle @
2a19bb85
...
@@ -46,6 +46,12 @@
...
@@ -46,6 +46,12 @@
#include <vcl/svapp.hxx>
#include <vcl/svapp.hxx>
#if GTK_CHECK_VERSION(3,10,0)
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
#endif
using
namespace
vcl_sal
;
using
namespace
vcl_sal
;
/***************************************************************
/***************************************************************
...
@@ -87,6 +93,19 @@ GtkSalDisplay::GtkSalDisplay( GdkDisplay* pDisplay ) :
...
@@ -87,6 +93,19 @@ GtkSalDisplay::GtkSalDisplay( GdkDisplay* pDisplay ) :
#else
#else
m_bX11Display
=
true
;
m_bX11Display
=
true
;
#endif
#endif
#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
);
}
}
#endif
#endif
}
}
GtkSalDisplay
::~
GtkSalDisplay
()
GtkSalDisplay
::~
GtkSalDisplay
()
...
...
vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
Dosyayı görüntüle @
2a19bb85
...
@@ -2100,4 +2100,22 @@ cairo_t* GtkSalGraphics::getCairoContext() const
...
@@ -2100,4 +2100,22 @@ cairo_t* GtkSalGraphics::getCairoContext() const
return
mpFrame
->
getCairoContext
();
return
mpFrame
->
getCairoContext
();
}
}
void
GtkSalGraphics
::
GetResolution
(
sal_Int32
&
rDPIX
,
sal_Int32
&
rDPIY
)
{
GdkScreen
*
pScreen
=
gtk_widget_get_screen
(
mpWindow
);
double
fResolution
=
-
1.0
;
g_object_get
(
pScreen
,
"resolution"
,
&
fResolution
,
nullptr
);
int
nScaleFactor
=
1
;
#if GTK_CHECK_VERSION(3, 10, 0)
nScaleFactor
=
gdk_window_get_scale_factor
(
widget_get_window
(
mpWindow
));
#endif
if
(
fResolution
>
0.0
)
rDPIX
=
rDPIY
=
sal_Int32
(
fResolution
*
nScaleFactor
);
else
rDPIX
=
rDPIY
=
96
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment