Bug 2519 - KDE opens gedit with new untitled file as well as requested file
Summary: KDE opens gedit with new untitled file as well as requested file
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: John Balcaen
QA Contact:
URL:
Whiteboard: MGA2TOO
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-26 16:15 CEST by Frank Griffin
Modified: 2013-06-11 20:00 CEST (History)
6 users (show)

See Also:
Source RPM: gedit-3.3.1-1.mga2.src.rpm
CVE:
Status comment:


Attachments

Description Frank Griffin 2011-08-26 16:15:13 CEST
If you right-click on a text file in Dolphin, and select "Open With" and "gedit", gedit opens with a tab for the requested file followed by a tab for "Unsaved Document 1", which is empty but marked as modified.  The tab for the requested file is the selected tab, but closing the window results in a prompt about saving the empty file.

If you invoke gedit on the same file from the command line, it works correctly.  The /usr/share/applications/gedit.desktop file shows "Exec = gedit %U", so I'm guessing that there is something wrong with the %U KDE is passing.
Manuel Hiebel 2011-09-03 22:59:23 CEST

CC: (none) => fundawang, jani.valimaa
Assignee: bugsquad => balcaen.john

Comment 1 John Balcaen 2011-09-03 23:53:30 CEST
Something strange here is that it's happening only with gedit.
If you're opening with leafpad or another text editor (using %U) in the command line it does not happen, for example Kate is also using %U for passing the url in the desktop file & only one tab is open.
Even switching to a %f as argument ( or removing it at all ) to provide only one argument to gedit it is still opening 2 tabs...
So i really don't understand why this behaviour is different than others text editor even others gtk's one.
Comment 2 Marja Van Waes 2011-12-29 20:40:16 CET
ping because this bug had no activity since nearly 4 months ago, but still has the status NEW

@ John
Please set status to ASSIGNED if you think this bug was assigned correctly. If for work flow reasons you can't do that, then please put OK on the whiteboard instead.

CC: (none) => marja11

Comment 3 John Balcaen 2011-12-29 21:50:06 CET
@Marja
Could you add ovitters in cc, he's the maintainer of gedit & he might have an idea.
So far as said i stricly don't understand why it's working for all editor except gedit.

CC: (none) => balcaen.john

John Balcaen 2011-12-29 21:55:09 CET

Source RPM: kde => gedit-3.3.1-1.mga2.src.rpm

Comment 4 Marja Van Waes 2011-12-29 22:01:40 CET
(In reply to comment #3)
> @Marja
> Could you add ovitters in cc, he's the maintainer of gedit & he might have an
> idea.
> So far as said i stricly don't understand why it's working for all editor
> except gedit.

@ Olav

can you look into this, please?

CC: (none) => olav

Comment 5 Frank Griffin 2011-12-29 23:00:21 CET
As an addendum, this also happens when gedit is added to the KDE panel and invoked from there by clicking the icon.  I just checked the icon properties, and it shows the associated command as "gedit-2", but when I try to execute gedit-2 from the command line, it can't find it.

So is gedit-2 some KDE-supplied intermediary which KDE finds by itself ?  If so, perhaps the error lies in how gedit-2 invokes gedit.
Comment 6 John Balcaen 2011-12-29 23:47:40 CET
(In reply to comment #5)
> As an addendum, this also happens when gedit is added to the KDE panel and
> invoked from there by clicking the icon.  I just checked the icon properties,
> and it shows the associated command as "gedit-2", but when I try to execute
> gedit-2 from the command line, it can't find it.
How did you add it on the panel ?
Because when i'm adding it on the panel here i can reproduce the « gedit-2 ».
Comment 7 Frank Griffin 2011-12-30 00:46:00 CET
Navigate the application menu to the gedit entry, right-click, and select "add to panel".

Is that a typo, or did you mean that you actually *can* reproduce it ?
Comment 8 John Balcaen 2011-12-30 01:26:43 CET
I mean that i navigate the application menu to the gedit entry & then right click & i select add to the panel.
The icon added on the panel is named gedit & not gedit-2.
So here i can't reproduce the « gedit-2 » bug :)
Comment 9 Frank Griffin 2011-12-30 01:36:03 CET
It's weird.  I removed the icon and re-added it, and it still says "gedit-2".  And when you click on the icon, it launches gedit successfully.
Comment 10 John Balcaen 2011-12-30 02:46:05 CET
you don't have eventually a previous icon ?
Comment 11 Frank Griffin 2011-12-30 12:19:33 CET
(In reply to comment #10)
> you don't have eventually a previous icon ?

?  Sorry, I don't understand.
Comment 12 John Balcaen 2011-12-30 12:26:39 CET
I was wondering if you don't have already on your panel a previous gedit icon/launcher which could eventually explain that the « next » installed icon/launcher get renamed to -2. (Of course i'm not able to demonstrate it locally since when i'm adding several gedit icon/launcher on my panel, they still have the « gedit » name)
Comment 13 Frank Griffin 2011-12-30 14:22:00 CET
Ah, my error.  I was looking at the General tab, and mistook the icon name for the execution string.

I've tested a bit more with this, replacing the gedit executable with one of my own to print the arguments, but while it runs fine from the command line, it segfaults when launched by KDE.  However, I was able to verify via strace that gedit is indeed being execve'd with no arguments other than the "gedit" name as argv[0].  So the value of %U in the KDE invocation is correct.

If I launch gedit from the command line, it comes up with "Unsaved File 1" opened as a tab but not marked as changed, and it stays that way.  If I launch it via KDE, the same thing happens, but then the asterisk appears on the tab indicating that the file has been modified.

So, it appears that KDE is sending gedit a window event after launching it, and that this is what causes gedit to mark the file as changed.

To test this, I checked "run in terminal" in the icon settings, and the error did not occur.

Is there a way to trace window events for a KDE application ?
Comment 14 Frank Griffin 2012-04-15 16:31:07 CEST
Still happening in current cauldron.
Jani Välimaa 2012-04-28 10:05:37 CEST

CC: jani.valimaa => (none)

Comment 15 Marja Van Waes 2012-05-26 13:09:34 CEST
Hi,

This bug was filed against cauldron, but we do not have cauldron at the moment.

Please report whether this bug is still valid for Mageia 2.

Thanks :)

Cheers,
marja

Keywords: (none) => NEEDINFO

Frank Griffin 2012-06-12 20:50:37 CEST

Keywords: NEEDINFO => (none)
Whiteboard: (none) => MGA2TOO

Comment 16 Marja Van Waes 2012-07-06 15:05:50 CEST
Please look at the bottom of this mail to see whether you're the assignee of this  bug, if you don't already know whether you are.


If you're the assignee:

We'd like to know for sure whether this bug was assigned correctly. Please change status to ASSIGNED if it is, or put OK on the whiteboard instead.

If you don't have a clue and don't see a way to find out, then please put NEEDHELP on the whiteboard.

Please assign back to Bug Squad or to the correct person to solve this bug if we were wrong to assign it to you, and explain why.

Thanks :)

**************************** 

@ the reporter and persons in the cc of this bug:

If you have any new information that wasn't given before (like this bug being valid for another version of Mageia, too, or it being solved) please tell us.

@ the reporter of this bug

If you didn't reply yet to a request for more information, please do so within two weeks from now.

Thanks all :-D
Comment 17 Frank Griffin 2012-07-31 16:48:34 CEST
Still happening in current cauldron.
Comment 18 Max Harmathy 2012-11-14 16:59:04 CET
This seems to be a bug in gedit itself, which still exist in the 3.6 release.

I can reproduce this behaviour with the latest gedit release in KDE. But the gedit fork pluma from the MATE-Project just works as expected.

CC: (none) => harmathy

Comment 19 Frank Griffin 2012-11-14 17:18:28 CET
Why do you think it's a gedit bug ?  If I launch gedit from a command line in KDE, it behaves as expected.

It's only when KDE itself launches it that you have the extra file.

And I don't think it has anything to do with my panel button, since I can cause the error by right-clicking on a .txt file in Dolphin and selecting Open With -> gedit.
Comment 20 Max Harmathy 2012-11-14 17:26:52 CET
As I said: pluma works perfectly fine, even if started from dolphin. And pluma is a gedit fork. Therefore either this problem was introduced in gedit after the fork or it was then resolved in pluma.
Comment 21 Frank Griffin 2012-11-15 03:00:03 CET
I'm afraid that's not a lock.  I suspect that the difference between command-line invocation and KDE invocation is that KDE uses gedit.desktop, which uses "Exec=gedit %U".  I suspect that the problem is that whatever KDE is supplying as %U is something incorrect that gedit doesn't handle.  It's possible that gedit *should* handle it, and that it just doesn't, but it's also possible that it's not something that gedit ought to have to handle.

As for pluma, it's possible that their developers found the problem and put in a workaround, but that doesn't mean that it wasn't a KDE problem to begin with.
Comment 22 Frank Griffin 2013-01-17 17:27:31 CET
Still happening in current cauldron.
Comment 23 Rolf Pedersen 2013-05-30 21:05:22 CEST
I got here via google as I have been seeing this annoyance of extra tab for opening a file and unjustified "changed" flag for the untouched Unsaved Document 1, requiring further action when closing gedit.

Here I'm using Rosa 2012.1 and gedit-3.6.2-1-rosa2012.1.x86_64 from gedit-3.6.2-1.src.rpm

Checking "Run in terminal" for the icon settings results in a "clean" start of gedit, no changed flag, here, also.

The output in that terminal is as follows:

(gedit:15472): Gtk-WARNING **: Theme parsing error: menu.css:88:11: '' is not a valid color name

(gedit:15472): Gtk-WARNING **: Theme parsing error: menu.css:93:11: '' is not a valid color name
GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.

** (gedit:15472): WARNING **: Could not load Peas repository: Typelib file for namespace 'Peas', version '1.0' not found

** (gedit:15472): WARNING **: Could not load PeasGtk repository: Typelib file for namespace 'PeasGtk', version '1.0' not found

** (gedit:15472): WARNING **: Could not load theme icon user-bookmarks-symbolic: Icon 'user-bookmarks-symbolic' not present in theme

** (gedit:15472): WARNING **: Could not load theme icon user-home-symbolic: Icon 'user-home-symbolic' not present in theme

** (gedit:15472): WARNING **: Could not load theme icon drive-harddisk-symbolic: Icon 'drive-harddisk-symbolic' not present in theme

CC: (none) => rolfpedersen

Comment 24 Frank Griffin 2013-06-11 20:00:41 CEST
This finally appears to be fixed in current cauldron.

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.