aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-04-01 19:06:43 -0700
committerPaul Eggert2011-04-01 19:06:43 -0700
commit8664db062341eee9a363de0c37b6fa017a42511b (patch)
treeab792076f755c180b396d7df76568ce348863c74 /src
parent6abdaa4a9fff89473f0c577057680198613993b8 (diff)
downloademacs-8664db062341eee9a363de0c37b6fa017a42511b.tar.gz
emacs-8664db062341eee9a363de0c37b6fa017a42511b.zip
* xfns.c (make_invisible_cursor): Don't return garbage
if XCreateBitmapFromData fails.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/xfns.c9
2 files changed, 8 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 17cc06bfe32..b2a337b1878 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12011-04-02 Paul Eggert <eggert@cs.ucla.edu> 12011-04-02 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * xfns.c (make_invisible_cursor): Don't return garbage
4 if XCreateBitmapFromData fails.
5
3 * xselect.c (x_get_local_selection, x_handle_property_notify): 6 * xselect.c (x_get_local_selection, x_handle_property_notify):
4 Remove vars that are set but not used. 7 Remove vars that are set but not used.
5 8
diff --git a/src/xfns.c b/src/xfns.c
index 39c77b8c8c7..8e5639681df 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -855,19 +855,20 @@ make_invisible_cursor (struct frame *f)
855 static char const no_data[] = { 0 }; 855 static char const no_data[] = { 0 };
856 Pixmap pix; 856 Pixmap pix;
857 XColor col; 857 XColor col;
858 Cursor c; 858 Cursor c = 0;
859 859
860 x_catch_errors (dpy); 860 x_catch_errors (dpy);
861 pix = XCreateBitmapFromData (dpy, FRAME_X_DISPLAY_INFO (f)->root_window, 861 pix = XCreateBitmapFromData (dpy, FRAME_X_DISPLAY_INFO (f)->root_window,
862 no_data, 1, 1); 862 no_data, 1, 1);
863 if (! x_had_errors_p (dpy) && pix != None) 863 if (! x_had_errors_p (dpy) && pix != None)
864 { 864 {
865 Cursor pixc;
865 col.pixel = 0; 866 col.pixel = 0;
866 col.red = col.green = col.blue = 0; 867 col.red = col.green = col.blue = 0;
867 col.flags = DoRed | DoGreen | DoBlue; 868 col.flags = DoRed | DoGreen | DoBlue;
868 c = XCreatePixmapCursor (dpy, pix, pix, &col, &col, 0, 0); 869 pixc = XCreatePixmapCursor (dpy, pix, pix, &col, &col, 0, 0);
869 if (x_had_errors_p (dpy) || c == None) 870 if (! x_had_errors_p (dpy) && pixc != None)
870 c = 0; 871 c = pixc;
871 XFreePixmap (dpy, pix); 872 XFreePixmap (dpy, pix);
872 } 873 }
873 874