Closed Bug 461501 Opened 16 years ago Closed 15 years ago

Two windows opened when clicking a local html file or internet shortcut / Do not use DDE on Windows

Categories

(SeaMonkey :: General, defect)

x86
Windows 2000
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: s.a.moeller, Assigned: mcsmurf)

References

Details

(Keywords: regression)

Attachments

(2 files, 5 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1b1pre) Gecko/20080925121544 SeaMonkey/2.0a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1b1pre) Gecko/20080925121544 SeaMonkey/2.0a1

If you register SeaMonkey 2.0a1 as your default internet application on Windows 2000, and then double click a local html file or an internet shortcut file, SeaMonkey will open two windows at once.

Reproducible: Always

Steps to Reproduce:
1. Install SM 2.0a1 on Windows 2000 and check the "default application" entries on the corresponding SeaMonkey installer dialog.
2. Double click a local html file or an internet shortcut file.
Actual Results:  
Two browser windows open (both having the same content).

Expected Results:  
Only one window.

Now I've searched through the Windows registry and deleted the "ddeexec" subfolders for all those protocols and file types SeaMonkey is associated with. That fixes the problem. And it seems to have no other negative impact. So why use DDE at all?
More precise:

Steps to Reproduce:
1. Install SM 2.0a1 on Windows 2000 and check the "default application" entries
on the corresponding SeaMonkey installer dialog.
2. Close all SM windows.
3. Double click a local html file or an internet shortcut file.
Actual Results:  
Two browser windows open (both having the same content).
Version: unspecified → Trunk
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b2pre) Gecko/20081023 SeaMonkey/2.0a2pre

It open two browser window, when in Profile Manager is one profile or mark option "Don't ask at startup".

When it open Profile Manager during start html local file, past click button "Use Profile" SeaMonkey Crash.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking-seamonkey2.0a2?
For crash was file Bug 462221
Keywords: regression
Probably need to port Bug 370053 to SeaMonkey.
Just checked in SeaMonkey 1.x code, it does not use DDE for the file extension registry entries and normal protocol registry entries, only for the http protocol. I guess I'll change it back to the 1.x way then in Bug 453797.
Depends on: 453797
Set blocking on bug 453797 which should fix this issue.
Flags: blocking-seamonkey2.0a2? → blocking-seamonkey2.0a2-
Could you test and confirm bug 453797 comment 11 (resolution) ?
Latest trunk nightly [Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1b3pre) Gecko/20081201 SeaMonkey/2.0a2pre] still uses DDE, therefore this bug remains present.

Does that build actually contain the fix to bug 453797?
No, try tomorrow's nightly.
Still not fixed in Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1b3pre) Gecko/20081202 SeaMonkey/2.0a2pre
Can you maybe try to just manually set IE as default and then SeaMonkey as default again? I don't think the current code bothers to delete the DDE entries.
I *have* manually removed all DDE entries from the registry before installing SeaMonkey.

The procedure was as follows:

1. Set Firefox as default browser, uninstalled SeaMonkey and manually removed all DDE entries.

2. Ran the SeaMonkey installer. --> Result: All DDE entries are back again - those for the classes SeaMonkeyHTML and SeaMonkeyURL, and those for the protocols http, https, ftp, and gopher.

3. Set SeaMonkey as default browser. --> 2 Windows open, both for local html files and internet shortcuts.

4. Manually removed the DDE entries from the classes SeaMonkeyHTML and SeaMonkeyURL. --> 1 Window when opening a html file, but still 2 Windows when clicking an internet shortcut (or when SeaMonkey is invoked from another application).

5. Manually removed all DDE entries from the four protocols also. --> Now everything is fine: Only one Window in any case.

6. Set Firefox as default browser.

7. Set SeaMonkey as default browser again. --> The DDE entries for the protocols http, https, ftp, and gopher reappeared. --> Still 1 Window when opening a html file, but again 2 Windows when clicking an internet shortcut.
Attached patch Patch (obsolete) — Splinter Review
This one fixes the HTML file part. Need to do more research on the http one (as we need to keep DDE there for other programs opening URLs with SeaMonkey).
Attached patch Better patchSplinter Review
Fixes another instance in the code (only used in special cases)
Attachment #350991 - Attachment is obsolete: true
Attachment #350993 - Flags: review?(bugzilla)
Comment on attachment 350993 [details] [diff] [review]
Better patch

This looks reasonable, though I haven't tested it.
Attachment #350993 - Flags: review?(bugzilla) → review+
Comment on attachment 350993 [details] [diff] [review]
Better patch

Checked in, changeset 4df5cfe0ebc5, a=KaiRo via IRC
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090114 SeaMonkey/2.0a3pre

It's work fine for me.
I was able to get the double windows to open (clicking on links in Outlook) with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090127 SeaMonkey/2.0a3pre

If SeaMonkey is already open, only one window opens. If SeaMonkey is not open, it will launch two windows. One will go to my startup page, the other window will open to where the link is.

Opening a shortcut link on the desktop opens two windows, both with the destination listed in the shortcut.

Behaves the same in  Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090130 SeaMonkey/2.0a3pre
This should do the trick.
Assignee: nobody → bugzilla
Status: NEW → ASSIGNED
That one is better.
Attachment #360101 - Attachment is obsolete: true
Attachment #360102 - Flags: review?(neil)
Comment on attachment 360102 [details] [diff] [review]
Patch (fixes opening internet shortcuts)

Ignore the var url; in the patch, I forgot to remove it before uploading.
Comment on attachment 360102 [details] [diff] [review]
Patch (fixes opening internet shortcuts)

>+        var found = false;
Not sure we need to use found either.
>
>+        urlParam = resolveURIInternal(cmdLine, urlParam);
>+        if (this._handledURI.spec == urlParam.spec) {
>+          this._handledURI = {};
>+          found = true;
>           cmdLine.preventDefault = true;
Drop the above two lines
>+        }
>+        if (!found) {
Change to else
>+          if (cmdLine.handleFlag("requestpending", false) &&
>+              cmdLine.state == nsICommandLine.STATE_INITIAL_LAUNCH) {
>+            // A DDE request with the URL will follow and the DDE handling code
>+            // will send it to the commandline handler via
>+            // "mozilla -url http://www.foo.com". Store the URL so we can
>+            // ignore this request later
>+            this._handledURI = urlParam;
>+          }          
>+
>+          handURIToExistingBrowser(urlParam,
>+                                   nsIBrowserDOMWindow.OPEN_DEFAULTWINDOW,
>+                                   features);
>+          cmdLine.preventDefault = true;
Remove the above line.
>         }
Add "cmdLine.preventDefault = true;" here.
>       }
>     } catch (e) {
Even better patch :)
Attachment #360102 - Attachment is obsolete: true
Attachment #360112 - Flags: review?(neil)
Attachment #360102 - Flags: review?(neil)
Comment on attachment 360112 [details] [diff] [review]
Patch (fixes opening internet shortcuts)

>+  _handledURI: {},
I think we can store a string (or null) here, rather than an object.

>+        urlParam = resolveURIInternal(cmdLine, urlParam);
>+        if (this._handledURI.spec == urlParam.spec) {
Is it worth comparing the saved param before resolving it? It would avoid resolving it twice when we've already seen the param.
Attachment #360112 - Attachment is obsolete: true
Attachment #360380 - Flags: review?(neil)
Attachment #360112 - Flags: review?(neil)
Comment on attachment 360380 [details] [diff] [review]
Patch (fixes opening internet shortcuts)

>+        if (this._handledURI == urlParam) {
>+          this._handledURI = "";
>+        }
>+        else {
null, perhaps? Also, either use } else { or drop the {}s on the if block.
Attached patch PatchSplinter Review
Attachment #360380 - Attachment is obsolete: true
Attachment #360610 - Flags: review?(neil)
Attachment #360380 - Flags: review?(neil)
Attachment #360610 - Flags: review?(neil) → review+
Comment on attachment 360610 [details] [diff] [review]
Patch

Pushed to c-c, changeset 5a6f689dc786.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
I couldn't reproduce problem with following build. When Seamonkey was newly started from internet short-cut, only single SM window was opened, even with multiple profiles if "Don't ask at startup" was checked. 
Note: Bug 476988 still occurs, if "Don't ask at startup" is not checked.

> Build identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.9.1b3pre) Gecko/20090208 SeaMonkey/2.0a3pre
> about:buildconfig
> Source
> Built from http://hg.mozilla.org/releases/mozilla-1.9.1/rev/c8099a4c91c3
> Build platform
> target
> i686-pc-mingw32
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: