app/plug-in: fix #12711 app hang on MacOS IO event on empty pipe
This is an alternative to !2076. Both seem to fix #12711. Both MR's are lightly tested, and draft.
In comparison, this:
- avoids kernel call to ioctl
- changes fewer files
- would not handle other potential cases of a spurious IO event (when pipe is really empty)
- is complex and probably fragile to changes to the GP gimp protocol
- is very specific to the one known situation of the issue, and describes it better
The two fixes might be combined?
Root cause
The best solution would be to fix the likely root cause, a bug in GLib on MacOS that generates spurious IO events when the pipe is empty.
Maybe we should file an issue on GLib?
I am not equipped nor interested in debugging the root cause on MacOS, too difficult and too specialized.
Choosing an alternative
Personally, I prefer the other !2076.
Jehan: please do a preliminary review of the two MR's and choose one. Then we can do exhaustive testing.