Last Comment Bug 93789 - Mozilla should support X11 session management
: Mozilla should support X11 session management
Status: RESOLVED FIXED
:
Product: Firefox
Classification: Client Software
Component: Shell Integration (show other bugs)
: Trunk
: All Linux
: -- enhancement with 25 votes (vote)
: Firefox 3 alpha7
Assigned To: Michael Wu [:mwu]
:
Mentors:
: 180319 192263 231047 253254 272104 354686 (view as bug list)
Depends on: 383760 389346 399161
Blocks: 19454 233462 388515 449548 388608
  Show dependency treegraph
 
Reported: 2001-08-05 12:13 PDT by Roland Mainz
Modified: 2010-10-13 03:29 PDT (History)
42 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
A patch to make mozilla gnome-session aware. (4.21 KB, patch)
2005-11-26 23:50 PST, Peter Haight
no flags Details | Diff | Splinter Review
Add support for xsmp (WIP), v1 (7.67 KB, patch)
2007-06-11 20:01 PDT, Michael Wu [:mwu]
no flags Details | Diff | Splinter Review
Add support for xsmp, v2 (7.68 KB, patch)
2007-06-14 12:03 PDT, Michael Wu [:mwu]
benjamin: review+
Details | Diff | Splinter Review
As checked in (8.06 KB, patch)
2007-07-16 19:32 PDT, Michael Wu [:mwu]
no flags Details | Diff | Splinter Review

Description Roland Mainz 2001-08-05 12:13:05 PDT
RFE: Mozilla should support X11 session management (see xsm(1)). This means it
should be possible to create snapshots of current mozilla windows (browser,
mailnews, editor(!!), etc.), shutdown the Zilla and restart it using those
session data later.

Note that that multiple session "snapshots" are allowed per user...
Comment 1 Ben Goodger (use ben at mozilla dot org for email) 2001-08-27 04:06:28 PDT
.
Comment 2 Roland Mainz 2002-01-24 06:37:40 PST
blizzard:
Wanna take a look at this one, please ?
Comment 3 Andrew Hagen 2002-04-29 10:36:32 PDT
This appears to depend on bug 36810, which also blocks some other bugs.
Comment 4 Andrew Hagen 2003-05-15 13:41:16 PDT
Actually, it might not.
Comment 5 David A Thompson 2003-11-26 10:17:55 PST
This looks like a few other bugs -- e.g., bugs 192263 and 180319
Comment 6 Christian :Biesinger (don't email me, ping me on IRC) 2004-01-20 05:17:58 PST
*** Bug 192263 has been marked as a duplicate of this bug. ***
Comment 7 Christian :Biesinger (don't email me, ping me on IRC) 2004-01-20 05:18:59 PST
*** Bug 231047 has been marked as a duplicate of this bug. ***
Comment 8 Johan Walles 2004-02-09 11:07:45 PST
Andrew, how does this bug block bug 19454 (crash recovery)?  I'm not saying it
doesn't, I just don't understand why it would.
Comment 9 Johan Walles 2004-02-09 11:09:44 PST
*** Bug 180319 has been marked as a duplicate of this bug. ***
Comment 10 Andrew Hagen 2004-02-09 16:01:50 PST
My imperfect understanding of X11 session management is that it functions kind
of like how the enhancement will function as requested by bug 63094, which also
blocks bug 19454. Although as per bug 19454 comment 71 it is the case that bug
19454 only covers enhancements that will store new data in the profile
directory, even if this enhancement request does not result in that, the
functionality is so similar that I feel it should be tracked with the others. If
I am wrong, please tell me.
Comment 11 Roland Mainz 2004-07-27 20:02:20 PDT
*** Bug 253254 has been marked as a duplicate of this bug. ***
Comment 12 Landon Curt Noll 2004-07-27 21:20:52 PDT
Just for reference on this bug, since bug #253254 was marked as a duplicate
of this bug:

KDE "Save session" for a session in which firefox is running will not result
in firefox restarting when one logs in.  The same applies when the KDE
Session Manager is configured to "Restore previous session" / so-called
session auto-save mode.  In either case firefox does not restart after
a subsequent login.

If one configures the firefox launch icon to "Run in terminal" (a gross
configuration that requires a launch of an empty terminal window in addition
to the firefox window), KDE "Save Session" (and auto-save) will restart a
single firefox session after login (with that gross extra empty terminal
session), however it will NOT start a 2nd firefox window and the single
firefox browser will not restore the previous URL and tab state.

One can launch multiple firefox windows under KDE.  One cannot save their
state (URL and tab state) and recreate the KDE session in a subsequent login.

KDE is able to save and restart multiple KDE konqueror browser windows
with their current URLs and tab state saved.  One cannot do this for firefox.

I am using RHEL 3 with an up2date patched system and the current firefox
browser version.

Reproducible: Always
Steps to Reproduce:
Firefox fails to restart a single browser from a manually saved session
without a terminal window:

1.launch firefox from a KDE launch icon without "run in terminal" set
2.perform a "Save Session" when the KDE Component: Session Manager is in
  "Restore manually saved session" 
3.logout
4.login

Firefox fails to restart multiple browsers from a manually saved session without
a terminal window:

1.launch 2 or more firefox browsers from a KDE launch icon without "run
in terminal" set
2.perform a "Save Session" when the KDE Component: Session Manager is in
  "Restore manually saved session" 
3.logout
4.login

Firefox fails to restore a single browser from a manually saved session
with a terminal window:

1.launch firefox from a KDE launch icon WITH "run in terminal" set
2.perform a "Save Session" when the KDE Component: Session Manager is in
  "Restore manually saved session" 
3.logout
4.login

Firefox fails to restart multiple browsers from a manually saved session
with a terminal window:

1.launch 2 or more firefox browsers from a KDE launch icon WITH "run
in terminal" set
2.perform a "Save Session" when the KDE Component: Session Manager is in
  "Restore manually saved session" 
3.logout
4.login

NOTE: Selecting the KDE Compenet Session Manager mode of "Restore previous
session" (auto session save) does not change the firefox restart problem.

Actual Results:  
Firefox fails to restart a single browser from a manually saved session
without a terminal window:

no firefox windows are started

Firefox fails to restart multiple browsers from a manually saved session
without a terminal window:

no firefox windows are started

Firefox fails to restore a single browser from a manually saved session
with a terminal window:

An empty window is started, however firefox does not restart with the
previous URLs and tab state.

Firefox fails to restart multiple browsers from a manually saved session
with a terminal window:

An empty window is started, however firefox does not restart with the
previous URLs and tab state.  No other firefox browsers are restated.


Expected Results:  
In all cases all of the firefox browsers should restart in their exact
window position in their exact virtual desktops with their saved URL
and tab state restored.
Comment 13 Timothy Miller 2004-11-07 15:31:47 PST
I'm glad to see that I'm not the only one who has this complaint.  I thought I
was doing something wrong, but it appears that Mozilla doesn't support X11
session management.  Considering how much better Mozilla than most applications
in so many OTHER areas, it's actually somewhat surprising to me that it doesn't
support session management.  Various obscure applications like nedit and
trebuchet support session management too.  

I hope Mozilla developers will improve Mozilla's compatibility with X11 by
supporting session management.
Comment 14 Manuel B. Nickschas 2004-11-28 14:41:05 PST
I would be really glad to have this feature, too. Currently this is the only
reason keeping me from switching from Konqueror to FireFox. It is just very very
convenient to log into KDE and having all browser windows and tabs in the state
I left them. I usually have a lot of tabs open, distributed on various windows,
containing the pages I visit on a regular basis. Session management enables me
to simply log out and log in later and still have everything open.

FireFox currently cannot do this, so I don't use it, even though it is so much
better than Konqueror in most other respects.

Please consider implementing this feature.
Comment 15 Mike Connor [:mconnor] 2004-11-28 18:34:40 PST
*** Bug 272104 has been marked as a duplicate of this bug. ***
Comment 16 Nelson Benítez 2005-01-27 11:03:57 PST
I searched all firefox extensions looking for this functionality until I reach
this bug,I missed this feature because I get used to it with Galeon, where the
sites I had no time to read before power the computer off got opened the next
time I power the computer on.    So I vote for this ;-).

 It seems that Galeon, which is mozilla-based, implemented this feature in some way.
Comment 17 Nelson Benítez 2005-06-05 06:16:47 PDT
I am no longer interested in this bug since I ve found a firefox extension that
does pretty well what I wanted, that is opening the browser with the same tabs
that where opened when the browser was closed,, the extension is called
SessionSaver and you can install it from:

https://addons.mozilla.org/extensions/moreinfo.php?id=436

Thought this could be useful to the people CCed.
Comment 18 Mark McLoughlin 2005-07-22 08:22:45 PDT
GNOME has proxy program which provides some semblance of session management
support for apps which don't support XSMP, but do set various ICCCM properties
like WM_NAME, WM_CLASS, WM_CLIENT_LEADER, WM_COMMAND and WM_CLIENT_MACHINE.

However, since this session management convention was deprecated over a decade
ago, we're dropping smproxy. See this thread for more details:

http://mail.gnome.org/archives/desktop-devel-list/2005-July/thread.html#00527

Interestingly, though, if you save a GNOME session with Firefox running, the
command saved is "firefox-bin" (because this is what's in the WM_COMMAND
property) and so, when restoring the session firefox isn't restored because
running firefox-bin obviously fails.

So, GNOME dropping smproxy doesn't have any net effect on Mozilla's session
management support, really. The only thing that can help is implementing even
very simple XSMP support.
Comment 19 Mark McLoughlin 2005-07-22 08:26:11 PDT
(In reply to comment #18)
 
> Interestingly, though, if you save a GNOME session with Firefox running, the
> command saved is "firefox-bin" (because this is what's in the WM_COMMAND
> property) and so, when restoring the session firefox isn't restored because
> running firefox-bin obviously fails.

I'm referring here to what happens if you try and save Firefox into the session
using gnome-smproxy.
Comment 20 Peter Haight 2005-11-26 23:50:55 PST
Created attachment 204265 [details] [diff] [review]
A patch to make mozilla gnome-session aware.

This is a patch which adds gnome-session support to Mozilla. It really doesn't do anything beyond fixing up the command-line and calling the gnome session initialization stuff. What this gets you, though, is that mozilla will pop up on the workspace that it was on when you saved the session.

For everything else, there is SessionSaver.
Comment 21 Peter Haight 2005-11-27 00:12:02 PST
I thought that I should add a little more detail about my patch. By using the gnome session API we do get XSMP support. So I assume this will work on KDE or with any other X sessions stuff if mozilla is compiled on a system with libgnomeui. Whether UNIX distributions commonly do that or not, I don't know.

The other thing is that I didn't implement any of the callbacks (like save_yourself). The main reason is that I use the SaveSession extension and that handles all of that stuff already. Though, it may make sense to implement the destroy callback because I've noticed that sometimes if I logout of X, mozilla dies in such a way that it doesn't save any preferences I've changed. That might be a bug or some other problem. I've not looked into it.

Also, the patch is agaisnt the 1.8 branch.
Comment 22 Nickolay_Ponomarev 2006-02-20 17:18:51 PST
Peter: you should ask review on the patch (an updated version, preferably), that makes chances of getting it in the tree a bit higher ;)

Also, according to this page <http://wiki.mozilla.org/Session_Restore> session restoring is likely to be implemented for Fx2.
Comment 23 Martin Meyer 2006-12-12 07:26:50 PST
Any progress on this since Session Saver is now in FF2? Seems like this should be a lot easier to implement now.
Comment 24 Michael Wu [:mwu] 2007-06-08 10:59:58 PDT
Moving to Firefox->OS Integration. (not actually firefox specific, but there's no toolkit->OS Integration so this will have to do..)
Comment 25 Michael Wu [:mwu] 2007-06-11 20:01:28 PDT
Created attachment 268042 [details] [diff] [review]
Add support for xsmp (WIP), v1

This patch hooks toolkit up to libgnomeui and handles the save_yourself and die signals. Unfortunately, the die signal doesn't seem to get called on my system.. need to figure out why..
Comment 26 Nelson Benítez 2007-06-12 03:19:04 PDT
Don't know if this is important, but libgnome and libgnomeui are in the process of being deprecated[1], all the functionality they provide is being implemented in gtk+, you can see what is already implemented in GTK+ in [1]. As for session management, it's not yet in GTK+ but there's already work done, see "SM Client" section on http://live.gnome.org/SessionManagement

[1] http://live.gnome.org/LibgnomeMustDie
Comment 27 Michael Wu [:mwu] 2007-06-14 12:03:37 PDT
Created attachment 268396 [details] [diff] [review]
Add support for xsmp, v2
Comment 28 Benjamin Smedberg AWAY UNTIL 2-AUG-2016 [:bsmedberg] 2007-06-19 12:33:14 PDT
Comment on attachment 268396 [details] [diff] [review]
Add support for xsmp, v2

Before I review this I'm going to want docs about how app shutdown is supposed to work (you don't have to implement it all, just document where you're headed).

Please re-request review when that's available.
Comment 29 Michael Wu [:mwu] 2007-06-19 14:26:58 PDT
Comment on attachment 268396 [details] [diff] [review]
Add support for xsmp, v2

http://wiki.mozilla.org/App_quit_sequence
Comment 30 Michael Wu [:mwu] 2007-07-16 19:32:54 PDT
Created attachment 272580 [details] [diff] [review]
As checked in
Comment 31 Michael Wu [:mwu] 2007-07-16 19:34:45 PDT
Checking in toolkit/xre/Makefile.in;
/cvsroot/mozilla/toolkit/xre/Makefile.in,v  <--  Makefile.in
new revision: 1.82; previous revision: 1.81
done
RCS file: /cvsroot/mozilla/toolkit/xre/nsNativeAppSupportUnix.cpp,v
done
Checking in toolkit/xre/nsNativeAppSupportUnix.cpp;
/cvsroot/mozilla/toolkit/xre/nsNativeAppSupportUnix.cpp,v  <--  nsNativeAppSupportUnix.cpp
initial revision: 1.1
done
Comment 32 Christian Persch (GNOME) (away; not receiving bug mail) 2007-07-17 01:42:28 PDT
This code is unconditionally calling gnome_program_init, even when there already exists a GnomeProgram instance:

+  char *argv[2] = { "gecko", "--disable-crash-dialog" };
+  gnome_program_init("Gecko", "1.0", libgnomeui_module_info_get(), 2, argv, NULL);

The one other caller of gnome_program_init in gecko [http://lxr.mozilla.org/mozilla/source/uriloader/exthandler/unix/nsGNOMERegistry.cpp#177] checks first for an existing GnomeProgram; I think this code should do so, too. (See bug 221012.)
Comment 33 [:Aleksej] 2007-07-17 05:55:57 PDT
I'm getting a few messages like this on Debian with Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a7pre) Gecko/2007071704 Minefield/3.0a7pre, running as a different user than Xorg is running as, and using “xhost +local:”:

(Gecko:10687): GnomeUI-WARNING **: While connecting to session manager:
Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed.

It doesn't appear when running as the Xorg's user.
Comment 34 Michael Wu [:mwu] 2007-07-17 09:24:10 PDT
(In reply to comment #32)
> The one other caller of gnome_program_init in gecko
> [http://lxr.mozilla.org/mozilla/source/uriloader/exthandler/unix/nsGNOMERegistry.cpp#177]
> checks first for an existing GnomeProgram; I think this code should do so, too.
> (See bug 221012.)
> 
Do embedders use nsAppRunner?
Comment 35 Christian Persch (GNOME) (away; not receiving bug mail) 2007-07-17 09:32:21 PDT
(In reply to comment #34)
> Do embedders use nsAppRunner?

I don't know (Epiphany doesn't); but this is called from XRE_main and it's certainly possible that someone could init GnomeProgram before calling XRE_main.
Comment 36 Adam Guthrie 2007-07-17 10:26:36 PDT
Christian and Aleksej, I think it's going to be best to file follow-up bugs for those issues, rather than trying to track them here.
Comment 37 Michael Wu [:mwu] 2007-07-17 11:04:27 PDT
*** Bug 354686 has been marked as a duplicate of this bug. ***
Comment 38 [:Aleksej] 2007-07-17 15:46:08 PDT
(In reply to comment #33)
Filed bug 388515.
Comment 39 Sylvain Pasche 2008-08-07 06:05:50 PDT
any idea why the quit confirmation dialog is not shown on shutdown (bug 449548)?

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