Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't open console if only bell is "printed"
This had an annoying effect on Teradesk's shutdown dialog or when QED used the bell to signalize an error. Fixes freemint/teradesk#13.
- Loading branch information
426a800
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't that just eat any bell that is written using Bconout()? Lots of applications (including AES itself) do that when eg. clicking outside a modal dialog or alert box. In that case, the
Pling()
would be completely unheard.426a800
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch, you are probably right. I should have added a separate Bconout, forwarding the bell, without opening the console.
426a800
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have looked into this; it seems that even the original code in proc.c is wrong (and also done by me: ab4d145). The proper fix shouldn't have been the
if (con_win == NULL && con_fd > 0 && (readfds & (1L << con_fd)))
code but adding something likeinto
handle_console
. However it doesn't seem to automatically open console anymore. I wont have time to look at this for about week so you can have a go or I'll take a look to when I get back.426a800
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No hurry with this. BTW, there is already code in
toswin2/console.c
Line 124 in 744b82c
But imho this is both wrong. Why should the behaviour be different, depending on whether you output only a bell, or a bell embedded in some other string?
426a800
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fixed now.
I guess this idea was that if the string is
<bell>Hello!<bell>
you want to print that message while with<bell><bell>
you don't.