]> git.eshelyaron.com Git - emacs.git/commitdiff
(x_set_frame_alpha): Add x_catch_errors for bug#437.
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 22 Jun 2008 14:02:07 +0000 (14:02 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 22 Jun 2008 14:02:07 +0000 (14:02 +0000)
src/ChangeLog
src/xterm.c

index fc0a84128b3d76cb0cd794b3011a301919ae8236..3b5d8ff1fd683ba930e4bc809180775f22e9d8ed 100644 (file)
@@ -1,3 +1,8 @@
+2008-06-21  Seiji Zenitani  <zenitani@mac.com>
+            Ryo Yoshitake  <ryo@shiftmode.net>
+
+       * xterm.c (x_set_frame_alpha): Add x_catch_errors for bug#437.
+
 2008-06-22  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * Makefile.in (${lisp} ${SOME_MACHINE_LISP}, ../lisp/loaddefs.el):
index d2222b4a9b996e898ac0d6e785d59c656811e6e4..9f3ce1a660862207e0647ecb4b4a93a7b4d9122d 100644 (file)
@@ -497,26 +497,32 @@ x_set_frame_alpha (f)
   {
     unsigned char *data;
     Atom actual;
-    int format;
+    int rc, format;
     unsigned long n, left;
 
-    XGetWindowProperty(dpy, win, XInternAtom(dpy, OPACITY, False),
-                      0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left,
-                      &data);
-    if (actual != None)
+    x_catch_errors (dpy);
+    rc = XGetWindowProperty(dpy, win, XInternAtom(dpy, OPACITY, False),
+                           0L, 1L, False, XA_CARDINAL,
+                           &actual, &format, &n, &left,
+                           &data);
+
+    if (rc == Success && actual != None)
       if (*(unsigned long *)data == opac)
        {
          XFree ((void *) data);
+         x_uncatch_errors ();
          return;
        }
       else
        XFree ((void *) data);
+    x_uncatch_errors ();
   }
 
+  x_catch_errors (dpy);
   XChangeProperty (dpy, win, XInternAtom (dpy, OPACITY, False),
                   XA_CARDINAL, 32, PropModeReplace,
                   (unsigned char *) &opac, 1L);
-  XSync (dpy, False);
+  x_uncatch_errors ();
 }
 
 \f