Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
Original file line number Diff line number Diff line change
Expand Up @@ -10728,6 +10728,18 @@ JNIEXPORT jlong JNICALL OS_NATIVE(g_1app_1info_1get_1all)
}
#endif

#ifndef NO_g_1app_1info_1get_1commandline
JNIEXPORT jlong JNICALL OS_NATIVE(g_1app_1info_1get_1commandline)
(JNIEnv *env, jclass that, jlong arg0)
{
jlong rc = 0;
OS_NATIVE_ENTER(env, that, g_1app_1info_1get_1commandline_FUNC);
rc = (jlong)g_app_info_get_commandline((GAppInfo *)arg0);
OS_NATIVE_EXIT(env, that, g_1app_1info_1get_1commandline_FUNC);
return rc;
}
#endif

#ifndef NO_g_1app_1info_1get_1default_1for_1type
JNIEXPORT jlong JNICALL OS_NATIVE(g_1app_1info_1get_1default_1for_1type)
(JNIEnv *env, jclass that, jbyteArray arg0, jboolean arg1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,7 @@ typedef enum {
g_1action_1map_1remove_1action_FUNC,
g_1app_1info_1create_1from_1commandline_FUNC,
g_1app_1info_1get_1all_FUNC,
g_1app_1info_1get_1commandline_FUNC,
g_1app_1info_1get_1default_1for_1type_FUNC,
g_1app_1info_1get_1executable_FUNC,
g_1app_1info_1get_1icon_FUNC,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,10 @@ public static boolean isX11 () {
*/
public static final native long g_app_info_create_from_commandline(byte[] commandline, byte[] applName, long flags, long error);
public static final native long g_app_info_get_all();
/**
* @param appInfo cast=(GAppInfo *)
*/
public static final native long g_app_info_get_commandline(long appInfo);
/**
* @param appInfo cast=(GAppInfo *)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,19 @@ static Program gio_getProgram (long application) {
if (length > 0) {
buffer = new byte [length];
C.memmove (buffer, applicationCommand, length);
program.command = new String (Converter.mbcsToWcs (buffer));
String command = new String (Converter.mbcsToWcs (buffer));
if (command.equals("/usr/bin/flatpak") || command.equals("env")) {
long applicationCommandLine = OS.g_app_info_get_commandline(application);
if (applicationCommandLine != 0) {
length = C.strlen (applicationCommandLine);
if (length > 0) {
buffer = new byte [length];
C.memmove (buffer, applicationCommandLine, length);
command = new String (Converter.mbcsToWcs (buffer));
}
}
}
program.command = command ;
}
}
program.gioExpectUri = OS.g_app_info_supports_uris(application);
Expand Down
Loading