1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#! /bin/sh /usr/share/dpatch/dpatch-run
## 16_default_interface.dpatch by <hubert@uhoreg.ca>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: use text interface if gtk interface selected, but $DISPLAY not set
@DPATCH@
--- alsaplayer-0.99.76/app/Main.cpp.orig 2006-01-25 21:33:52.344137582 -0700
+++ alsaplayer-0.99.76/app/Main.cpp 2006-01-25 21:37:47.383718469 -0700
@@ -916,13 +916,17 @@
goto _fatal_err;
}
} else {
- if (!(interface_plugin_info = load_interface(prefs_get_string
- (ap_prefs, "main", "default_interface", "gtk")))) {
+ char *interface = prefs_get_string
+ (ap_prefs, "main", "default_interface", "gtk");
+ // if we're trying to use the gtk interface, but we have no
+ // $DISPLAY, use the text interface instead
+ if (strcmp (interface, "gtk") == 0 && !getenv("DISPLAY"))
+ interface = "text";
+ if (!(interface_plugin_info = load_interface(interface))) {
if (!(interface_plugin_info = load_interface(prefs_get_string
(ap_prefs, "main", "fallback_interface", "text")))) {
alsaplayer_error("Failed to load text interface. This is bad (%s,%s,%s)",
- prefs_get_string(ap_prefs, "main", "default_interface", "gtk"),
- prefs_get_string(ap_prefs, "main", "default_interface", "gtk"),
+ interface, interface,
global_pluginroot);
goto _fatal_err;
}
|