diff options
author | Keith Packard <keithp@keithp.com> | 2010-06-07 00:54:18 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-06-07 11:27:12 -0700 |
commit | fdb081b430ddffb495aa5b05bcc4cf10882ff4b2 (patch) | |
tree | 098e5f409338fdde700a39edc3482cb404414869 /hw/xfree86 | |
parent | bc26665661565918af484ccd17caad951010df60 (diff) |
dri2: Deal with input-only windows by using WindowDrawable()
Input only windows aren't DRAWABLE_WINDOW, but casting them to a
PixmapPtr is a bit harsh, and unlikely to get the appropriate privates
structure. use WindowDrawable instead which checks for both
input-output and input-only windows.
Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'hw/xfree86')
-rw-r--r-- | hw/xfree86/dri2/dri2.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index baa6706d6..d33b0d1b0 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -118,7 +118,7 @@ DRI2GetDrawable(DrawablePtr pDraw) WindowPtr pWin; PixmapPtr pPixmap; - if (pDraw->type == DRAWABLE_WINDOW) { + if (WindowDrawable(pDraw->type)) { pWin = (WindowPtr) pDraw; return dixLookupPrivate(&pWin->devPrivates, dri2WindowPrivateKey); } else { @@ -161,7 +161,7 @@ DRI2AllocateDrawable(DrawablePtr pDraw) pPriv->last_swap_ust = 0; list_init(&pPriv->reference_list); - if (pDraw->type == DRAWABLE_WINDOW) { + if (WindowDrawable(pDraw->type)) { pWin = (WindowPtr) pDraw; dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, pPriv); } else { @@ -272,7 +272,7 @@ static int DRI2DrawableGone(pointer p, XID id) return Success; pDraw = pPriv->drawable; - if (pDraw->type == DRAWABLE_WINDOW) { + if (WindowDrawable(pDraw->type)) { pWin = (WindowPtr) pDraw; dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, NULL); } else { @@ -411,12 +411,12 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, need_real_front--; front_format = format; - if (pDraw->type == DRAWABLE_WINDOW) { + if (WindowDrawable(pDraw->type)) { need_fake_front++; } } - if (pDraw->type == DRAWABLE_WINDOW) { + if (WindowDrawable(pDraw->type)) { if (attachment == DRI2BufferFakeFrontLeft) { need_fake_front--; have_fake_front = 1; |