Ticket #23970: 0005-Bug-23970-Printing-to-a-file-is-broken-with-Linux-co.patch

File 0005-Bug-23970-Printing-to-a-file-is-broken-with-Linux-co.patch, 1.7 KB (added by pospeselr, 17 months ago)
  • gfx/thebes/gfxFcPlatformFontList.cpp

    From 40e654ea088da300ea517bfecbbc6e8446b8d41e Mon Sep 17 00:00:00 2001
    From: Richard Pospesel <richard@torproject.org>
    Date: Mon, 27 Nov 2017 15:04:21 -0800
    Subject: [PATCH 5/5] Bug 23970:  Printing to a file is broken with Linux
     content  sandboxing enabled
    
    Ported over firefox patch 997c6b961cd0 (Bug 1329835)
    ---
     gfx/thebes/gfxFcPlatformFontList.cpp | 16 +++++++++-------
     1 file changed, 9 insertions(+), 7 deletions(-)
    
    diff --git a/gfx/thebes/gfxFcPlatformFontList.cpp b/gfx/thebes/gfxFcPlatformFontList.cpp
    index 601e7a90cbd6..19471157ba84 100644
    a b PreparePattern(FcPattern* aPattern, bool aIsPrinterFont) 
    768768       FcPatternAddBool(aPattern, PRINTING_FC_PROPERTY, FcTrue);
    769769    } else {
    770770#ifdef MOZ_WIDGET_GTK
    771        ApplyGdkScreenFontOptions(aPattern);
    772 #endif
     771        ApplyGdkScreenFontOptions(aPattern);
    773772
    774773#ifdef MOZ_X11
    775774        FcValue value;
    776775        int lcdfilter;
    777         if (FcPatternGet(aPattern, FC_LCD_FILTER, 0, &value)
    778                 == FcResultNoMatch &&
    779             GetXftInt(DefaultXDisplay(), "lcdfilter", &lcdfilter)) {
    780             FcPatternAddInteger(aPattern, FC_LCD_FILTER, lcdfilter);
     776        if (FcPatternGet(aPattern, FC_LCD_FILTER, 0, &value) == FcResultNoMatch) {
     777            GdkDisplay* dpy = gdk_display_get_default();
     778            if (GDK_IS_X11_DISPLAY(dpy) &&
     779                GetXftInt(GDK_DISPLAY_XDISPLAY(dpy), "lcdfilter", &lcdfilter)) {
     780                FcPatternAddInteger(aPattern, FC_LCD_FILTER, lcdfilter);
     781            }
    781782        }
    782 #endif
     783#endif // MOZ_X11
     784#endif // MOZ_WIDGET_GTK
    783785    }
    784786
    785787    FcDefaultSubstitute(aPattern);