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 790198 - Non-Flatpak, single-instance GApplications fail to run
Non-Flatpak, single-instance GApplications fail to run
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
Flatpak Nightly Channel
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-11-11 02:50 UTC by Andrew Conrad
Modified: 2017-11-11 20:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
runtime: ensure host runner runs on the host system (1.46 KB, patch)
2017-11-11 20:28 UTC, Christian Hergert
committed Details | Review

Description Andrew Conrad 2017-11-11 02:50:14 UTC
In the Flatpak Nightly channel of Builder, running a GApplication which is not using Flatpak (using the host operating system in the build preferences) and is set to use a single instance (the app checks if there is an instance running already) will fail.

Steps to reproduce:

1. Create a new project using the C Gnome Application template.

2. Delete the Flatpak manifest (rm org.gnome.tcase.json).

3. Try to run the application.

Results:

No window is shown and the application closes immediately. The output is:

`Failed to register: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown`

Expected:

The window shows and the application works normally.

Additional information:

This does not occur in Builder outside of Flatpak, nor if the application is using Flatpak itself (instead of the host system).

In the Gnome App C template, changing src/main.c to have 

`app = gtk_application_new (NULL, G_APPLICATION_FLAGS_NONE);`

or

`app = gtk_application_new ("org.gnome.tcase", G_APPLICATION_NON_UNIQUE);`

on line 63 both allow for the application to run normally, as these avoid the single-instance application negotiation.
Comment 1 Andrew Conrad 2017-11-11 03:00:27 UTC
Note that between steps 2 and 3 of reproducing the bug, one must reload the project in Builder, to ensure that it is using the correct build settings.
Comment 2 Christian Hergert 2017-11-11 20:28:29 UTC
Created attachment 363407 [details] [review]
runtime: ensure host runner runs on the host system

When running with the "host" runtime from a flatpak release of Builder, we
were running the application inside the flatpak runtime.

This does the same thing we do for the launcher, and ensures that the
program is instead launched on the host.
Comment 3 Christian Hergert 2017-11-11 20:29:06 UTC
Thanks for reporting, should be fixed in our next Nightly build.
I'll merge to 3.26 branch for stable updates.

Attachment 363407 [details] pushed as 24793a9 - runtime: ensure host runner runs on the host system