summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 11:50:03 +0000
committermaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 11:50:03 +0000
commitb8bf3df6c606e74d5d21f59a2f7728c7ae97d464 (patch)
tree279967652084d82307b1c355a0400487755990a5
parent9d2a98c8750b8eb275ee761620a7019ee120c683 (diff)
downloadmarex-dev-b8bf3df6c606e74d5d21f59a2f7728c7ae97d464.tar.gz
marex-dev-b8bf3df6c606e74d5d21f59a2f7728c7ae97d464.tar.bz2
text plugin: improve error checking (closes #1337)
git-svn-id: file:///beryl/trunk@4023 d7aaf104-2d23-0410-ae22-9d23157bf5a3
-rw-r--r--beryl-plugins-unsupported/src/text.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/beryl-plugins-unsupported/src/text.c b/beryl-plugins-unsupported/src/text.c
index 2ae5402..7ef033f 100644
--- a/beryl-plugins-unsupported/src/text.c
+++ b/beryl-plugins-unsupported/src/text.c
@@ -71,12 +71,26 @@ static Bool textFileToImage(CompDisplay *d,
Display *display = d->display;
Screen *screen = ScreenOfDisplay(display, text_attrib->screen->screenNum);
+ if (!screen) {
+ printf("ERROR: Couldn't get screen for %d...\n",
+ text_attrib->screen->screenNum);
+ return FALSE;
+ }
+
format = XRenderFindStandardFormat(display, PictStandardARGB32);
- pixmap = XCreatePixmap(display, text_attrib->screen->root,
- 1, 1, 32);
+ if (!format) {
+ printf("ERROR: Couldn't get format...\n");
+ return FALSE;
+ }
- surface = cairo_xlib_surface_create_with_xrender_format(display, pixmap,
- screen, format, 1, 1);
+ pixmap = XCreatePixmap(display, text_attrib->screen->root, 1, 1, 32);
+ if (!pixmap) {
+ printf("ERROR: Couldn't create pixmap...\n");
+ return FALSE;
+ }
+
+ surface = cairo_xlib_surface_create_with_xrender_format(
+ display, pixmap, screen, format, 1, 1);
if (cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS) {
printf("ERROR: Couldn't create surface...\n");