Commit a5cdbe02 authored by Richard Pospesel's avatar Richard Pospesel Committed by Georg Koppen
Browse files

Bug 23970: Printing to a file is broken with Linux content sandboxing enabled

Ported over firefox patch 997c6b961cd0 (Bug 1329835)
parent 896ca711
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -769,17 +769,19 @@ PreparePattern(FcPattern* aPattern, bool aIsPrinterFont)
    } else {
#ifdef MOZ_WIDGET_GTK
        ApplyGdkScreenFontOptions(aPattern);
#endif

#ifdef MOZ_X11
        FcValue value;
        int lcdfilter;
        if (FcPatternGet(aPattern, FC_LCD_FILTER, 0, &value)
                == FcResultNoMatch &&
            GetXftInt(DefaultXDisplay(), "lcdfilter", &lcdfilter)) {
        if (FcPatternGet(aPattern, FC_LCD_FILTER, 0, &value) == FcResultNoMatch) {
            GdkDisplay* dpy = gdk_display_get_default();
            if (GDK_IS_X11_DISPLAY(dpy) &&
                GetXftInt(GDK_DISPLAY_XDISPLAY(dpy), "lcdfilter", &lcdfilter)) {
                FcPatternAddInteger(aPattern, FC_LCD_FILTER, lcdfilter);
            }
#endif
        }
#endif // MOZ_X11
#endif // MOZ_WIDGET_GTK
    }

    FcDefaultSubstitute(aPattern);