abc-mikey / xgamer

Automatically exported from code.google.com/p/xgamer
0 stars 0 forks source link

xgamer does not start on console (Gtk dependency) - see fix inside #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open text console 
2. run 'xgamer -c /usr/games/etracer'

What is the expected output?

Etracer starts up

What do you see instead?
Gtk2 error

What version of the product are you using? On what operating system?
0.3 on Ubuntu 11.04

Please provide any additional information below.

The problem is "use Gtk2 -init;" at the top of the script, which forces Gtk2 to 
initialize even if the program is run in non-Gtk mode.

To fix:

REMOVE Line:
use Gtk2 -init;

Inside "sub main", inside the "@ARGV == 0" guard, by the comment about "we're 
in GTK mode"
ADD lines

                # Defer Gtk2 load until here, so that xgamer works on console.
                require Gtk2;
                Gtk2->import(-init);

Original issue reported on code.google.com by michaelr...@gmail.com on 16 May 2011 at 12:52

GoogleCodeExporter commented 9 years ago
Ok, sorry about the long wait. This is a valid complaint. I'll try to make the 
Gtk2 stuff load late if it's being used so you can launch the command line 
version without the dependency. 

Original comment by abc.mi...@gmail.com on 22 Sep 2012 at 9:28