doesn't reuse running instance when started from nautilus

Bug #777292 reported by Stefan Löffler
130
This bug affects 29 people
Affects Status Importance Assigned to Milestone
gedit
Fix Released
Medium
gedit (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: gedit

Normally, gedit is a single instance application, meaning that it is started only once, and subsequent invocations are merged into the already running instance.

When starting gedit from unity (either via dash, or via Alt+F2) and later from somewhere else (I tested opening a file in nautilus, opening a file from the archive manager, and running from the command line), gedit is started a second time.

$ lsb_release -rd
Description: Ubuntu 11.04
Release: 11.04

$ apt-cache policy gedit
gedit:
  Installed: 2.30.4-2ubuntu1
  Candidate: 2.30.4-2ubuntu1
  Version table:
 *** 2.30.4-2ubuntu1 0
        500 http://gd.tuwien.ac.at/opsys/linux/ubuntu/archive/ natty/main amd64 Packages
        100 /var/lib/dpkg/status

$ apt-cache policy unity
unity:
  Installed: 3.8.12-0ubuntu1
  Candidate: 3.8.12-0ubuntu1
  Version table:
 *** 3.8.12-0ubuntu1 0
        500 http://gd.tuwien.ac.at/opsys/linux/ubuntu/archive/ natty-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     3.8.10-0ubuntu2 0
        500 http://gd.tuwien.ac.at/opsys/linux/ubuntu/archive/ natty/main amd64 Packages

TEST CASE:
1. Open any text document with nautilus in gedit.
2. Open any text document with a terminal "gedit test.txt"

Result: A new GEdit instance is opened
Expected Result: A new tab in existing GEdit instance is opened

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report, I can report it in the alt-f2 case but not when running from the dash, launcher or application lens

Changed in unity:
importance: Undecided → Low
Changed in gedit (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Changed in unity:
status: New → Confirmed
Revision history for this message
kenden (kenden) wrote :

Actually, this 'bug' is the only way I found to open a new instance of gedit, which I like to do.
If it is fixed, it would be nice to get a new Unity quicklist for gedit in the launcher to "Open a new text editor"

Revision history for this message
Sebastien Bacher (seb128) wrote :

you can right click on a tab in gedit as well to do what you want

Revision history for this message
kenden (kenden) wrote :

This seems to be resolved, I can't reproduce in Unity 3.8.12.
I cannot get a 2nd gedit to open, from the dash, alt-f2 or a terminal

Revision history for this message
Stefan Löffler (st.loeffler) wrote :

I still see the issue with Unit 3.8.12.

It appears both ways:
 * Start gedit from launcher/dash/terminal and then double-click a text file in nautilus/archive manager gives a second instance.
 * double-click a text file in nautilus/archive manager and then starting gedit from dash/terminal gives a second instance (not from launcher, though, which switches to the first instance correctly).

Changed in unity (Ubuntu):
status: New → Confirmed
Revision history for this message
Matt Moen (matt-moen) wrote :

The principle text editor in ubuntu is nearly unusable for me. Can we bump the priority on this? Related:whatever instance (either the unity instance or the nautilus instance for lack of a better description) has numerous UI bugs. For example, you can't click on the overlay scroll bar -- it appears but then disappears as you mouse over it to move it.

Between having two instances of my single instance editor app depending on whether i open a text file from nautlius or from the principle app launcher is bad enough, but when one of them is crippled .. arggh!

Also please mark the other bug (or this one) a dupe .. I think it's clearly the same issue (and cross posting this follow up):
seems similar to bug #784574

Revision history for this message
Lukáš Machyán (phobulos) wrote :

I also noticed that clicking on tab with right mouse button doesn't work in the second instance of Gedit (it works in first). I can't also move an opened tab of document from/to second window by drag&drop.

Revision history for this message
Premasagar Rose (premasagar) wrote :

I agree with Matt Moen about bumping up the priority. For me, it creates a very confusing, frustrating workflow when using Ubuntu. I use Gedit probably more than any other application, and trying to edit files in one place is impossible when the terminal opens files in one Gedit instance, Nautilus opens them in another, and Startup Applications opens them in yet another.

Revision history for this message
jdaviescoates (josef-uniteddiversity) wrote :

I also find it to be very annoying that a new instance of gedit is opened whenever I open another file by double clicking or right clicking on it. I want all text files to open in the same instance.

Clearly some people an instance per file though eg. http://ubuntuforums.org/showthread.php?t=845906 although as someone pointed out above you can do that by right-clicking on the tab within an existing option.

The obvious solution is for there to be a simple configurable option: open all text files in one instance yes/ no.

Revision history for this message
jdaviescoates (josef-uniteddiversity) wrote :

er that should've been "some people *prefer* an instance per file" and "you can do that by right-clicking on the tab within an existing *instance*".

Revision history for this message
Christoph Korn (c-korn) wrote :

Ok, so most agree that this is a bug.

But how can we help fixing this?
I think the bug was introduced with 11.04. Can we run a regression test somehow?

Revision history for this message
Christoph Korn (c-korn) wrote :

I tried to debug it a bit.
First I noticed that this opens a new tab.
1) run gedit from dash 2) run "gedit" in Terminal
While this opens a new process:
1) run gedit from dash 2) run "gedit file" in Terminal

I have debugged gedit a bit while the instance opened from dash was running:
$ GEDIT_DEBUG="" gedit gedit-3.2.0/gedit/gedit.c
[0.000017 (0.000017)] gedit.c:235 (main) Startup
[0,047591 (0,047574)] gedit-dbus.c:1651 (gedit_dbus_run)
[0,047937 (0,000346)] gedit-dbus.c:1682 (gedit_dbus_run) Own name org.gnome.gedit

[0,058506 (0,010569)] gedit-dbus.c:1604 (bus_acquired_cb)
[0,060411 (0,001905)] gedit-dbus.c:1638 (name_lost_cb)
[0,060512 (0,000101)] gedit-dbus.c:724 (handle_slave)

So it is doing some dbus start which seems to be the problem.

It is starting the dbus main loop here:
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/oneiric/gedit/oneiric/view/head:/gedit/gedit-dbus.c#L1685

Revision history for this message
Sebastien Bacher (seb128) wrote :

The issue was an Unity one and got fixed in the Oneiric version

Changed in unity (Ubuntu):
status: Confirmed → Fix Released
importance: Undecided → Low
Changed in gedit (Ubuntu):
status: Confirmed → Invalid
Changed in unity:
status: Confirmed → Fix Released
Revision history for this message
jdaviescoates (josef-uniteddiversity) wrote :

I've just upgraded to 11.10 and this issue has not been fixed.

It is very easy to replicate:

1. Open geedit from Unity
2. Open a text file by double clicking on it in file manager
3. Note that the text file has not opened in the gedit instance opened from Unity.

Revision history for this message
Lukáš Machyán (phobulos) wrote :

I still have this issue in upgraded Ubuntu 11.10 too.

Revision history for this message
Christoph Korn (c-korn) wrote :

I can confirm that this is not fixed.
Fully up to date oneiric.

1)Open gedit with unity
2)Open terminal and run "gedit somefile"
3)See how a second instance of gedit is started.

Revision history for this message
jdaviescoates (josef-uniteddiversity) wrote :

Fix released?

I can confirm that this issue persists.

Revision history for this message
Sebastien Bacher (seb128) wrote :

What desktop environment do you use? unity-3d? unity-2d? other?

Revision history for this message
jdaviescoates (josef-uniteddiversity) wrote : Re: [Bug 777292] Re: Gedit not single instance when started from unity

On 26 January 2012 15:15, Sebastien Bacher <email address hidden> wrote:

> What desktop environment do you use? unity-3d? unity-2d? other?
>

unity-3d

But I'm going to give Kubuntu and Linux Mint a try, because even though I
quite like unity this and other basic usability and functionality problems
(e.g. https://bugzilla.gnome.org/show_bug.cgi?id=661837
https://bugs.launchpad.net/ubuntu/+source/unity/+bug/922095 ) are beginning
to really annoy me :(

--
Josef Davies-Coates
United Diversity

07974 88 88 95
http://uniteddiversity.com

Follow us on Twitter <http://twitter.com/uniteddiversity> and
Facebook<http://facebook.com/uniteddiversity>

*Together We Have Everything*

Revision history for this message
Sebastien Bacher (seb128) wrote : Re: Gedit not single instance when started from unity

Could you describe how you run gedit? others don't get that issue...

Revision history for this message
Sebastien Bacher (seb128) wrote :

> other basic usability and functionality problems (e.g. https://bugzilla.gnome.org/show_bug.cgi?id=661837

that's an upstream nautilus issue you will get the same bug under other distributions or desktop environments

Revision history for this message
Christoph Korn (c-korn) wrote : Re: [Bug 777292] Re: Gedit not single instance when started from unity

1. Open any text document with nautilus in gedit.
2. Open any text document with a terminal "gedit test.txt"

The second step opens a new instance here.

At least this is how I can reproduce this.

Am 27.01.2012 14:31, schrieb Sebastien Bacher:
> Could you describe how you run gedit? others don't get that issue...
>

Revision history for this message
jdaviescoates (josef-uniteddiversity) wrote :

On 27 January 2012 13:31, Sebastien Bacher <email address hidden> wrote:

> Could you describe how you run gedit? others don't get that issue...
>

I think I've already done so above, but:

1. I click on gedit icon in unity, an instance opens
2. I double click on a text file in nautilus, another instance opens.

Thanks,

Josef.

--
Josef Davies-Coates
United Diversity

07974 88 88 95
http://uniteddiversity.com

Follow us on Twitter <http://twitter.com/uniteddiversity> and
Facebook<http://facebook.com/uniteddiversity>

*Together We Have Everything*

Revision history for this message
Sebastien Bacher (seb128) wrote : Re: Gedit not single instance when started from unity

you are sure that you use unity-3d and not 2d? can you run a ps afx | grep unity? do you have any special dbus environment?

Revision history for this message
jdaviescoates (josef-uniteddiversity) wrote : Re: [Bug 777292] Re: Gedit not single instance when started from unity

On 27 January 2012 13:32, Sebastien Bacher <email address hidden> wrote:

> > other basic usability and functionality problems (e.g.
> https://bugzilla.gnome.org/show_bug.cgi?id=661837
>
> that's an upstream nautilus issue you will get the same bug under other
> distributions or desktop environments
>

Well, we've gone off topic (sorry everyone), but AFAIK e.g. KDE (and I
assume Kubuntu?) doesn't use nautilus as it's file manager.

Cheers,

Josef.

--
Josef Davies-Coates
United Diversity

07974 88 88 95
http://uniteddiversity.com

Follow us on Twitter <http://twitter.com/uniteddiversity> and
Facebook<http://facebook.com/uniteddiversity>

*Together We Have Everything*

Revision history for this message
Sebastien Bacher (seb128) wrote :

see bug #877706 as well

Revision history for this message
Sebastien Bacher (seb128) wrote : Re: Gedit not single instance when started from unity

see bug #827414 as well which was the original bug, could those having the issue start nautilus from nautilus and run
"strings /proc/$(pidof gedit)/environ | grep DBUS"

does it list a DBUS_STARTER_ADDRESS? how do you start nautilus and how do you start gedit from nautilus?

Revision history for this message
Sebastien Bacher (seb128) wrote :

Sorry I somewhat mixed issues due to the bug title, that has nothing to do with unity but it's an issue with nautilus...

no longer affects: unity (Ubuntu)
no longer affects: unity
Changed in gedit (Ubuntu):
status: Invalid → Triaged
summary: - Gedit not single instance when started from unity
+ doesn't reuse running instance when started from nautilus
Revision history for this message
jdaviescoates (josef-uniteddiversity) wrote : Re: [Bug 777292] Re: Gedit not single instance when started from unity

On 27 January 2012 13:51, Sebastien Bacher <email address hidden> wrote:

> you are sure that you use unity-3d and not 2d?

No, not at all! :P

I've tried selecting 2d and/ or 3d a couple of times but didn't notice any
difference at all. So perhaps when I choose 3d it reverts to 2d anyway
because my computer doesn't support 3d or something?

can you run a ps afx |
> grep unity?

Would appear I'm using 2d:

 3085 ? Sl 6:33 \_ unity-2d-launcher
 3086 ? Sl 6:08 \_ unity-2d-panel
 3255 ? Sl 5:39 /usr/lib/unity/unity-panel-service
 8773 pts/1 S+ 0:00 \_ grep --color=auto unity
19936 ? Sl 0:33 /usr/bin/unity-2d-spread
 8187 ? Sl 0:18 /usr/bin/unity-2d-places
 8237 ? Sl 0:05
/usr/lib/unity-lens-applications/unity-applications-daemon
 8240 ? Sl 0:00 /usr/lib/unity-lens-files/unity-files-daemon
 8241 ? Sl 0:01 /usr/lib/unity-lens-music/unity-music-daemon
 8282 ? Sl 0:00 /usr/lib/unity-lens-music/unity-musicstore-daemon

> do you have any special dbus environment?
>

/me shrugs

Sorry, despite being a linux user since before ubuntu existed I don't even
know what means :P

Cheers,

Josef.

--
Josef Davies-Coates
United Diversity

07974 88 88 95
http://uniteddiversity.com

Follow us on Twitter <http://twitter.com/uniteddiversity> and
Facebook<http://facebook.com/uniteddiversity>

*Together We Have Everything*

Changed in gedit:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
Christoph Korn (c-korn) wrote :

This is the only output regarding DBUS:
$ strings /proc/5548/environ | grep DBUS
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-PwOQj2JfC6,guid=d834a9413e993315867021320000007d

I start gedit from nautilus by just opening a text file.

Am 27.01.2012 15:02, schrieb Sebastien Bacher:
> see bug #827414 as well which was the original bug, could those having the issue start nautilus from nautilus and run
> "strings /proc/$(pidof gedit)/environ | grep DBUS"
>
> does it list a DBUS_STARTER_ADDRESS? how do you start nautilus and how
> do you start gedit from nautilus?
>

Changed in gedit:
status: New → Fix Released
Revision history for this message
Sebastien Bacher (seb128) wrote :

the bug has been fixed upstream and the fix should be in precise with the next update (which is planned for in a week)

Changed in gedit (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gedit - 3.3.3-0ubuntu1

---------------
gedit (3.3.3-0ubuntu1) precise; urgency=low

  * New upstream version:
    - correctly re-use running instance (lp: #777292)
    - use correct menuitem separator (lp: #902814)
  * debian/gedit-dev.install:
    - updated to include the pygobject override
  * debian/patches/11_correct_gettext_domain.patch:
    - dropped, the fix is in the new version
  * debian/patches/git_invalid_unrefing.patch:
    - dropped, the fix is in the new version
 -- Sebastien Bacher <email address hidden> Mon, 06 Feb 2012 22:57:01 +0100

Changed in gedit (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Vadim Rutkovsky (roignac) wrote :

Reproduced the same bug in 3.3.3-0ubuntu1 via steps from comment #22

description: updated
Revision history for this message
Julien Olivier (julo) wrote :

I confirm that the bug is *not* fixed with the latest gedit update.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, I reopened the upsteam and launchpad bugs

Changed in gedit (Ubuntu):
status: Fix Released → Triaged
Changed in gedit:
status: Fix Released → New
affects: gedit (Ubuntu) → gtk+3.0 (Ubuntu)
affects: gtk+3.0 (Ubuntu) → ubuntu
Revision history for this message
Teo (teo1978) wrote :

Please see also #777292

This not only happens when launching gedit in "different ways" (i.e. one clicking on a file and the other from a terminal).

This also systematically happens when opening multiple files all by double clicking in Nautilus if the current gedit window exceeds even the slightest bit outside of the current screen.
However I've just observed it happen even though the current gedit window was fully within the screen.

Changed in gedit:
status: New → Confirmed
Revision history for this message
rg (rob-themayfire) wrote :

I can still reproduce this bug on Ubuntu 12.10, gedit 3.6.1, unity 6.10.0.
But it depends on how I open the initial instance of gedit:

TO REPRODUCE:
1. Close all gedit instances
2. Open gedit from the Unity launcher (and optionally open some files via File > Open, but it makes no difference for what happens next)
3. Open nautilus and double-click a text file -- it opens in a new gedit instance, whereas I would like it to open in a tab in the existing instance

TO NOT REPRODUCE:
1. Close all gedit instances
2. Open nautilus and double-click a text file to launch gedit
3. Go back to nautilus and double-click another text file -- it opens in a tab in the existing gedit instance, as desired

Throughout all of this I am only using a single workspace, and gedit is always maximized.

So it's a mixed-workflow thing, but I seem to use that workflow pretty commonly...

Revision history for this message
rg (rob-themayfire) wrote :

Oops, as soon as I posted that last comment I thought to check ps and realized I'm looking at multiple windows, not multiple instances of gedit. In all cases there is only a single instance of gedit in the process list. The complaint is still effectively the same, but maybe this go to a separate bug report since this report refers to "instance" in the title?

affects: ubuntu → gedit (Ubuntu)
Revision history for this message
Doug McMahon (mc3man) wrote :

The issue no longer exists in gedit-3.7.x (3.7.5 here) though atm won't do too much good as wants gtk+3.0 (3.7/8

Revision history for this message
Christoph Korn (c-korn) wrote :

Do you know what commit fixes this?

Maybe it can be backported.

Revision history for this message
Doug McMahon (mc3man) wrote :

Broken in gedit -3.7.1, fixed in 3.7.2 as seen here with some quick builds on -
raring-13.04, gtk-3.0 (3.6.4), libpeas-1.7
(needed new libpeas for 3.7.3, the others??

Changed in gedit:
status: Confirmed → Fix Released
Revision history for this message
Paul White (paulw2u) wrote :

Upstream bug showing "RESOLVED FIXED on 2013-11-09
Checked ok with Ubuntu 18.04 and gedit 3.28.1
Marking "Fix Released" to close

Changed in gedit (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.