aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gamma-drm.c5
-rw-r--r--src/redshift-gtk/statusicon.py8
2 files changed, 11 insertions, 2 deletions
diff --git a/src/gamma-drm.c b/src/gamma-drm.c
index d15f3f6..c2ac4bd 100644
--- a/src/gamma-drm.c
+++ b/src/gamma-drm.c
@@ -21,7 +21,6 @@
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
-#include <alloca.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -60,7 +59,7 @@ drm_start(drm_state_t *state)
{
/* Acquire access to a graphics card. */
long maxlen = strlen(DRM_DIR_NAME) + strlen(DRM_DEV_NAME) + 10;
- char *pathname = alloca(maxlen * sizeof(char));
+ char pathname[maxlen];
sprintf(pathname, DRM_DEV_NAME, DRM_DIR_NAME, state->card_num);
@@ -69,6 +68,8 @@ drm_start(drm_state_t *state)
/* TODO check if access permissions, normally root or
membership of the video group is required. */
perror("open");
+ fprintf(stderr, _("Failed to open DRM device: %s\n"),
+ pathname);
return -1;
}
diff --git a/src/redshift-gtk/statusicon.py b/src/redshift-gtk/statusicon.py
index 86897c4..9d9835d 100644
--- a/src/redshift-gtk/statusicon.py
+++ b/src/redshift-gtk/statusicon.py
@@ -474,15 +474,23 @@ class RedshiftStatusIcon(object):
def change_temperature(self, temperature):
'''Change interface to new temperature'''
self.temperature_label.set_markup('<b>{}:</b> {}K'.format(_('Color temperature'), temperature))
+ self.update_tooltip_text()
def change_period(self, period):
'''Change interface to new period'''
self.period_label.set_markup('<b>{}:</b> {}'.format(_('Period'), period))
+ self.update_tooltip_text()
def change_location(self, location):
'''Change interface to new location'''
self.location_label.set_markup('<b>{}:</b> {}, {}'.format(_('Location'), *location))
+ def update_tooltip_text(self):
+ '''Update text of tooltip status icon '''
+ if not appindicator:
+ self.status_icon.set_tooltip_text('{}: {}K, {}: {}'.format(
+ _('Color temperature'), self._controller.temperature,
+ _('Period'), self._controller.period))
def autostart_cb(self, widget, data=None):
'''Callback when a request to toggle autostart is made'''