1 From e13d28ee5d8724fc4b22f26bce01a7d36355f272 Mon Sep 17 00:00:00 2001
2 From: "Owen W. Taylor" <otaylor@fishsoup.net>
3 Date: Fri, 26 Aug 2016 11:44:55 -0400
4 Subject: Check for either xfont.pc or xfont2.pc
6 More recent versions of Xfont have a different API (with namespacing
7 for libXfont functions.) Check for xfont2.pc and if found, use that, and
8 use the new API. The rational for preferring libXfont2 is that as a recent
9 change the xserver module looks for and requires libXfont2, and it's better
10 not to have both versions of the library in process.
13 https://cgit.freedesktop.org/xorg/driver/xf86-video-qxl/commit/?id=e13d28ee5d8724fc4b22f26bce01a7d36355f272
15 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
17 diff --git a/configure.ac b/configure.ac
18 index 7e95b01..451d42a 100644
21 @@ -60,8 +60,14 @@ XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
22 XORG_DRIVER_CHECK_EXT(XV, videoproto)
23 XORG_DRIVER_CHECK_EXT(XFreeXDGA, xf86dgaproto)
25 +# We can use either version 1 or version 2 of libXfont
26 +PKG_CHECK_EXISTS(xfont2,
28 + AC_DEFINE(HAVE_XFONT2,1,[Version 2 of the libXfont library])],
31 # Obtain compiler/linker options for the driver dependencies
32 -PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto fontsproto xfont $REQUIRED_MODULES)
33 +PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto fontsproto $xfont_pc $REQUIRED_MODULES)
37 diff --git a/src/uxa/uxa-damage.c b/src/uxa/uxa-damage.c
38 index a6d1ee3..6afb346 100644
39 --- a/src/uxa/uxa-damage.c
40 +++ b/src/uxa/uxa-damage.c
43 #include <X11/fonts/font.h>
44 #include <X11/fonts/fontstruct.h>
46 +#include <X11/fonts/libxfont2.h>
48 #include <X11/fonts/fontutil.h>
51 #include "uxa-damage.h"
53 @@ -947,8 +951,12 @@ uxa_damage_chars (RegionPtr region,
55 ExtentInfoRec extents;
60 + xfont2_query_glyph_extents(font, charinfo, n, &extents);
62 QueryGlyphExtents(font, charinfo, n, &extents);
66 if (extents.overallWidth > extents.overallRight)