Date: Sunday, November 27, 2016 @ 16:27:50 Author: tensor5 Revision: 197035
upgpkg: electron 1.4.8-2 Revert to using GDK_SCALE for HiDPI. Added: electron/trunk/chromium-gtk3.patch Modified: electron/trunk/PKGBUILD Deleted: electron/trunk/chromium-gtk3-hidpi.patch electron/trunk/chromium-gtk3-use-x11-backend.patch -------------------------------------+ PKGBUILD | 11 ++----- chromium-gtk3-hidpi.patch | 49 ---------------------------------- chromium-gtk3-use-x11-backend.patch | 12 -------- chromium-gtk3.patch | 13 +++++++++ 4 files changed, 17 insertions(+), 68 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2016-11-27 15:19:05 UTC (rev 197034) +++ PKGBUILD 2016-11-27 16:27:50 UTC (rev 197035) @@ -4,7 +4,7 @@ _chromiumver=53.0.2785.143 pkgname=electron pkgver=1.4.8 -pkgrel=1 +pkgrel=2 pkgdesc='Build cross platform desktop apps with web technologies' arch=('i686' 'x86_64') url='http://electron.atom.io/' @@ -50,8 +50,7 @@ 'libchromiumcontent-use-system-ffmpeg.patch' 'libchromiumcontent-use-system-tools.patch' 'chromium-cups.patch' - 'chromium-gtk3-hidpi.patch' - 'chromium-gtk3-use-x11-backend.patch' + 'chromium-gtk3.patch' 'chromium-unset-madv_free.patch' 'chromium-use-system-ffmpeg.patch' 'chromium-use-system-minizip.patch' @@ -90,8 +89,7 @@ '56522aeb26fc5d6d70ed2b476e292b0ac24740f64e9e0384b501ba648bb8d9fa' '2fb2157c854dab173a2ef9b4aa0ab5bb3c0dd077447c4719c7554eee6e0546b6' 'f0db776be86c01020c6d28c9b4d2f53391692698231655003dcde43dea4eacb6' - '697767af13945702e57a182db561493d5fee431e82b17a776afe7fa1226ce353' - '9fd584d6198b915ad35198d1fcb6318e5ecb43b0befca95384148a305e2954dd' + '5573da0c0f1120ecbc0b20798c7342a06a978bb39d4e4362ea465244a8683c5f' 'ccba3002243fb1f9a67c8a60af310706caa591d12aef45f1d0f4bda47626f3ab' '7cda59fe372b37beca079adf55b951b4f3a6c7a5490813b729fa145562d2ba12' 'bc78d7af8e514ea28caa6c6ccaf78cc3e80044ef862e2ca7978439f183e36179' @@ -188,8 +186,7 @@ fi cd src patch -Np1 -i "${srcdir}"/chromium-cups.patch # fixes build with CUPS 2.2 - patch -Np1 -i "${srcdir}"/chromium-gtk3-hidpi.patch - patch -Np1 -i "${srcdir}"/chromium-gtk3-use-x11-backend.patch + patch -Np1 -i "${srcdir}"/chromium-gtk3.patch patch -Np1 -i "${srcdir}"/chromium-unset-madv_free.patch # fixes crash with kernels < 4.5 patch -Np1 -i "${srcdir}"/chromium-use-system-ffmpeg.patch patch -Np1 -i "${srcdir}"/chromium-use-system-minizip.patch Deleted: chromium-gtk3-hidpi.patch =================================================================== --- chromium-gtk3-hidpi.patch 2016-11-27 15:19:05 UTC (rev 197034) +++ chromium-gtk3-hidpi.patch 2016-11-27 16:27:50 UTC (rev 197035) @@ -1,49 +0,0 @@ ---- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc -+++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc -@@ -454,12 +454,18 @@ - - // Queries GTK for its font DPI setting and returns the number of pixels in a - // point. -+#if GTK_MAJOR_VERSION == 2 - double GetPixelsInPoint(float device_scale_factor) { -+#else -+double GetPixelsInPoint() { -+#endif - double dpi = GetDPI(); - -+#if GTK_MAJOR_VERSION == 2 - // Take device_scale_factor into account — if Chrome already scales the - // entire UI up by 2x, we should not also scale up. - dpi /= device_scale_factor; -+#endif - - // There are 72 points in an inch. - return dpi / 72.0; -@@ -1371,8 +1377,13 @@ - // Round the value when converting to pixels to match GTK's logic. - const double size_points = pango_font_description_get_size(desc) / - static_cast<double>(PANGO_SCALE); -+#if GTK_MAJOR_VERSION == 2 - default_font_size_pixels_ = static_cast<int>( - GetPixelsInPoint(device_scale_factor_) * size_points + 0.5); -+#else -+ default_font_size_pixels_ = static_cast<int>( -+ GetPixelsInPoint() * size_points + 0.5); -+#endif - query.point_size = static_cast<int>(size_points); - } - -@@ -1405,8 +1416,13 @@ - float Gtk2UI::GetDeviceScaleFactor() const { - if (display::Display::HasForceDeviceScaleFactor()) - return display::Display::GetForcedDeviceScaleFactor(); -+#if GTK_MAJOR_VERSION == 2 - const int kCSSDefaultDPI = 96; - const float scale = GetDPI() / kCSSDefaultDPI; -+#else -+ const float scale = static_cast<float>(gdk_window_get_scale_factor( -+ gdk_screen_get_root_window(gdk_screen_get_default()))); -+#endif - - // Blacklist scaling factors <130% (crbug.com/484400) and round - // to 1 decimal to prevent rendering problems (crbug.com/485183). Deleted: chromium-gtk3-use-x11-backend.patch =================================================================== --- chromium-gtk3-use-x11-backend.patch 2016-11-27 15:19:05 UTC (rev 197034) +++ chromium-gtk3-use-x11-backend.patch 2016-11-27 16:27:50 UTC (rev 197035) @@ -1,12 +0,0 @@ ---- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc -+++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc -@@ -488,6 +488,9 @@ - default_font_weight_(gfx::Font::Weight::NORMAL), - middle_click_action_(GetDefaultMiddleClickAction()), - device_scale_factor_(1.0) { -+#if GTK_MAJOR_VERSION > 2 -+ gdk_set_allowed_backends("x11"); -+#endif - GtkInitFromCommandLine(*base::CommandLine::ForCurrentProcess()); - } - Added: chromium-gtk3.patch =================================================================== --- chromium-gtk3.patch (rev 0) +++ chromium-gtk3.patch 2016-11-27 16:27:50 UTC (rev 197035) @@ -0,0 +1,13 @@ +--- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc ++++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc +@@ -488,6 +488,10 @@ + default_font_weight_(gfx::Font::Weight::NORMAL), + middle_click_action_(GetDefaultMiddleClickAction()), + device_scale_factor_(1.0) { ++#if GTK_MAJOR_VERSION > 2 ++ g_setenv("GDK_SCALE", "1", FALSE); ++ gdk_set_allowed_backends("x11"); ++#endif + GtkInitFromCommandLine(*base::CommandLine::ForCurrentProcess()); + } +