Subject: 25.1; visible-bell corrupts screen on Mac OS X 10.11
From: David Caldwell <[email-masked]>
To: [email-masked]
Date: Sat, 21 Nov 2015 12:45:05 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

  Visible bell on Max OS X is a little weird in the first place: It
flashes a 128x128 rectangle in the middle of the OS
Window. Unfortunately, it's leaving artifacts and corrupted visuals
behind on Mac OS X 10.11. A nice example of the issue can be seen here:
https://cloud.githubusercontent.com/assets/617316/10954115/97430952-8319-11e5-81f4-25054836b901.png

It's easy to reproduce:

    M-x set-variable RET visible-bell RET t RET

...then hit `C-g`.

I've been looking into this and it actually appears to be a bug in Mac
OS X.

  I made an isolated test program from part of ns_ring_bell()
(https://github.com/caldwell/bracketed-window-op-test) that reproduces
the problem and have reported the bug to Apple (bug number 23642195, but
their bugs are private so having that doesn't help much).

  Since it's an OS X problem, I'm not really sure if I should be
reporting this here. But it seems to be confusing people, so maybe we
can work around it somehow until Apple fixes things. I tried to play
with NSCompositingOperation for a little bit last night but couldn't get
anything reasonable. I see in the git history that someone replaced
ns_ring_bell() with some CF graphics stuff, but it got reverted for some
reason (maybe GNUStep incompatibility?). Perhaps that can be resurrected
and reworked...

-David