Enlightenment CVS committal Author : doursse Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/lib/engines/software_xcb Modified Files: evas_xcb_buffer.c Log Message: forget to test if the shm extension exists =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/engines/software_xcb/evas_xcb_buffer.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- evas_xcb_buffer.c 22 May 2005 02:49:49 -0000 1.3 +++ evas_xcb_buffer.c 2 Oct 2005 12:41:11 -0000 1.4 @@ -100,53 +100,59 @@ if (try_shm > 0) { - xcbob->shm_info = malloc(sizeof(XCBShmSegmentInfo)); - if (xcbob->shm_info) - { - xcbob->shm_info->shmseg = XCBShmSEGNew(c); - xcbob->image = XCBImageSHMCreate(c, depth, ZPixmap, NULL, w, h); - if (xcbob->image) - { - xcbob->shm_info->shmid = shmget(IPC_PRIVATE, - xcbob->image->bytes_per_line * - xcbob->image->height, - IPC_CREAT | 0777); - if (xcbob->shm_info->shmid >= 0) - { - xcbob->shm_info->shmaddr = xcbob->image->data = - shmat(xcbob->shm_info->shmid, 0, 0); - if (xcbob->shm_info->shmaddr != NULL) - { - /* - * FIXME: no error mechanism - */ - -/* XErrorHandler ph; */ -/* EventHandlers eh; */ - - XCBSync(c, 0); - _xcb_err = 0; -/* ph = XSetErrorHandler((XErrorHandler) */ -/* x_output_tmp_x_err); */ - XCBShmAttach(c, - xcbob->shm_info->shmseg, - xcbob->shm_info->shmid, 0); - XCBSync(c, 0); -/* XSetErrorHandler((XErrorHandler)ph); */ - if (!_xcb_err) - { - return xcbob; - } - } - shmdt(xcbob->shm_info->shmaddr); - shmctl(xcbob->shm_info->shmid, IPC_RMID, 0); - } - if (xcbob->image) XCBImageSHMDestroy(xcbob->image); - xcbob->image = NULL; - } - if (xcbob->shm_info) free(xcbob->shm_info); - xcbob->shm_info = NULL; - } + XCBQueryExtensionRep *rep; + + rep = XCBGetExtensionData(c, &XCBShmId); + if (rep && rep->present) + { + xcbob->shm_info = malloc(sizeof(XCBShmSegmentInfo)); + if (xcbob->shm_info) + { + xcbob->shm_info->shmseg = XCBShmSEGNew(c); + xcbob->image = XCBImageSHMCreate(c, depth, ZPixmap, NULL, w, h); + if (xcbob->image) + { + xcbob->shm_info->shmid = shmget(IPC_PRIVATE, + xcbob->image->bytes_per_line * + xcbob->image->height, + IPC_CREAT | 0777); + if (xcbob->shm_info->shmid >= 0) + { + xcbob->shm_info->shmaddr = xcbob->image->data = + shmat(xcbob->shm_info->shmid, 0, 0); + if (xcbob->shm_info->shmaddr != NULL) + { + /* + * FIXME: no error mechanism + */ + + /* XErrorHandler ph; */ + /* EventHandlers eh; */ + + XCBSync(c, 0); + _xcb_err = 0; + /* ph = XSetErrorHandler((XErrorHandler) */ + /* x_output_tmp_x_err); */ + XCBShmAttach(c, + xcbob->shm_info->shmseg, + xcbob->shm_info->shmid, 0); + XCBSync(c, 0); + /* XSetErrorHandler((XErrorHandler)ph); */ + if (!_xcb_err) + { + return xcbob; + } + } + shmdt(xcbob->shm_info->shmaddr); + shmctl(xcbob->shm_info->shmid, IPC_RMID, 0); + } + if (xcbob->image) XCBImageSHMDestroy(xcbob->image); + xcbob->image = NULL; + } + if (xcbob->shm_info) free(xcbob->shm_info); + xcbob->shm_info = NULL; + } + } } if (try_shm > 1) return NULL; ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs