Commit Graph
271 Commits
Author SHA1 Message Date
Jon Lund Steffensen 6531b8c73d Move module struct definitions to separate files 2017-10-13 17:53:58 -07:00
Samuel Walladge a172e1815d add help message to redshift-gtk 2017-10-13 16:10:32 -07:00
Jon Lund Steffensen e2d1b5d9cd quartz: Fix incorrect use of display identifier
The quartz (macOS) adjustment method incorrectly used the display
index instead of the associated CGDirectDisplayID. Incidentally this
happened to work too but was incorrect.
2017-10-12 18:27:43 -07:00
Jon Lund Steffensen 86bb509eca Fix bug where error code was not handled 2017-10-12 14:01:28 -07:00
Jon Lund Steffensen 64600ae55d Fix missing checks and verbose output
Rearrange checks and verbose output in main() to bring back checks
that were accidentally left out when time-based adjustments were
enabled. This includes the output indicating the daytime/night
temperatures and the check that the temperatures are valid.
2017-10-12 12:36:39 -07:00
Jon Lund Steffensen 1e425c66f5 Time-based configuration
Allow setting the time of the dawn and dusk transition periods
directly in the configuration file. If these are specified, the
location provider is not needed and is therefore not initialized.

Based on patch by Martin Nicolay <edelschimmel1@gmx.de>.
2017-10-11 14:45:59 -07:00
dev7355608 d9d7218cc8 Fix #523: Retry SetDeviceGammaRamp before giving up
We have to retry SetDeviceGammaRamp a few times before giving up
because some buggy drivers fail on the first invocation just to
succeed on the second.
2017-09-27 16:20:47 +02:00
Jon Lund Steffensen d0135df859 w32gdi: Enable preserve by default 2017-08-31 01:54:09 -07:00
Jon Lund Steffensen 989fe52176 vidmode: Enable preserve by default 2017-08-31 01:53:59 -07:00
Jon Lund Steffensen dcafe503d3 randr: Enable preserve by default 2017-08-31 01:53:49 -07:00
Jon Lund Steffensen ce430bb52e quartz: Enable preserve by default 2017-08-31 01:53:39 -07:00
Jon Lund Steffensen d8f04b9020 redshift: Improve fade implementation
Simplify implementation of fades in continual mode. A fade is now
applied anytime the change in color temperature, brightness or
gamma is greater than a preset threshold. This means that a fade
is applied if the location provider suddenly updates to a new
location or if the currently time suddenly jumps e.g. after waking
up the computer from sleep. An easing function is applied to the
fade to make it more pleasant.
2017-08-30 17:12:56 -07:00
Jon Lund Steffensen a33d5e237e Merge pull request #507 from jonls/fade-term
Use the term "fade" instead of "transition" for the short (~5s) fade between color temperatures
2017-08-30 17:04:22 -07:00
Jon Lund Steffensen 8165badbc2 Change term transition to fade
Use the term "fade" instead of "transition" for the short (~5s)
fade between color temperatures. The term "transition" is now only
used for the transition phase between daytime and night.

The setting "transition" in the configuration file is now deprecated
and "fade" should be used instead.
2017-08-30 15:21:43 -07:00
Jon Lund Steffensen c4e0f3aa5a geoclue2: Show explanation of access denied error 2017-08-19 17:39:05 -07:00
Jon Lund Steffensen 52d9a73d36 geoclue2: Use existing connection object
Use existing connection object when creating proxies.
2017-08-19 17:37:49 -07:00
Jon Lund Steffensen 00e2d538e8 geoclue2: Update continuously 2017-08-17 20:24:32 -07:00
Jon Lund Steffensen df10508e30 corelocation: Update continuously 2017-08-17 20:24:32 -07:00
Jon Lund Steffensen ce037545dd pipeutils: Add utils for pipe signals
Add pipeutils.c with utility functions for working with pipes as
signals across threads. Using pipes for signals makes it easy for
the main thread to wait on (multiple) file descriptors with or
without a timeout.
2017-08-17 19:52:29 -07:00
Jon Lund Steffensen 153dec0e21 Change location providers to allow updates
Change location provider implementations so it is possible for
location providers to dynamically update the location. This
commit adds the interfaces and infrastructure in redshift.c
but none of the location provides are changed to become dynamic.
2017-08-17 19:52:29 -07:00
Jon Lund Steffensen 4adb93a448 Remove deprecated geoclue 1 location provider 2017-08-16 20:46:53 -07:00
Jon Lund Steffensen 74759e8dfb Fix #492: Correctly import xdg modules
Although not named like modules, the BaseDirectory and
DesktopEntry are really submodules of xdg that need to be imported
for them to be available.
2017-08-07 12:20:49 -07:00
Jon Lund Steffensen 329873efd1 Merge pull request #490 from jonls/windows-resources
Add icon for Windows build
2017-08-01 00:54:21 -07:00
Jon Lund Steffensen a39e92cc4b statusicon: Use GtkWindow to avoid warnings
Avoids warnings generated when a GtkDialog is used without a
parent window. Also adds fixes for #220 using a solution provided
by agnivade.
2017-07-30 20:21:52 -07:00
Jon Lund Steffensen d84e7b1b3f statusicon: Only add autostart control when supported 2017-07-30 20:21:52 -07:00
Jon Lund Steffensen 7e9886cd68 controller: Emit signal when stopped 2017-07-30 20:21:52 -07:00
Jon Lund Steffensen f3a8ef54c4 utils: Make xdg module optional 2017-07-30 20:14:40 -07:00
Jon Lund Steffensen 3ea717011e Move RedshiftController to controller.py 2017-07-30 18:31:12 -07:00
Jon Lund Steffensen 4e6f2fa7ab Add Windows resources 2017-07-30 15:39:08 -07:00
Faheel Ahmad 6d44559b48 Limit lines to 80 chars 2017-07-29 16:36:27 +05:30
Faheel Ahmad 29727a990c Fix #474: Format help text paragraph to 80 chars max 2017-07-27 08:58:22 +05:30
Jon Lund Steffensen 6f0a0ab94f Merge pull request #420 from jonls/default-temperature
redshift.c: Use 6500K and 4500K by default
2017-01-14 12:04:12 -05:00
Jon Lund Steffensen 460cd9cab3 Merge pull request #421 from jonls/randr-adjust-multiple
XRandR: Allow multiple but not all CRTCs to be redshifted
2017-01-14 12:00:14 -05:00
Lennart Sauerbeck e02759090a XRandR: Allow multiple but not all CRTCs to be redshifted
Previously only one CRTC could be set in the configuration file for
redshifting when XRandR mechanism was being used. That is fine for
a setup with two displays but breaks when three or more displays
are in use and one of those shouldn't be redshifted (e.g. two
computer displays and one TV connected to the computer).

The config value 'crtc' for method xrandr can now be entered as
comma separated list of multiple CRTCs. All CRTCs in the list will
be redshifted while all those not in the list will not be touched.
2017-01-08 17:51:18 -05:00
Jon Lund Steffensen d7b7caf990 redshift.c: Use 6500K and 4500K by default 2017-01-08 15:44:58 -05:00
Arne Janbu 7342a3b06c Fix Windows build after e0a617fcad 2016-10-19 22:39:58 +02:00
Jon Lund Steffensen 90849caf41 Merge pull request #383 from jonls/icon-tooltip
add display of color temperature and period in the tooltip status icon
2016-10-15 12:16:47 -04:00
Andreev Alexander 1fb3275605 add display of color temperature and period in the tooltip status icon 2016-10-15 12:08:49 -04:00
Jon Lund Steffensen 05737ed33c drm: Avoid using alloca() 2016-10-15 11:38:20 -04:00
Jon Lund Steffensen 7e9ef55987 redshift-gtk: Make sure that child process is closed after signals
Instead of calling sys.exit() the signal handlers now try to terminate
the child process. After the child exits, the process will be reaped by
the GLib callback which will call Gtk.main_quit() which will then quit
redshift-gtk. This ensures that the redshift process does not outlive
the redshift-gtk process.
2016-01-02 16:48:48 -05:00
Jon Lund Steffensen 71f52b7cd7 Fix #213: Merge branch 'pull-213' 2015-12-28 11:35:53 -05:00
Mattias Andrée e0a617fcad Move signal processing functions and sigaction calls to signals from redshift.c
Signed-off-by: Mattias Andrée <maandree@operamail.com>
2015-12-28 11:31:42 -05:00
Jon Lund Steffensen a53dddb535 Merge pull request #244 from jubalh/master
Remove trailing whitespaces
2015-12-28 11:02:56 -05:00
Javier Cantero ae2e23325b Fallback if AppIndicator3 req. version unavailable
Catch in the except block the case when the required version of
Appindicator3 is not available to also fallback in GtkStatusIcon widget.
2015-11-15 12:05:45 +01:00
Javier Cantero 56cef8d9cc Also specify required AppIndicator3 version
Avoid another GObject Introspection warning in redshift-gtk by providing
the required version of AppIndicator3 before import it.
2015-11-14 12:09:34 +01:00
Christian Stadelmann 442fb9bd5d Specify required Gtk version
This fixes a warning when starting redshift-gtk with gtk 3.18.
2015-11-03 19:18:51 +01:00
Michael Vetter 6b61e3f9e4 Remove trailing whitespaces 2015-08-04 14:01:37 +02:00
Jon Lund Steffensen 5f26b3d396 Merge pull request #197 from forivall/clamp-fix
Fix clamp issues
2015-05-10 20:34:47 -04:00
Mattias Andrée 6954f21fd4 remove unnecessary null-checks, it is safe to pass NULL to free (per documentation)
Signed-off-by: Mattias Andrée <maandree@operamail.com>
2015-05-07 17:52:27 +02:00
Jordan Klassen ba15832b9e Fix CLAMP macro overwritten by glib headers
Fixes #188

When I moved the macro definition below all of the includes, I got the
following compiler warning:

/usr/include/glib-2.0/glib/gmacros.h:246:0: note: this is the location
of the previous definition
 #define CLAMP(x, low, high)  (((x) > (high)) ? (high) : (((x) < (low))
? (low) : (x)))

So, that's the macro definition that was being used whenever "CLAMP" was
used. It's pretty obvious what went wrong.
2015-05-02 12:35:05 -07:00