Opened 12 years ago

Last modified 10 years ago

#1248 new Enhancement

gnome session termination isn't handled properly

Reported by: razzmatazz Owned by: charles
Priority: Normal Milestone: Sometime
Component: GTK+ Client Version: 1.33
Severity: Normal Keywords: patch-needed
Cc: googelly.eyes@…

Description

everytime i close gnome session via system->quit menu, transmission is apparently killed instead of given a chance to close data files properly.

thus as of now i have to explicitly close transmission so on next reboot it doesnt hammer my hard drive on startup due to the need to verify all the files it has :(

Attachments (1)

session_handlers.patch (6.8 KB) - added by kklimonda 11 years ago.
cleaned up code, moved session initialization to tr_core_class_init

Download all attachments as: .zip

Change History (16)

comment:1 Changed 12 years ago by charles

  • Type changed from Bug to Enhancement

comment:2 Changed 12 years ago by charles

Ticket #1119 has been marked as a duplicate of this ticket.

comment:3 Changed 12 years ago by LucaFerretti

Please note that session managment is changed in GNOME 2.24.

Features

I don't know current status of Transmission regarding the lifecicle in a GNOME session, but reading the above linked page I suppose that:

  • Transmission have to connect and registrer to session
  • Transmission should manage QueryEndSession and prevent logout if downloading/seeding (here is a dialog for this, switch to GNOME 2.24, launch gedit, don't close it and try to logout)
  • Transmission could add the ability to be automatically launched on login

Code References

  • this change for nautilus-cd-burner show the code to inhibit the SessionManager
  • this change in nautilus for session and autostart handling

comment:4 Changed 12 years ago by charles

  • Milestone changed from None Set to 1.60
  • Priority changed from Low to Normal

comment:5 Changed 12 years ago by yonas

I'm not sure of this is the exact bug, but when I reboot Gnome without stopping Transmission first, the download will start at 0%, and if I "Verify local data", it will start at 75% of what's downloaded, on average, but never exactly where it left off.....

I've lost many Gigabytes because of this!

comment:6 Changed 12 years ago by yonas

  • Cc googelly.eyes@… added

comment:7 Changed 12 years ago by charles

  • Milestone changed from 1.60 to 1.70

Bumping this to 1.70 unless someone rides in on a white horse and submits a patch :)

comment:8 Changed 11 years ago by Kamil Páral

This is a very annoying bug. I kindly request higher priority, thank you.

I have found these lines in Deluge bittorrent client regarding this matter, maybe it helps:

self.client = gnome.ui.Client()
self.client.connect("save_yourself", self.manager.quit)

comment:10 Changed 11 years ago by charles

  • Summary changed from gnome session termination is not handled properly (x-session support request) to gnome session termination isn't handled properly

comment:11 Changed 11 years ago by charles

  • Milestone changed from 1.70 to Sometime

comment:12 Changed 11 years ago by charles

  • Keywords patch-needed added

comment:13 Changed 11 years ago by charles

I dug into this a bit tonight to see if I could implement it, and it appears to be a Big Rats Nest.

The method used by Deluge is deprecated and is disappearing in Gnome 3.0. Its methods are listed in http://live.gnome.org/LibgnomeMustDie ...

Why we can't use the SessionOver? dbus signal, which I tried to implement: http://bugzilla.gnome.org/show_bug.cgi?id=579064

Why this probably won't get cleaned up until 3.0: http://bugzilla.gnome.org/show_bug.cgi?id=79285#c20 http://bugzilla.gnome.org/show_bug.cgi?id=79285#c21

What we might add in as a workaround: http://live.gnome.org/SessionManagement/EggSMClient

Last edited 11 years ago by charles (previous) (diff)

comment:14 Changed 11 years ago by kklimonda

@charles: As you have said - It's a rats nest. I've attached a patch that implements stubs for QueryEndSession?, EndSession? and CancelEndSession? signals from SessionManager? d-bus api. They seem to work but I've probably made a stupid mistake or two as always so input is welcome :). Also Chris Coulson's comment about it: (...)the way it should work with transmission is: transmission receives QueryEndSession?, and responds to say it's ok to proceed once all other clients have done the same, transmission receives EndSession? then transmission can save whatever information it needs to for the torrents, and then respond and then exit

Changed 11 years ago by kklimonda

cleaned up code, moved session initialization to tr_core_class_init

comment:15 Changed 10 years ago by jordan

kklimonda, I'm sorry this has sat unused for so long. Does your patch still do the Right Thing wrt wiring itself into the right GNOME session hooks?

Note: See TracTickets for help on using tickets.