jonls / redshift

Redshift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night.
http://jonls.dk/redshift
GNU General Public License v3.0
5.82k stars 424 forks source link

Redshift crashes when toggling inhibit while receiving the initial location #852

Open manuelVo opened 2 years ago

manuelVo commented 2 years ago

Describe the bug When sending the USR1 signal to redshift to toggle it's inhibit state (for example via the redshift-gtk context menu) while redshift is currently waiting for the initial location from geoclue, redshift crashes.

To Reproduce

  1. Ensure that getting the initial location via geoclue is slow (either by completely disconnecting all networks or using a slow method like wifi)
  2. Start Redshift
  3. Send the USR1 signal to redshift before the initial location has been determined
  4. Redshift will crash with the error above

Expected behavior When receiving the USR1 signal, redshift should always toggle it's inhibit state and never crash.

Error output/logs/screenshots

Failed to run Redshift
Trying location provider 'geoclue2'...
Waiting for initial location to become available...
poll: Interrupted system call
Unable to get location from provider.

Software versions (please complete the following information):