Commit d925a426 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(x_set_frame_alpha): Add x_catch_errors for bug#437.

parent b4945b95
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> 2008-06-22 Stefan Monnier <monnier@iro.umontreal.ca>
* Makefile.in (${lisp} ${SOME_MACHINE_LISP}, ../lisp/loaddefs.el): * Makefile.in (${lisp} ${SOME_MACHINE_LISP}, ../lisp/loaddefs.el):
......
...@@ -497,26 +497,32 @@ x_set_frame_alpha (f) ...@@ -497,26 +497,32 @@ x_set_frame_alpha (f)
{ {
unsigned char *data; unsigned char *data;
Atom actual; Atom actual;
int format; int rc, format;
unsigned long n, left; unsigned long n, left;
XGetWindowProperty(dpy, win, XInternAtom(dpy, OPACITY, False), x_catch_errors (dpy);
0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, rc = XGetWindowProperty(dpy, win, XInternAtom(dpy, OPACITY, False),
&data); 0L, 1L, False, XA_CARDINAL,
if (actual != None) &actual, &format, &n, &left,
&data);
if (rc == Success && actual != None)
if (*(unsigned long *)data == opac) if (*(unsigned long *)data == opac)
{ {
XFree ((void *) data); XFree ((void *) data);
x_uncatch_errors ();
return; return;
} }
else else
XFree ((void *) data); XFree ((void *) data);
x_uncatch_errors ();
} }
x_catch_errors (dpy);
XChangeProperty (dpy, win, XInternAtom (dpy, OPACITY, False), XChangeProperty (dpy, win, XInternAtom (dpy, OPACITY, False),
XA_CARDINAL, 32, PropModeReplace, XA_CARDINAL, 32, PropModeReplace,
(unsigned char *) &opac, 1L); (unsigned char *) &opac, 1L);
XSync (dpy, False); x_uncatch_errors ();
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment