The default bug view has changed. See this FAQ.

Implement remaining parts of GNOME shell service

RESOLVED FIXED in seamonkey2.15

Status

SeaMonkey
OS Integration
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: neil@parkwaycc.co.uk, Assigned: neil@parkwaycc.co.uk)

Tracking

unspecified
seamonkey2.15
All
Linux

SeaMonkey Tracking Flags

(seamonkey2.15 fixed)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

5 years ago
Bug 774130 implemented the desktop background functions but the default client functions have not been implemented yet.
(Assignee)

Comment 1

5 years ago
Created attachment 653200 [details] [diff] [review]
Proposed patch
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #653200 - Flags: review?(iann_bugzilla)

Comment 2

5 years ago
(In reply to neil@parkwaycc.co.uk from comment #1)
> Created attachment 653200 [details] [diff] [review]
> Proposed patch

This has bitrotted against current trunk (PRUint16 -> uint16_t and PRInt32 -> int32_t)
(Assignee)

Comment 3

5 years ago
Created attachment 655321 [details] [diff] [review]
Updated for bitrot
Attachment #653200 - Attachment is obsolete: true
Attachment #653200 - Flags: review?(iann_bugzilla)
Attachment #655321 - Flags: review?(iann_bugzilla)

Comment 4

5 years ago
With patch applied I get:
Segmentation fault (core dumped)
Backtrace is:
#0  0x00007fffe9ed6141 in nsACString::Equals (this=<value optimized out>, 
    other=0x0, c=
    0x7fffe9ed610e <nsACString::DefaultComparator(nsACString::char_type const*, nsACString::char_type const*, uint32_t)>)
    at /central/comm-central/mozilla/xpcom/glue/nsStringAPI.cpp:703
#1  0x00007fffe9ed3c45 in nsGNOMEShellService::HandlerMatchesAppName (this=
    0x7fffd7ad2520, aHandler=<value optimized out>)
    at /central/comm-central/suite/shell/src/nsGNOMEShellService.cpp:155
#2  0x00007fffe9ed43a9 in nsGNOMEShellService::IsDefaultClient (this=
    0x7fffd7ad2520, aStartupCheck=<value optimized out>, aApps=2, 
    aIsDefaultClient=0x7fffffff7c20)
    at /central/comm-central/suite/shell/src/nsGNOMEShellService.cpp:192
#3  0x00007ffff4af4ba8 in NS_InvokeByIndex_P (that=<value optimized out>, 
    methodIndex=<value optimized out>, paramCount=<value optimized out>, 
    params=<value optimized out>)
    at /central/comm-central/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_unix.cpp:164
#4  0x00007ffff44ab529 in XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode) ()
   from /central/sm-opt/mozilla/dist/bin/libxul.so

Comment 5

5 years ago
With the if (command) inserted as suggested it now doesn't seg fault.
In testing, it allows you to set as default client but the default client recognition doesn't work properly.
STR
1/ Start Firefox and set as default browser client
2/ Restart Firefox, doesn't prompt to be set as default client.
3/ Close Firefox
4/ Start SeaMonkey
5/ Prompts to be set as default client.
6/ Restart SeaMonkey, still prompts to be the default client.
7/ Close SeaMonkey and start Firefox - prompts to be set as default client (but don't set it)
(Assignee)

Comment 6

5 years ago
(In reply to Ian Neal from comment #5)
> With the if (command) inserted as suggested it now doesn't seg fault.
I'll probably go for command && to match what happens in Init().

> In testing, it allows you to set as default client but the default client
> recognition doesn't work properly.
> STR
> 1/ Start Firefox and set as default browser client
> 2/ Restart Firefox, doesn't prompt to be set as default client.
> 3/ Close Firefox
> 4/ Start SeaMonkey
> 5/ Prompts to be set as default client.
> 6/ Restart SeaMonkey, still prompts to be the default client.
> 7/ Close SeaMonkey and start Firefox - prompts to be set as default client
> (but don't set it)

What happens if you open Preferences and click set as default browser twice in a row?

Comment 7

5 years ago
(In reply to neil@parkwaycc.co.uk from comment #6)
> What happens if you open Preferences and click set as default browser twice
> in a row?
The first time it changes to "SeaMonkey has been set as your default browser" and the button stays enabled. The second time nothing changes. Firefox thinks that it is not the default browser (so I assume SeaMonkey actually is).
(Assignee)

Comment 8

5 years ago
Do you have a ~/.gconf/desktop/gnome/url-handlers/http/%gconf.xml and/or ~/.local/share/applications/mimeapps.list (and also any relevant .desktop file in the same folder)?

Comment 9

5 years ago
(In reply to neil@parkwaycc.co.uk from comment #8)
> Do you have a ~/.gconf/desktop/gnome/url-handlers/http/%gconf.xml
Yes, but 0 in size
> and/or
> ~/.local/share/applications/mimeapps.list (and also any relevant .desktop
> file in the same folder)?
No mimeapps.list but mimeapps.cache
there is a preferred-web-browser.desktop file that correctly points to seamonkey

Comment 10

5 years ago
Comment on attachment 655321 [details] [diff] [review]
Updated for bitrot

> NS_IMETHODIMP
> nsGNOMEShellService::IsDefaultClient(bool aStartupCheck, uint16_t aApps,
>                                      bool* aIsDefaultClient)
>+
>+        app->GetCommand(handler);
Check if the above line has succeeded, TB uses rv= and then NS_SUCCEEDED(rv) && in the if statement below.
>+        if (!HandlerMatchesAppName(handler.get()))
>+         return NS_OK;
>+      }
>+
>+      if (gconf) {
>+        bool enabled;
>+        gconf->GetAppForProtocol(protocol, &enabled, handler);
Check if the above line has succeeded, TB uses rv= and then NS_SUCCEEDED(rv) && in the if statement below.
>+        if (!enabled || !HandlerMatchesAppName(handler.get()))
>+          return NS_OK;
>+      }

Those changes seem to fix the detection for me.

Both TB and Firefox do gconf first but I see no problem doing it last.

r=me with the succession detection.
Attachment #655321 - Flags: review?(iann_bugzilla) → review+

Comment 11

5 years ago
s/sion/s/
(Assignee)

Comment 12

5 years ago
Created attachment 657689 [details] [diff] [review]
Addressed review comments

Fixing the crash as well as the error checking.
Attachment #655321 - Attachment is obsolete: true
Attachment #657689 - Flags: review+
(Assignee)

Comment 13

5 years ago
Pushed comm-central changeset 8cd81ff229eb.
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Settings flags to make tracking of fixed easier.
status-seamonkey2.15: --- → fixed
Target Milestone: --- → seamonkey2.15
You need to log in before you can comment on or make changes to this bug.