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 131811 - Implement proper session management
Implement proper session management
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: General Totem maintainer(s)
General Totem maintainer(s)
: 127074 134716 137483 139763 142877 144177 144930 154555 161437 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-01-18 00:56 UTC by Evert Verhellen
Modified: 2005-01-01 21:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Even I agree, Patch attached (1.47 KB, patch)
2004-01-30 07:13 UTC, Harsh Jaitly
needs-work Details | Review

Description Evert Verhellen 2004-01-18 00:56:40 UTC
When starting Totem without arguments, the most recently opened file is
loaded. This doesn't make any sense. An application shouldn't go opening
things the user didn't request.

Version: 0.99.8
Comment 1 John Leach 2004-01-21 17:08:04 UTC
I agree.  I came here to report this myself.
The implications of this feature are worsened if the last opened file
was streamed over a network because there is a big delay whilst it is
initially read (especially if it was streamed over a low bandwidth
internet connection).

At least provide an option to toggle this behaviour, but I'd recommend
defaulting it to off and hiding it in a gconf key.
Comment 2 Harsh Jaitly 2004-01-30 07:13:35 UTC
Created attachment 23887 [details] [review]
Even I agree,  Patch attached
Comment 3 Jon Trowbridge 2004-01-30 22:28:31 UTC
I agree too.
Comment 4 Bastien Nocera 2004-01-31 16:41:52 UTC
I will not apply this patch. What I would apply is a patch that
implements proper session management. I'm changing the summary to that
effect.
Comment 5 Bastien Nocera 2004-02-18 12:08:23 UTC
*** Bug 127074 has been marked as a duplicate of this bug. ***
Comment 6 Bastien Nocera 2004-02-18 12:08:44 UTC
*** Bug 134716 has been marked as a duplicate of this bug. ***
Comment 7 Bastien Nocera 2004-03-17 11:18:27 UTC
*** Bug 137483 has been marked as a duplicate of this bug. ***
Comment 8 Bastien Nocera 2004-04-12 11:55:57 UTC
*** Bug 139763 has been marked as a duplicate of this bug. ***
Comment 9 Götz Waschk 2004-04-14 07:24:08 UTC
The bad thing about this is a confusing error when the last file was removed and
cannot be opened. The message indicates a missing plugin which is wrong. It
should at least say that the file was removed.
Comment 10 Robert Holmberg 2004-05-05 07:58:09 UTC
I agree with #9 except I don't think you have to tell the user the file was
removed at all. Just don't open anything. Especially instead of complaining
there is no DVD in the disc drive.
Comment 11 Bastien Nocera 2004-05-26 15:03:06 UTC
*** Bug 142877 has been marked as a duplicate of this bug. ***
Comment 12 Bastien Nocera 2004-06-11 16:59:57 UTC
*** Bug 144177 has been marked as a duplicate of this bug. ***
Comment 13 Ricardo Veguilla 2004-08-26 08:15:39 UTC
Is there any work being done to fix this? 
Comment 14 Bastien Nocera 2004-09-15 12:16:47 UTC
*** Bug 144930 has been marked as a duplicate of this bug. ***
Comment 15 Bastien Nocera 2004-09-20 16:23:52 UTC
Mass reassign.
Comment 16 Bastien Nocera 2004-10-05 17:55:24 UTC
*** Bug 154555 has been marked as a duplicate of this bug. ***
Comment 17 gnome 2004-11-20 16:32:57 UTC
My case: I often use totem to read videos downloaded from the web. Those are
saved in /tmp. After I reboot, /tmp was cleared indeed, but totem will hang
several seconds and complain about a missing file.

Why opening the previous file anyway? Why is the playlist persistent? Totem is
not competiting with XMMS or Rhythmbox. When I have a single file to play, I
won't use the latter. Totem is inefficient for working with a library; for
working with playlists, we have the load/save features.

Remember what you said in http://bugzilla.gnome.org/show_bug.cgi?id=129591#c1

I don't understand what you expect from the current behaviour.
Comment 18 Ivan Gyurdiev 2004-11-20 17:47:42 UTC
I strongly agree with #0 and #17.  How dare the media player open 
things I didn't request from it! 

It's amazing that this bug is STILL not fixed after 11 months.
Comment 19 Bastien Nocera 2004-11-21 01:12:01 UTC
The bug isn't about opening the playlist of what was previously playing. This
feature is only going to be removed when proper session management is
implemented. Nobody came forward to implement it, and it's very low on my TODO
list. Feel free to send a patch if you want it done before I get to it.
Comment 20 gnome 2004-11-21 10:51:40 UTC
Can't you just deactived the automatic opening for now?
Comment 21 Roman Gaufman 2004-11-21 13:45:42 UTC
Everybody, just use kaffeine -- you'll be happier :) 
Comment 22 John McCutchan 2004-12-12 03:52:41 UTC
Bastien, what constitutes proper session management? Lay out for me..
Comment 23 Bastien Nocera 2004-12-12 04:07:08 UTC
A good example of session management is in gedit:
http://cvs.gnome.org/viewcvs/gedit/gedit/gedit-session.c?view=markup
The API is decently well explained at:
http://developer.gnome.org/doc/API/2.0/libgnomeui/GnomeClient.html

We need to save as much of the state of the session as possible, that's:
- the playlist
- the position in the playlist
- the position in the file (if it's possible to do so, ie. not a live stream)
- the current paths for the file selectors

And you shouldn't need to save the windows positions or sizes, as they should be
automatically set by the window manager.

You can test your work by:
- run "gnome-session-save"
- Close Totem
- Check the restart command in ~/.gnome2/session
- Relaunch Totem with that command and see how much of it is restored
Comment 24 Bastien Nocera 2004-12-13 17:12:54 UTC
And another session link:
http://developer.gnome.org/dotplan/porting/ar01s23.html
Comment 25 Bastien Nocera 2004-12-16 10:02:28 UTC
*** Bug 161437 has been marked as a duplicate of this bug. ***
Comment 26 Toni Willberg 2004-12-16 11:56:09 UTC
I suggest changing topic of this bug report to reduce number of dupes. I didn't
find this report while searching it, and ended up submitting a duplicate. :)
Comment 27 Daniel Brodie 2004-12-23 00:38:02 UTC
I would like to suggest to atleast not try to open the last opened file if:
1) it was a stream
2) dosn't exist

If so it should just *silently* open up 'empty'. I think that even with session
management this will make sense.
Comment 28 Bastien Nocera 2004-12-28 23:13:28 UTC
Just a note, we don't show an error any more when opening the first file of a
playlist when a playlist just finished, or when restoring a playlist.
Comment 29 Bastien Nocera 2005-01-01 21:28:13 UTC
2005-01-01  Bastien Nocera  <hadess@hadess.net>

        * data/totem.glade:
        * src/Makefile.am:
        * src/bacon-video-widget-xine.c: (setup_config_stream),
        (bacon_video_widget_new), (bacon_video_widget_seek_time),
        (bacon_video_widget_get_volume),
        (bacon_video_widget_get_current_time):
        * src/totem-options.c: (totem_options_process_late):
        * src/totem-options.h:
        * src/totem-pl-parser.c: (totem_pl_parser_add_pls):
        * src/totem-playlist.c: (totem_playlist_key_press),
        (totem_playlist_set_at_end), (totem_playlist_get_current),
        (totem_playlist_get_last), (totem_playlist_set_current):
        * src/totem-playlist.h:
        * src/totem-private.h:
        * src/totem-session.c: (totem_session_create_key),
        (totem_save_yourself_cb), (totem_session_restore),
        (totem_session_setup), (totem_action_restore_pl):
        * src/totem-session.h:
        * src/totem.c: (totem_action_save_size), (totem_action_exit),
        (totem_action_menu_popup), (play_pause_set_label),
        (totem_action_play), (totem_action_seek),
        (totem_action_fullscreen_toggle), (totem_action_seek_relative),
        (on_recent_file_activate), (on_channels_change_event),
        (totem_action_open_files), (show_controls),
        (totem_action_toggle_controls), (on_about1_activate),
        (commit_hide_skip_to), (totem_action_remote),
        (popup_timeout_remove), (popup_hide), (on_mouse_click_fullscreen),
        (on_video_motion_notify_event), (on_video_button_press_event),
        (totem_action_handle_key), (totem_setup_window),
        (totem_callback_connect), (main):
        * src/totem.h:
        * src/totem-sublang.[ch]:

        Remove possible "burps" on startup when the sound is supposed to
        be mute (xine-lib)
        Fix parsing of .pls files with relative paths (they're relative to
        the .pls file, not to the working directory) (Closes: #162440)
        Fix problems with activating a multi-item playlist from the
        recent files, we should play the first item added, not the last one
        Move languages and subtitles menu code to totem-sublang.[ch]
        Add session saving support (Closes: #131811)
        Fix seeking into streams that haven't been played yet, only opened
        Some code cleanups