OpenUrl not working Linux Desktop w/ Steam Overlay

Monkey Targets Forums/Desktop/OpenUrl not working Linux Desktop w/ Steam Overlay

Soap(Posted 2014) [#1]
OpenUrl causes game to hang. Good news otherwise got things to compile and run really well.

You can test with bouncyaliens as it has OpenUrl in it. I am too exhausted right now to investigate enough to try and fix this. If anyone knows a solution please let me know.

Here is build output

../main.cpp: In function ‘void skipBytes(int, FILE*)’:

../main.cpp:2137:18: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]

fread( p,n,1,f );

^

../main.cpp: In member function ‘virtual void BBGlfwGame::OpenUrl(String)’:

../main.cpp:2396:66: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result]

system( ( String( "xdg-open \"" )+url+"\"" ).ToCString<char>


nikoniko(Posted 2014) [#2]
Soap wrote:
../main.cpp: In member function ‘virtual void BBGlfwGame::OpenUrl(String)’:

../main.cpp:2396:66: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result]

system( ( String( "xdg-open \"" )+url+"\"" ).ToCString<char>


It's compiler warning only. You may test this code how it works or not. Type in terminal window
 xdg-open "http://monkey-x.com"

and wait opened browser or error message.


Soap(Posted 2014) [#3]
It only hangs when being launched from Steam. I'm working on getting this game ready to publish on Steam with Linux. Perhaps Steam overlay interacts in an unexpected way... anyone know of a way to investigate what is going wrong for sure? The game screen goes black, and to really close it after I have to go to terminal, and get the PID with top to kill it.

If you have Linux and Steam it should be possible to test this just by adding a Monkey app as a non-Steam game - if it shows the overlay then it should be reproducible. Although maybe not... I just tested and it's not working, not showing overlay for me in non-Steam game. Instead it may be necessary to download any Steam game, and replace its binary with one made from Monkey which has OpenUrl function used in it.


nikoniko(Posted 2014) [#4]
Soap wrote:
Steam with Linux.


Oh, Steam...


Soap(Posted 2014) [#5]
I tested with bouncing aliens replacing binary and it hangs with that example too. Contacted some people to see if there is a possible solution... if not no more links for linux version. : ^ )


nikoniko(Posted 2014) [#6]
Soap wrote:
Contacted some people to see if there is a possible solution.


You need modificated OpenUrl() function.
Grab xdg-open "http://monkey-x.com" output from terminal window to detect error.


nikoniko(Posted 2014) [#7]
The similar issue
https://github.com/ValveSoftware/steam-for-linux/issues/2200


SLotman(Posted 2014) [#8]
Why the need to "xdg-open"? Can't you just use _system("http://www.monkey-x.com")?


dawlane(Posted 2014) [#9]
I suspect it's how xdg-open is being called from monkey. Change the linux system function to use one of the exec function and see what happens. I can't test this as the Linux box is out of commission. You will find the Monkey OpenURL function defined in targets->glfw->modules->native->glfwgame.cpp


Soap(Posted 2014) [#10]
>The similar issue
It works in normal terminal, but in monkey app does not work when ran when launched from Steam with steam overlay. Tested on ubuntu 13.10


>Grab xdg-open "http://monkey-x.com" output from terminal window to detect error.

Normal terminal it works fine...

>Why the need to "xdg-open"

I'm trying to look for alternatives which will work. xdg-open is apparently a standard for opening links cross versions of linux.

system( ( String( "xdg-open \"" )+url+"\"" ).ToCString<char>() );

on 172 of glfwgame.cpp

What would you change this to? I can test anything.


dawlane(Posted 2014) [#11]
monkey app does not work when ran when launched from Steam with steam overlay.
I take it that you have tested it with overlay turned off?
A bit of googling indicates that that there are problems with using Steam Overlay. Run steam from a terminal and start the game and see what output you get. From what I have read so far it could be Monkey, steam, 32/64bit issues or drivers.


Soap(Posted 2014) [#12]
I don't mean that the monkey app doesn't work entirely. Everything else works fine. I mean that OpenUrl ( xdg-open) does not work - it causes the game to freeze when the game is ran from Steam with overlay. Launching the game without overlay is the same as launching it directly.

>Run steam from a terminal and start the game and see what output you get.

I'm not sure of the proper way to do this.

I need more testers...


Nobuyuki(Posted 2014) [#13]
I wonder if this would get some more traction if x-posted in the bugs forum. It's hard to test this since very few people have steam games made in monkey yet, and probably even fewer with linux. Maybe SlopeOak knows about this issue?


nikoniko(Posted 2014) [#14]
Just installed latest SteamOS to Virtualbox. It hasn't xdg-open util preinstalled. So I think Monkey-X needs a fix for OpenUrl() function for Steam or Linux target.


dawlane(Posted 2014) [#15]
Finally got the Linux box back up and running.
@Soap: Are you using the steamworks sdk?

If you have Linux and Steam it should be possible to test this just by adding a Monkey app as a non-Steam game - if it shows the overlay then it should be reproducible. Although maybe not... I just tested and it's not working, not showing overlay for me in non-Steam game. Instead it may be necessary to download any Steam game, and replace its binary with one made from Monkey which has OpenUrl function used in it.


The overlay is working perfectly for me as a non steam game. But trashes when I replace a binary. Note the bounceyaliens was compiled as a 32bit program.

Edit: OK terminal out put from steam.
To get this open a terminal and use
steam -applaunch <ID>
ID should be the id number of the game you are trying to run.
If you want to run a non-steam game then make a short-cut to the desktop by right clicking the game after you have added it to the library. When you open the properties for this short-cut, it will give you the command to use to run it from the command line.

(steam:8014): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:8014): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:8014): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:8014): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:8014): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:8014): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:8014): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:8014): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:8014): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:8014): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:8014): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:8014): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:8014): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:8014): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:8014): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.
Installing breakpad exception handler for appid(gameoverlayui)/version(1.0_client)
OnFocusWindowChanged to window type: k_EWindowTypeGame, 220
BouncyAliens: OnSuspend
OnFocusWindowChanged to window type: k_EWindowTypeNonSteamDesktop, 0
BouncyAliens: OnResume
OnFocusWindowChanged to window type: k_EWindowTypeGame, 220
ERROR: ld.so: object '/home/jason/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object '/home/jason/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded: ignored.
CGameStreamThread: Added instance ID 8128 for appid 220
ERROR: ld.so: object '/home/jason/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded: ignored.
CGameStreamThread: Added instance ID 8130 for appid 220

(gvfs-open:8136): GLib-GObject-CRITICAL **: /tmp/source/glib2.0/glib2.0-2.32.3/./gobject/gtype.c:2722: You forgot to call g_type_init()

(gvfs-open:8136): GLib-GObject-CRITICAL **: g_type_interface_add_prerequisite: assertion `G_TYPE_IS_INTERFACE (interface_type)' failed

(gvfs-open:8136): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

(gvfs-open:8136): GLib-GObject-CRITICAL **: /tmp/source/glib2.0/glib2.0-2.32.3/./gobject/gtype.c:2722: You forgot to call g_type_init()

(gvfs-open:8136): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

(gvfs-open:8136): GLib-GObject-CRITICAL **: /tmp/source/glib2.0/glib2.0-2.32.3/./gobject/gtype.c:2722: You forgot to call g_type_init()

(gvfs-open:8136): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed
CGameStreamThread: Added instance ID 8133 for appid 220
CGameStreamThread: Added instance ID 8136 for appid 220


Edit: I modified OpenURL to launch firefox directly and it seems to me that steam has a problem launching external programs. Firefox didn't start, but the application didn't crash.


Soap(Posted 2014) [#16]
I launched monkey app from terminal and this is the error when opening a link for me.

ERROR: ld.so: object '/home/dev/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object '/home/dev/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded: ignored.
CGameStreamThread: Added instance ID 2531 for appid 1000
CGameStreamThread: Added instance ID 2532 for appid 1000
CGameStreamThread: Added instance ID 2533 for appid 1000
ERROR: ld.so: object '/home/dev/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded: ignored.

(gvfs-open:2534): GLib-GObject-CRITICAL **: /tmp/source/glib2.0/glib2.0-2.32.3/./gobject/gtype.c:2722: You forgot to call g_type_init()

(gvfs-open:2534): GLib-GObject-CRITICAL **: g_type_interface_add_prerequisite: assertion `G_TYPE_IS_INTERFACE (interface_type)' failed

(gvfs-open:2534): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed
CGameStreamThread: Added instance ID 2534 for appid 1000

(gvfs-open:2534): GLib-GObject-CRITICAL **: /tmp/source/glib2.0/glib2.0-2.32.3/./gobject/gtype.c:2722: You forgot to call g_type_init()

(gvfs-open:2534): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

(gvfs-open:2534): GLib-GObject-CRITICAL **: /tmp/source/glib2.0/glib2.0-2.32.3/./gobject/gtype.c:2722: You forgot to call g_type_init()

(gvfs-open:2534): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed


In tests so far, have not enabled steamworks sdk.

>Just installed latest SteamOS to Virtualbox. It hasn't xdg-open util preinstalled.

That is troubling for sure... and would mean that they intend to open links only with steam://openurl/<url> in their overlay, but I'm not sure of the method that they do it... I'd like to fix this but may have disable opening links in Steam Linux builds for the time being.


nikoniko(Posted 2014) [#17]
Soap wrote:
That is troubling for sure... and would mean that they intend to open links only with steam://openurl/<url> in their overlay, but I'm not sure of the method that they do it... I'd like to fix this but may have disable opening links in Steam Linux builds for the time being.


It is not a big problem. You always can detect steam environment and change OpenUrl() behavior.

I have not developing tools in the installed steam to test this function.


Soap(Posted 2014) [#18]
For now I'm disabling links on Linux builds for Steam. I'll test stuff with steamworks when I get to it.


dawlane(Posted 2014) [#19]
When you come to testing with steamworks; try disabling the overlay before calling the system function. You my need to add a delay before reenabling it.


Soap(Posted 2014) [#20]
Interestingly OpenUrl is also not working with OS X and Steam overlay, but at least does not crash it.


nikoniko(Posted 2014) [#21]
A bit info
https://developer.valvesoftware.com/wiki/Talk:Steam_browser_protocol