From 6119a7c6303b5ccb4ba26800002e391e23263a9b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 6 Jul 2020 17:22:25 +0200 Subject: [PATCH] Suppress warnings about deprecated pango_xft_get_context() We can still use it as long as it exists, there is no benefit whatsoever in using the new functions as the old one does exactly the same thing anyhow. --- src/x11/app.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/x11/app.cpp b/src/x11/app.cpp index b7c8a12636..6b88ce9e96 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -721,8 +721,16 @@ PangoContext* wxApp::GetPangoContext() Display *dpy = wxGlobalDisplay(); int xscreen = DefaultScreen(dpy); + // Calling pango_xft_get_context() is exactly the same as doing + // pango_font_map_create_context(pango_xft_get_font_map(dpy, xscreen)) + // so continue to use it even if it's deprecated to not bother with + // checking for Pango 1.2 in configure and just disable the warning. + wxGCC_WARNING_SUPPRESS(deprecated-declarations) + s_pangoContext = pango_xft_get_context(dpy, xscreen); + wxGCC_WARNING_RESTORE(deprecated-declarations) + if (!PANGO_IS_CONTEXT(s_pangoContext)) { wxLogError( wxT("No pango context.") );