After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 592857 - More desktop generic way for handling terminal launching in GDesktopAppInfo
More desktop generic way for handling terminal launching in GDesktopAppInfo
Status: RESOLVED DUPLICATE of bug 627943
Product: glib
Classification: Platform
Component: gio
2.20.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
: 600035 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-08-24 06:57 UTC by Nick Schermer
Modified: 2015-09-11 19:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Improve support for custom terminal emulators (7.84 KB, patch)
2010-06-06 13:55 UTC, Nick Schermer
reviewed Details | Review

Description Nick Schermer 2009-08-24 06:57:58 UTC
In Xfce we'd like to the use G(Desktp)AppInfo for launching desktop files and applications, but the applications used for launching in a terminal windows are all hard-coded and not usable for our environment.

A more generic implementation for this would be very welcome, so the desktop can define in some way the _first_ terminal application that is used to connect this to their preferred applications framework.
Comment 1 Matthias Clasen 2009-08-28 01:56:42 UTC
Sure, that would be a good idea.
Comment 2 Nick Schermer 2009-08-28 07:53:30 UTC
Maybe we need to discuss this on the xdg list for a generic implementation of this on all desktops, but that might take a while to get implemented.

Another option could be extending GDesktopAppInfoLookup with a call that returns the preferred terminal (or the app for a specific mime type?), we already have a GDesktopAppInfoLookup module to use our preferred applications framework for handling GIO uris, the code can then easily fallback to the hard-coded terminals.
Comment 3 Matthias Clasen 2009-08-28 21:06:59 UTC
Adding a vfunc to GDesktopAppInfoLookup to get the preferred terminal might indeed work ok. Of course, we need to handle that vunc being NULL, but as you said, thats easy.
Comment 4 Nick Schermer 2010-06-06 13:55:28 UTC
Created attachment 162867 [details] [review]
Improve support for custom terminal emulators

Primarily patch to add support for custom terminal emulators. Please shoot at it.
Comment 5 Christian Dywan 2010-06-16 11:34:09 UTC
Review of attachment 162867 [details] [review]:

::: gio/gdesktopappinfo.c
@@ +862,3 @@
+              term_argv = NULL;
+            }
+        }

I think you can omit the comments in the for loop, they just literally state what the following code does.

@@ +2735,3 @@
+ * Get the default terminal emulator when launching a GAppInfo with
+ * the G_APP_INFO_CREATE_NEEDS_TERMINAL for a particular GDesktopAppInfoLookup
+ * implementation.

It should be #G_APP_INFO_CREATE_NEEDS_TERMINAL for gtk-doc to recognize the constant.

@@ +2759,3 @@
+    return NULL;
+}
+

Shouldn't g_desktop_app_info_lookup_get_default_terminal_emulator always fallback to the default rather than returning NULL? Otherwise applications still have to have their own fallback code.
Comment 6 Matthias Clasen 2011-11-12 16:16:04 UTC
*** Bug 600035 has been marked as a duplicate of this bug. ***
Comment 7 Christian Persch 2015-09-11 19:32:41 UTC

*** This bug has been marked as a duplicate of bug 627943 ***