glx: Fix drawable lookup bugs in glXUseXFont
authorAdam Jackson <ajax@redhat.com>
Thu, 19 Sep 2019 17:27:08 +0000 (13:27 -0400)
committerAdam Jackson <ajax@redhat.com>
Fri, 20 Sep 2019 01:06:01 +0000 (21:06 -0400)
commit88b8922f57137e75c8ea48969e27a8275adbdf5a
treedb930996e016e1f99bfbc1d8e29a3abe4baa4a57
parentb4fe0b3ffd825284aa57072c67a019fbc1bf4a1b
glx: Fix drawable lookup bugs in glXUseXFont

We were using the current drawable of the context to name the
appropriate screen for creating the bitmaps. But one, the current
drawable can be None, and two, it can be a GLXDrawable. Passing either
one as the second argument to XCreatePixmap will throw BadDrawable. Use
the root window of the context's screen instead.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/89
LOLed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
src/glx/xfont.c