[Mesa-dev] [PATCH] glx: Fix for throwing BadDrawable (invalid Pixmap or Window parameter) by Xserver

Maniak, Lukasz lukasz.maniak at intel.com
Wed Sep 4 09:30:53 PDT 2013


    Fix for throwing BadDrawable (invalid Pixmap or Window parameter)
    by Xserver when calling XCreatePixmap or fill_bitmap from
    DRI_glXUseXFont.

    currentDrawable which came from __glXGetCurrentContext was not correct in
    this case, we use DefaultRootWindow(dpy) instead.

Signed-off-by: Lukasz Maniak <lukasz.maniak at intel.com>
---
src/glx/xfont.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/glx/xfont.c b/src/glx/xfont.c
index 316c585..60e28ab 100644
--- a/src/glx/xfont.c
+++ b/src/glx/xfont.c
@@ -215,7 +215,6 @@ _X_HIDDEN void
DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int listbase)
{
    Display *dpy;
-   Window win;
    Pixmap pixmap;
    GC gc;
    XGCValues values;
@@ -231,7 +230,6 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis
    int i;
    dpy = CC->currentDpy;
-   win = CC->currentDrawable;
    fs = XQueryFont(dpy, font);
    if (!fs) {
@@ -279,7 +277,7 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis
    glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

-   pixmap = XCreatePixmap(dpy, win, 10, 10, 1);
+   pixmap = XCreatePixmap(dpy, DefaultRootWindow(dpy), 10, 10, 1);
    values.foreground = BlackPixel(dpy, DefaultScreen(dpy));
    values.background = WhitePixel(dpy, DefaultScreen(dpy));
    values.font = fs->fid;
@@ -342,7 +340,7 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis
       if (valid && (bm_width > 0) && (bm_height > 0)) {
          memset(bm, '\0', bm_width * bm_height);
-         fill_bitmap(dpy, win, gc, bm_width, bm_height, x, y, c, bm);
+         fill_bitmap(dpy, DefaultRootWindow(dpy), gc, bm_width, bm_height, x, y, c, bm);
          glBitmap(width, height, x0, y0, dx, dy, bm);
#ifdef DEBUG
--
1.8.1.2
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130904/8ff09a91/attachment.html>
-------------- next part --------------
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130904/8ff09a91/attachment-0001.html>


More information about the mesa-dev mailing list