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 312847 - wrong file extension in window title
wrong file extension in window title
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
git master
Other Linux
: Normal major
: ---
Assigned To: Evince Maintainers
Evince Maintainers
: 313162 321911 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-08-08 05:42 UTC by Behnam Esfahbod
Modified: 2007-01-23 20:04 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
"Narasimhan4.ps" opened in evince (113.71 KB, image/png)
2005-08-08 05:44 UTC, Behnam Esfahbod
  Details
patch (1.71 KB, patch)
2005-08-08 14:24 UTC, Dan Winship
none Details | Review

Description Behnam Esfahbod 2005-08-08 05:42:43 UTC
evince changes file extension in title of window.  i opened "Narasimhan4.ps"
file it set title to "Narasimhan4.dvi".
Comment 1 Behnam Esfahbod 2005-08-08 05:44:16 UTC
Created attachment 50368 [details]
"Narasimhan4.ps" opened in evince

Here are a screenshot.
Comment 2 Dan Winship 2005-08-08 14:24:59 UTC
Created attachment 50391 [details] [review]
patch

Yeah, this has annoyed me too. It's dvips's fault really. When converting from
dvi to ps, it just claims that the dvi filename is the document title. This
patch makes the ps backend ignore the %%Title comment if it ends in ".dvi", on
the grounds that showing the PS file's actual filename in the titlebar would be

more useful in that case.
Comment 3 Martin Kretzschmar 2005-08-08 14:37:04 UTC
If we do this, maybe we should sanitize titles of PDFs that identify as
"Microsoft Word - foobar.doc", too?
Comment 4 Nickolay V. Shmyrev 2005-08-11 04:29:42 UTC
*** Bug 312846 has been marked as a duplicate of this bug. ***
Comment 5 Nickolay V. Shmyrev 2005-08-11 04:30:49 UTC
*** Bug 313162 has been marked as a duplicate of this bug. ***
Comment 6 Nickolay V. Shmyrev 2005-08-11 04:32:58 UTC
In the bugs above there was a suggestion to include also "Evince" and replace
title by file name since title sometimes is confusing.

Comment 7 Behdad Esfahbod 2005-08-11 06:56:36 UTC
To include Evince in the window title or not to include should follow the GNOME
policy, that I really don't know at this time.  About the title, if document
title is set, use it and put filename in parantheses after the title.  Use file
name otherwise.
Comment 8 Behnam Esfahbod 2005-08-11 07:14:04 UTC
I didn't said to write "Evince" in window title.  Maybe just "Document Viewer".
 If someone ask user that which application she's using, she can say "Web
Browser", "Document Viewer", etc.

behdad: Your solution about the filename looks fine for me.
Comment 9 Marco Pesenti Gritti 2005-08-16 11:06:09 UTC
Comment on attachment 50391 [details] [review]
patch

+		const char *ext = strrchr (ps->doc->title, '.');
+		if (!ext || strcmp (ext, ".dvi") != 0) {

Any reason we cant simply do !g_str_has_suffix (ps->doc->title, ".dvi"); here?

Please add a comment explaining why we are special casing this...
Comment 10 Marco Pesenti Gritti 2005-08-16 11:16:22 UTC
About showing both title and name, I'm not sure it will help much. How is

hello.pdf (hello.doc)

or

hello.doc (hello.pdf)

clearer?

I'd rather give a try to a special casing approach like the one in Dan patch
(show the filename if the title contains some known extensions basically) first.
Bryan, what do you think?
Comment 11 Dan Winship 2005-08-16 13:02:19 UTC
re: comment #9, I'd never noticed g_str_has_suffix() before. :-}
Comment 12 Bryan W Clark 2005-08-16 16:17:40 UTC
Sure.

I like the "show the filename if the title contains some known extensions"
approach.  I would go with the: $title ($filename) format, since there are weird
cases of "Microsoft Word - $title.doc" which would be better to keep normal and
just let people know that the filename is different.
Comment 13 Behnam Esfahbod 2005-08-18 12:37:57 UTC
Showing file name in window title is necessary if application doesn't show it
anywhere.  A browser have a URL box, so it doesn't show filename in title.

/me prefers "$title ($filename)" format too.
Comment 14 Marco Pesenti Gritti 2005-08-18 12:51:59 UTC
Bryan, do you think we should ever use "$title ($filename)" or just in the case
of title containing weird extensions?
Comment 15 Bryan W Clark 2005-08-18 14:20:49 UTC
Marco: I think this is just in the case of the weird extensions
Comment 16 Marco Pesenti Gritti 2005-09-02 13:38:13 UTC
I suppose this depend on the resolution of bug 313297
Comment 17 Marco Pesenti Gritti 2005-09-16 13:14:06 UTC
I implemented it for the two types reported here (dvi, doc). It's just a table
though, so it should be easy to extend.
Comment 18 Nickolay V. Shmyrev 2005-11-24 08:57:57 UTC
*** Bug 321911 has been marked as a duplicate of this bug. ***
Comment 19 Daniel Macks 2006-01-13 23:26:47 UTC
Regarding comment #13, why couldn't the inclusion of filename in the window title be made a user preference? A menu item to choose among ["title" "filename" "both"] perhaps? Having the filename in the title bar is a useful option for me in two situations (sorta related to bug 313297):

It's pretty annoying when I have created several pdfs from a source document using different options, or have edited a copy of a pdf file. I don't use a GUI file manager, so thumbnails aren't an option, and the differences might not be visible in them anyway. 'evince foo1.pdf;evince foo2.pdf'; now which window is which?

Several online journals I read have their articles all titled "No Job Name", and a quick google reveals this is a common "feature" (apparently of Acrobat Distiller in my experience). This makes it quite confusing to switch among several open article windows. Evince is spawned from from selecting links in a web-browser or some other app, so even thumbnails in the Open dialog wouldn't help.
Comment 20 Nickolay V. Shmyrev 2007-01-12 08:46:40 UTC
*** Bug 386292 has been marked as a duplicate of this bug. ***
Comment 21 Michael Trausch 2007-01-12 15:53:45 UTC
I agree with comment #19 here.  It is completely reasonable to have a preferences dialog that gives the user the choice.  Otherwise, the only right thing to do is to display the file name all the time, because there are entirely too many horribly created PDF documents out there.

Evince, like all software, should be flexible.  But, it was stated in Bug 386292 that “There will be no preferences dialog in evince.”

I certainly cannot implement a preferences dialog for evince… Non-trivial C programs confuse the hell out of me, and I cannot read them.  I cannot even read through the “heuristics” mentioned in bug 386292 from ev-window-title.c.  If I studied it for another several hours, I might get it, but I have school work to do that is not in any way related; so that isn’t an option for me right now.
Comment 22 Nickolay V. Shmyrev 2007-01-12 15:57:14 UTC
If you have any questions about evince programming, feel free to ask on evince mailing list or on #evince channel on gimpnet.
Comment 23 Daniel Macks 2007-01-23 20:04:30 UTC
Chapter 3 of the GNOME HIG v2.0 tells us that filename is indeed the appropriate default window title:

Parts of Windows and System Interaction: Titles

Give every window a title (with the exception of alerts and toolboxes). A good window title contains information that is relevant to the user, and distinguishes a particular window from other open windows.

and

Primary Windows: Title

The most important element of a document-based application's window title is the name of the open document. [...]
Guidelines
* Use Filename as the window title for document-based applications. Do not use the full pathname, as the filename alone is easier to distinguish amongst other open window titles, for example on the window list.