xcowsay icon indicating copy to clipboard operation
xcowsay copied to clipboard

(xcowsay:98214): Gtk-WARNING **: 19:50:34.517: cannot open display

Open guigonc opened this issue 3 years ago • 2 comments

I did clone and build the xcowsay app and installed xquartz on a MacBook running OSX 11.6 (Big Sur).

I can run other apps using xquartz like xcalc or xterm or xclock, but when I run xcowsay I get the following message

(xcowsay:98077): Gtk-WARNING **: 19:49:49.479: cannot open display: /private/tmp/com.apple.launchd.HS5DGKsS3t/org.xquartz:0

Any guess on what is wrong?

guigonc avatar Mar 22 '22 22:03 guigonc

No good ideas unfortunately. But the other programs you mention above are all using X11 directly whereas xcowsay is actually a Gtk app. Do you get the same error with other Gtk programs (e.g. gedit?).

I'm pretty sure xcowsay used to work on macOS at some point. You might like to try the older Gtk2 version too (the v1.4 tag).

nickg avatar Mar 23 '22 17:03 nickg

This is because Gtk on macOS can use either the native backend or X11. Commenting this line resolves it:

https://github.com/nickg/xcowsay/blob/e6a1c464d9045668a046a5990624263c19d8ec6b/src/display_cow.c#L161

However, because the app does not use GApplication, the window is shown in the background and you have to click the icon in the dock to reveal it.

mohd-akram avatar May 23 '24 12:05 mohd-akram