From e5b3daf298a65af1aa0f2ace6091973c97fb73d8 Mon Sep 17 00:00:00 2001 From: Jon Lund Steffensen Date: Fri, 11 Apr 2014 00:26:57 +0200 Subject: redshift-gtk: Fix crash when toggling state using the status icon --- src/redshift-gtk/statusicon.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/redshift-gtk/statusicon.py b/src/redshift-gtk/statusicon.py index 5685f08..08f28ef 100644 --- a/src/redshift-gtk/statusicon.py +++ b/src/redshift-gtk/statusicon.py @@ -79,7 +79,7 @@ class RedshiftStatusIcon(object): # Add toggle action self.toggle_item = Gtk.CheckMenuItem.new_with_label(_('Enabled')) - self.toggle_item.connect('activate', self.toggle_cb) + self.toggle_item.connect('activate', self.toggle_item_cb) self.status_menu.append(self.toggle_item) # Add suspend menu @@ -215,6 +215,10 @@ class RedshiftStatusIcon(object): self.status_icon, button, time) def toggle_cb(self, widget, data=None): + self.remove_suspend_timer() + self.child_toggle_status() + + def toggle_item_cb(self, widget, data=None): # Only toggle if a change from current state was requested if self.is_enabled() != widget.get_active(): self.remove_suspend_timer() -- cgit v1.2.3-70-g09d2 From 254b1e2a5704dddb077bde88f7c273f75902ef80 Mon Sep 17 00:00:00 2001 From: Jon Lund Steffensen Date: Sun, 13 Apr 2014 22:10:34 +0200 Subject: Fix #67: Geoclue should pull in Glib as dependency Add checks in configure.ac for Glib and pull in through Makefile.am when Geoclue support is enabled. --- configure.ac | 4 +++- src/Makefile.am | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d4bfc68..339f0c8 100644 --- a/configure.ac +++ b/configure.ac @@ -17,12 +17,14 @@ AM_GNU_GETTEXT_VERSION([0.17]) AM_GNU_GETTEXT([external]) PKG_CHECK_MODULES([DRM], [libdrm], [have_drm=yes], [have_drm=no]) + PKG_CHECK_MODULES([X11], [x11], [have_x11=yes], [have_x11=no]) PKG_CHECK_MODULES([XF86VM], [xxf86vm], [have_xf86vm=yes], [have_xf86vm=no]) PKG_CHECK_MODULES([XCB], [xcb], [have_xcb=yes], [have_xcb=no]) PKG_CHECK_MODULES([XCB_RANDR], [xcb-randr], [have_xcb_randr=yes], [have_xcb_randr=no]) +PKG_CHECK_MODULES([GLIB], [glib-2.0 gobject-2.0], [have_glib=yes], [have_glib=no]) PKG_CHECK_MODULES([GEOCLUE], [geoclue], [have_geoclue=yes], [have_geoclue=no]) AC_CHECK_HEADER([windows.h], [have_windows_h=yes], [have_windows_h=no]) @@ -133,7 +135,7 @@ AC_ARG_ENABLE([geoclue], [AC_HELP_STRING([--enable-geoclue], [enable Geoclue location provider])], [enable_geoclue=$enableval],[enable_geoclue=maybe]) AS_IF([test "x$enable_geoclue" != xno], [ - AS_IF([test "x$have_geoclue" = xyes], [ + AS_IF([test "x$have_geoclue" = xyes -a "x$have_glib" = xyes], [ AC_DEFINE([ENABLE_GEOCLUE], 1, [Define to 1 to enable Geoclue location provider]) AC_MSG_RESULT([yes]) diff --git a/src/Makefile.am b/src/Makefile.am index e83073b..37a0308 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -59,7 +59,10 @@ endif if ENABLE_GEOCLUE redshift_SOURCES += location-geoclue.c location-geoclue.h -AM_CFLAGS += $(GEOCLUE_CFLAGS) $(GEOCLUE_LIBS) +AM_CFLAGS += \ + $(GEOCLUE_CFLAGS) $(GEOCLUE_LIBS) \ + $(GLIB_CFLAGS) $(GLIB_LIBS) redshift_LDADD += \ $(GEOCLUE_LIBS) $(GEOCLUE_CFLAGS) + $(GLIB_LIBS) $(GLIB_CFLAGS) endif -- cgit v1.2.3-70-g09d2 From dcb3ee456478089a153cf504b80b826504dfcce9 Mon Sep 17 00:00:00 2001 From: Jon Lund Steffensen Date: Sun, 13 Apr 2014 22:18:44 +0200 Subject: Fix #66: Do not distribute redshift-gtk, only redshift-gtk.in --- src/redshift-gtk/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/redshift-gtk/Makefile.am b/src/redshift-gtk/Makefile.am index 96d7718..c4ab24f 100644 --- a/src/redshift-gtk/Makefile.am +++ b/src/redshift-gtk/Makefile.am @@ -8,7 +8,7 @@ nodist_redshift_gtk_PYTHON = \ defs.py redshift_gtkdir = $(pythondir)/redshift_gtk -dist_bin_SCRIPTS = redshift-gtk +bin_SCRIPTS = redshift-gtk endif EXTRA_DIST = defs.py.in redshift-gtk.in -- cgit v1.2.3-70-g09d2 From 79efce3dfc23606f60a0c6d1cee8551bc81403f1 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 11 Apr 2014 07:24:57 +0200 Subject: Do not segfault just because an error has not been given MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/location-geoclue.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/location-geoclue.c b/src/location-geoclue.c index 5be651f..d420457 100644 --- a/src/location-geoclue.c +++ b/src/location-geoclue.c @@ -67,9 +67,13 @@ location_geoclue_start(location_geoclue_state_t *state) g_object_unref(master); if (client == NULL) { - g_printerr(_("Unable to obtain master client: %s\n"), - error->message); - g_error_free(error); + if (error != NULL) { + g_printerr(_("Unable to obtain master client: %s\n"), + error->message); + g_error_free(error); + } else { + g_printerr(_("Unable to obtain master client\n")); + } return -1; } @@ -78,9 +82,13 @@ location_geoclue_start(location_geoclue_state_t *state) 0, FALSE, GEOCLUE_RESOURCE_NETWORK, &error)) { - g_printerr(_("Can't set requirements for master: %s\n"), - error->message); - g_error_free(error); + if (error != NULL) { + g_printerr(_("Can't set requirements for master: %s\n"), + error->message); + g_error_free(error); + } else { + g_printerr(_("Can't set requirements for master\n")); + } g_object_unref(client); return -1; -- cgit v1.2.3-70-g09d2 From c65af6e247893b808ccce90efc1193a1cf882d15 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 11 Apr 2014 07:28:14 +0200 Subject: Try to use DISPLAY=:0 if not in X MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/location-geoclue.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/location-geoclue.c b/src/location-geoclue.c index d420457..5c027c7 100644 --- a/src/location-geoclue.c +++ b/src/location-geoclue.c @@ -60,6 +60,10 @@ location_geoclue_start(location_geoclue_state_t *state) state->position = geoclue_position_new(state->provider, state->provider_path); } else { + if (getenv("DISPLAY") == NULL || *getenv("DISPLAY") == '\0') { + /* TODO This (hack) should be removed when GeoClue has been patched. */ + putenv("DISPLAY=:0"); + } GError *error = NULL; GeoclueMaster *master = geoclue_master_get_default(); GeoclueMasterClient *client = geoclue_master_create_client(master, -- cgit v1.2.3-70-g09d2 From 39f80743e9ed4e6a3d1027e645d84c5779cb1a8f Mon Sep 17 00:00:00 2001 From: Maks Verver Date: Sat, 19 Apr 2014 18:03:54 +0200 Subject: Fix line splitting logic. --- src/redshift-gtk/statusicon.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/redshift-gtk/statusicon.py b/src/redshift-gtk/statusicon.py index 08f28ef..ec0dfe8 100644 --- a/src/redshift-gtk/statusicon.py +++ b/src/redshift-gtk/statusicon.py @@ -289,7 +289,7 @@ class RedshiftStatusIcon(object): if key == 'Status': self.change_status(value != 'Disabled') elif key == 'Color temperature': - self.change_temperature(int(value[:-1], 10)) + self.change_temperature(int(value.rstrip('K'), 10)) elif key == 'Period': self.change_period(value) elif key == 'Location': @@ -308,9 +308,10 @@ class RedshiftStatusIcon(object): ib.buf += os.read(f, 256).decode('utf-8') # Split input at line break - sep = True - while sep != '': + while True: first, sep, last = ib.buf.partition('\n') + if sep == '': + break ib.buf = last ib.lines.append(first) if stdout: -- cgit v1.2.3-70-g09d2 From 565ffc3c5030e2134c8caf655f89a0214018ce95 Mon Sep 17 00:00:00 2001 From: Jon Lund Steffensen Date: Sun, 20 Apr 2014 19:44:07 +0200 Subject: Update NEWS and configure.ac for 1.9.1 release --- NEWS | 11 +++++++++++ configure.ac | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index f751138..6f75ec1 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,13 @@ +v1.9.1 (2014-04-20) +* Fix: Do not distribute redshift-gtk, only redshift-gtk.in. +* Fix: Geoclue support should pull in Glib as dependency. +* geoclue: Fix segfault when error is NULL (Mattias Andrée). +* geoclue: Set DISPLAY=:0 to work around issue when outside X + (Mattias Andrée). +* redshift-gtk: Fix crash when toggling state using the status icon. +* redshift-gtk: Fix line splitting logic (Maks Verver). + v1.9 (2014-04-06) * Use improved color scheme provided by Ingo Thies. * Add drm driver which will apply adjustments on linux consoles @@ -15,6 +24,8 @@ v1.9 (2014-04-06) file (Mattias Andrée). * Load config from %LOCALAPPDATA%\redshift.conf on Windows (TingPing). * Add RPM spec for Fedora in contrib. +* redshift-gtk has been ported to Python3 and new PyGObject bindings + for Python. v1.8 (2013-10-21) * IMPORTANT: gtk-redshift has changed name to redshift-gtk. diff --git a/configure.ac b/configure.ac index 339f0c8..deae0cf 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([redshift], [1.9], [https://github.com/jonls/redshift/issues]) +AC_INIT([redshift], [1.9.1], [https://github.com/jonls/redshift/issues]) AC_CONFIG_SRCDIR([src/redshift.c]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz]) -- cgit v1.2.3-70-g09d2