workrave
workrave copied to clipboard
Feature request: Need option to disable "right click" on Status Window
Please add an option to disable "right click" on the floating Status Window. If Postpone and Skip buttons are disabled to enforce a break, then "right clicking" on the Status Window should also be disabled, because a user can access Preferences to stop or reset a break.
@easpro You can enable postpone and skip buttons for specific breaks, when to disable right click? Where should this option be placed?
Many kids don't want to take computer breaks. Kids can simply right click on the status icon and quit Workrave or kids can right click on the Status Window and go to Preferences and turn off Workrave. Please add an option to disable right click, so kids will take their scheduled computer breaks.
On the Applet tab, please add: "Disable right click on status icon".
On the Status Window tab, please add: "Disable right click on status window".
@easpro I think I understand what you want to accomplish, but a user could right click on the tray icon and click on quit or just close the Workrave process from the Task manager?
Yes, you are correct...
Please add: "Disable right click on status icon (tray icon).
There are many parental control software available that can prevent kids from opening windows task manager, control panel, add/delete programs, registry editor, command prompt and so on.
@easpro Ah. I understand. So we are making 2 options available in Preferences "User interface"?
- "Disable right click on status icon (tray icon).
- "Disable right click on status window (Applet)" .
Or just create 1 option to disable both?
So we don't look to the setting of Postpone and Skip for the different breaks? Are there hotkeys to stop or reset a break?
You are correct. Create 1 option to disable both. Or 2 options to disable each separately.
I am not aware of any hotkeys to stop or reset a break.
Yes, Postpone and Skip should be unchecked to enforce a break.
@easpro Do you think we need the 2 options or just 1? You can set Postpone and skip for the 3 different breaks. Do we need to check what type of break it is?
2 options allows more user control. I believe it should apply to all breaks.
I assume you only want to disable the menus (status window/tray icon) during a break when 'Block mode' is 'Block input'? Sounds reasonable. I though this was already the case... But it seems only for the tray icon (on Windows at least).
I don't see why this should be configurable. When 'Block input' is selected, you should not be able to use the menus. I never designed Workrave to properly handle menu commands during breaks. I thought only the task manager was accessible during breaks to be able to kill workrave in case of an emergency.
The option to disable right click menus for the tray icon and status window would be useful for parents who do not want their kids to quit Workrave.
@rcaelers @easpro so we don't need that option. There already is the option "block input", but we need to disable right click menus right?
Yes, please include the option to disable right click menus.
@rcaelers I would like to create a PR with a fix to block rightclick in panel when block mode input is enabled, do you have some advice for me? Is there a guide to setup development enviroment and how to build after I have made some changes?
I just created two pages with some documentation on how to build Workrave. They are not yet linked from the main documentation (because I still consider the page to be draft).
https://workrave.org/docs/build/linux/ https://workrave.org/docs/build/windows/
It seems I missed your previous question: Indeed, I think we don't need an extra setting, only disable the menu when a break is active.
@rcaelers Thanks, going to look into it!
PS: pacmac
needs to be pacman
I think. https://workrave.org/docs/build/windows/
@1Jesper1 : thanks :-) I fixed the typo.
@rcaelers Do you know how to get the current breakstate in WindowsStatusIcon.cc and MainWindow.cc?I I thought BreakControl::get_break_state(), but it's not static.
I thought about this if check:
if(!(BreakControl::get_break_state() == BreakControl::BREAK_ACTIVE && (GUIConfig::block_mode()() == BlockMode::All || GUIConfig::block_mode()() != BlockMode::Input))){
@1Jesper1 : get_break_state is not exposed to the UI. Only files from libs/core/include/core are available in the UI. You could do something like
auto core = app->get_core();
// same for microbreak and restbreak.
auto restbreak = core->get_break(BREAK_ID_REST_BREAK);
auto taking = rest_break->is_taking();
Is_taking return true if the user is taking that taken. You could retrieve that for all 2 breaks, or add an "is_taking" function to ICore that returns true if the user is taking a break.