workrave icon indicating copy to clipboard operation
workrave copied to clipboard

Feature request: Need option to disable "right click" on Status Window

Open easpro opened this issue 4 years ago • 18 comments

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 avatar Oct 19 '20 01:10 easpro

@easpro You can enable postpone and skip buttons for specific breaks, when to disable right click? Where should this option be placed?

1Jesper1 avatar Jun 29 '21 10:06 1Jesper1

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 avatar Jul 01 '21 11:07 easpro

@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?

1Jesper1 avatar Jul 01 '21 12:07 1Jesper1

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 avatar Jul 01 '21 13:07 easpro

@easpro Ah. I understand. So we are making 2 options available in Preferences "User interface"?

  1. "Disable right click on status icon (tray icon).
  2. "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?

1Jesper1 avatar Jul 01 '21 14:07 1Jesper1

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 avatar Jul 01 '21 15:07 easpro

@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?

1Jesper1 avatar Jul 01 '21 15:07 1Jesper1

2 options allows more user control. I believe it should apply to all breaks.

easpro avatar Jul 01 '21 15:07 easpro

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.

rcaelers avatar Jul 01 '21 16:07 rcaelers

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.

easpro avatar Jul 01 '21 21:07 easpro

@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?

1Jesper1 avatar Jul 01 '21 21:07 1Jesper1

Yes, please include the option to disable right click menus.

easpro avatar Jul 01 '21 21:07 easpro

@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?

1Jesper1 avatar Feb 08 '22 22:02 1Jesper1

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 avatar Feb 14 '22 20:02 rcaelers

@rcaelers Thanks, going to look into it! PS: pacmac needs to be pacman I think. https://workrave.org/docs/build/windows/

1Jesper1 avatar Feb 15 '22 12:02 1Jesper1

@1Jesper1 : thanks :-) I fixed the typo.

rcaelers avatar Feb 16 '22 19:02 rcaelers

@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 avatar Feb 20 '22 19:02 1Jesper1

@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.

rcaelers avatar Mar 02 '22 18:03 rcaelers