Logout window ( xfce4-session-logout ) focusses "Cancel"-button by default.
OR
Add reaction time delay for window usage.
Current behaviour
When logout window appears "Logout" button is focussed by default. All buttons can be pressed / used immediately.
Reason for Suggestion
Logout window might be triggered automatically. This happens on battery using devices when battery is too low.
If this happens while writing text where the space bar is in heavy usage, the system will log the user out against the actual will of the user.
In rare cases the user might want to click somewhere right in the moment, when the xfce4-session-logout screen pops up, he/she might accidentally click one of the buttons inside the logout window.
This is a patch for preventing the accidental log out while writing on the keyboard.
It will not prevent the case of accidentally click one of the buttons with the mouse.
Your patch works great for me, IMO no problem to get it applied to master.
Just some cosmetics: /* Use this comment style */ + there are some whitespaces on the first comment line.
I changed the comment style.
git format-patch creates a patch file about something I didn't change (chinese translation) and ignores my actual changes. Therefore I used git diff.
Thanks for the patch, but I don't think the changeis for the better: keyboard-wise, it is already fairly simple to dismiss the logout dialog, one just needs to press ESC. It is also somewhat easy to logout/reboot/shutdown, one just needs to press 0/1/2 times to left and press enter/space. With the first proposed change we end up with two easy ways to cancel and none to previously mentioned operations.
The focus on cancel button only makes sense with your second suggestion, yet it's very intrusive IMHO. The current notification issued by xfpm is more passive and less error-prone.
it is already fairly simple to dismiss the logout dialog, one just needs to press ESC
The point of this change is not make dismissing easier. It's to prevent accidental "ok"s.
one just needs to press ESC.
Like I stated before: If you're writing something you make heavy use of "space" and "enter". You make almost no use of "esc". Therefore the probability to accidentally hit "logout" is imo fairly high for a portable office machine.
With the first proposed change we end up with two easy ways to cancel and none to previously mentioned operations.
I would follow the "the default option should be the save option"-principle.
The current notification issued by xfpm is more passive and less error-prone.
I don't understand this one. What do you "current notification" do you mean?
it is already fairly simple to dismiss the logout dialog, one just needs to press ESC
The point of this change is not make dismissing easier. It's to prevent
accidental "ok"s.
AFAICT currently it's not so easy to mistakenly open the logout dialog, is it?
one just needs to press ESC.
Like I stated before: If you're writing something you make heavy use of
"space" and "enter". You make almost no use of "esc". Therefore the
probability to accidentally hit "logout" is imo fairly high for a portable
office machine.
With the first proposed change we end up with two easy ways to cancel and none to previously mentioned operations.
I would follow the "the default option should be the save option"-principle.
Again, I don't see how the logout dialog would pop up when the user is writing, playing, browsing, etc. I mean that dialog only appears when the user means it. And when using the keyboard (alt+f4 when no window is focused), with the proposed patch, the user will need to move away from the "safe" option.
The current notification issued by xfpm is more passive and less error-prone.
I don't understand this one. What do you "current notification" do you mean?
Depending on the configuration, Xfce4-power-manager may send a notification asking the user what to do when the battery level is critical.
Sorry for the long delay ... we did some testing of the xfce4-power-manager to reproduce the problem in detail and had some longer internal discussion what would be the best fix for it.
Were I would have taken your fix in the beginning, other devs did not like the idea to change the keboard control behaviour of the logout dialog.
In the end we agreed that it might be no good idea at all to popup an xfce4-session-logout dialog out of nowhere. ( E.g. If you are about to click something, this may as well end up in a undesired shutdown )
So finally we decided to remove the feature "ask on critical power" feature from xfce4-power-manager.
There is already a Notification ( to be checked if it is a "critical" notification, so that it only disappears when acknowledged ) ... this should be sufficient to warn people on critical power level.
I prepared a preleminary fix for xfce4-power-manager here: https://github.com/alexxcons/xfce4-power-manager/commits/master
(I still need to verify if the said notification is critical, add the bug id to the commit message and test if it works fine if the old enum value is still active )
I am sorry for the trouble you had with building the patch .... now that you know xfce4-session and gtk a bit, possibly you are interested in taking a look into other bugs ;)
I didn't have time to check your fix, yet. So my following concerns might not be necessary.
So finally we decided to remove the feature "ask on critical power" feature from xfce4-power-manager.
If the feature is just removed, there is no other option for notifications ( at least not on my system).
There is indeed a warning at 20% (?), but that's not choosable in any menu.
I would at least add on option for a popup-notification, that might be spawned.
I am sorry for the trouble you had with building the patch .... now that you know xfce4-session and gtk a bit
It sounds like you are planning to remove "Do nothing" completely from the list. Is that so?
I would preserve that option. Maybe there are people who really want to have no notification at all(?)
replacement "Ask" --> "Notify" does not work, since currently "Do Nothing" means "Notify" :)
I dont want to switch "Do nothing" to really do nothing, since this probably would change the expected behavior on low power for many users. So I decided to just rename the shown
meh ... enter on accident. Hope we migrate to gitlab soon.
... So I decided to just rename the shown combo box string from "Do Nothing" to "Notify".
I am not yet fully happy with my patch. I still use the enum value XFPM_DO_NOTHING (currently the same enum is used for many combo boxes in xfpm-setting)
Gues I should add a new enum instead.