diff options
| author | Stefan Monnier | 2008-06-22 14:02:07 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-06-22 14:02:07 +0000 |
| commit | d925a42659cb0757f935c750e6c1e25d6cc3b035 (patch) | |
| tree | 0191375f458f066d09c3f1a78eea652cef5b89b7 /src | |
| parent | b4945b9599f0651fef5fa2ca2ef6034fa0b5bfaa (diff) | |
| download | emacs-d925a42659cb0757f935c750e6c1e25d6cc3b035.tar.gz emacs-d925a42659cb0757f935c750e6c1e25d6cc3b035.zip | |
(x_set_frame_alpha): Add x_catch_errors for bug#437.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/xterm.c | 18 |
2 files changed, 17 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index fc0a84128b3..3b5d8ff1fd6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2008-06-21 Seiji Zenitani <zenitani@mac.com> | ||
| 2 | Ryo Yoshitake <ryo@shiftmode.net> | ||
| 3 | |||
| 4 | * xterm.c (x_set_frame_alpha): Add x_catch_errors for bug#437. | ||
| 5 | |||
| 1 | 2008-06-22 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2008-06-22 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * Makefile.in (${lisp} ${SOME_MACHINE_LISP}, ../lisp/loaddefs.el): | 8 | * Makefile.in (${lisp} ${SOME_MACHINE_LISP}, ../lisp/loaddefs.el): |
diff --git a/src/xterm.c b/src/xterm.c index d2222b4a9b9..9f3ce1a6608 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -497,26 +497,32 @@ x_set_frame_alpha (f) | |||
| 497 | { | 497 | { |
| 498 | unsigned char *data; | 498 | unsigned char *data; |
| 499 | Atom actual; | 499 | Atom actual; |
| 500 | int format; | 500 | int rc, format; |
| 501 | unsigned long n, left; | 501 | unsigned long n, left; |
| 502 | 502 | ||
| 503 | XGetWindowProperty(dpy, win, XInternAtom(dpy, OPACITY, False), | 503 | x_catch_errors (dpy); |
| 504 | 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, | 504 | rc = XGetWindowProperty(dpy, win, XInternAtom(dpy, OPACITY, False), |
| 505 | &data); | 505 | 0L, 1L, False, XA_CARDINAL, |
| 506 | if (actual != None) | 506 | &actual, &format, &n, &left, |
| 507 | &data); | ||
| 508 | |||
| 509 | if (rc == Success && actual != None) | ||
| 507 | if (*(unsigned long *)data == opac) | 510 | if (*(unsigned long *)data == opac) |
| 508 | { | 511 | { |
| 509 | XFree ((void *) data); | 512 | XFree ((void *) data); |
| 513 | x_uncatch_errors (); | ||
| 510 | return; | 514 | return; |
| 511 | } | 515 | } |
| 512 | else | 516 | else |
| 513 | XFree ((void *) data); | 517 | XFree ((void *) data); |
| 518 | x_uncatch_errors (); | ||
| 514 | } | 519 | } |
| 515 | 520 | ||
| 521 | x_catch_errors (dpy); | ||
| 516 | XChangeProperty (dpy, win, XInternAtom (dpy, OPACITY, False), | 522 | XChangeProperty (dpy, win, XInternAtom (dpy, OPACITY, False), |
| 517 | XA_CARDINAL, 32, PropModeReplace, | 523 | XA_CARDINAL, 32, PropModeReplace, |
| 518 | (unsigned char *) &opac, 1L); | 524 | (unsigned char *) &opac, 1L); |
| 519 | XSync (dpy, False); | 525 | x_uncatch_errors (); |
| 520 | } | 526 | } |
| 521 | 527 | ||
| 522 | 528 | ||