! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Power manager ignores user response and always suspends after failing to lock...
Status:
RESOLVED: FIXED
Priority:
Very Low
Severity:
trivial
Product:
Xfce4-power-manager
Component:
General

Comments

Description m8r-gwfij5 2017-03-04 04:56:25 CET
 
Comment 1 m8r-gwfij5 2017-03-04 05:06:47 CET
When the system will suspend, e.g. after inactivity or pressing the suspend button, if the power manager fails to lock the screen, a dialog is presented asking if the user still wants to suspend. The response is ignored and the system suspends regardless. I expect that answering "No" will not suspend the system.

The following fixed it for me.

diff --git a/src/xfpm-power.c b/src/xfpm-power.c
index 172cff8..258c795 100644
--- a/src/xfpm-power.c
+++ b/src/xfpm-power.c
@@ -442,7 +442,7 @@ xfpm_power_sleep (XfpmPower *power, const gchar *sleep_time, gboolean force)
            ret = gtk_dialog_run (GTK_DIALOG (dialog));
            gtk_widget_destroy (dialog);

-           if ( !ret )
+           if ( !ret || ret == GTK_RESPONSE_NO)
                return;
         }
     }
Comment 2 m8r-gwfij5 2017-03-04 05:10:39 CET
Created attachment 7038 
Fix by acknowledging the user response
Comment 3 Ali Abdallah editbugs 2017-11-15 21:17:24 CET
Thanks for your report and the fix, the patch will be included in the next version of xfpm.
Comment 4 Git Bot editbugs 2017-11-26 23:56:53 CET
Simon Steinbeiss referenced this bugreport in commit f911ceb07c5f78fe72887f5438999edb2d7f6d09

Fix handling of dialog responses for suspend and hibernate (Bug #13405)

https://git.xfce.org/xfce/xfce4-power-manager/commit?id=f911ceb07c5f78fe72887f5438999edb2d7f6d09
Comment 5 Simon Steinbeiss editbugs 2017-11-26 23:57:37 CET
I took the liberty of fixing the same thing for the hibernate dialog too.

Thanks for catching the bug and providing a patch!

Bug #13405

Reported by:
m8r-gwfij5
Reported on: 2017-03-04
Last modified on: 2017-11-26

People

Assignee:
Simon Steinbeiss
CC List:
4 users

Version

Attachments

Additional information