From 7a6c1b0bad999cd64ae995f985256f7e0a585f15 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Thu, 12 Jul 2012 19:21:44 -0700 Subject: [PATCH] gtk: Avoid signaling an error in hook/process-command-line. --- src/gtk/main.scm | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/gtk/main.scm b/src/gtk/main.scm index f7db51471..21165d9fb 100644 --- a/src/gtk/main.scm +++ b/src/gtk/main.scm @@ -35,25 +35,25 @@ USA. (set! hook/process-command-line (lambda (line) (processor - (list->vector - (start-gtk program-name (vector->list line))))))))) - -(define (start-gtk name args) - (if (let ((s (get-environment-variable "DISPLAY"))) - (and (string? s) (not (string-null? s)))) - (let ((path (system-library-pathname "gtk-shim.so" #f))) - (if path - (if (file-loadable? path) - (start-gtk* name args) - (begin - (warn "Gtk shim not loadable") - args)) - (begin - (warn "No Gtk shim") - args))) - (begin - (warn "DISPLAY not set") - args))) + (let ((val (ignore-errors + (lambda () + (start-gtk program-name (vector->list line)))))) + (if (condition? val) + (begin + (warn val) + line) + (list->vector val))))))))) + + (define (start-gtk name args) + (if (let ((s (get-environment-variable "DISPLAY"))) + (and (string? s) (not (string-null? s)))) + (let ((path (system-library-pathname "gtk-shim.so" #f))) + (if path + (if (file-loadable? path) + (start-gtk* name args) + (error "Gtk shim not loadable.")) + (error "No Gtk shim"))) + (error "DISPLAY not set"))) (define (start-gtk* name args) ;; Call start_gtk. Signals an error if gtk_init_check returns 0. -- 2.25.1