Package: release.debian.org Severity: normal User: release.debian....@packages.debian.org Usertags: unblock X-Debbugs-Cc: franc...@debian.org
Dear Release Team, Please unblock package workrave. The version currently in unstable fixes important bug #986968. This bug makes workrave mostly unusable on GNOME, which is our default desktop environment. The package remains usable on other desktop environments, hence the non-RC severity. The fix is a backport of an upstream commit (as documented in the DEP-3 headers of the patch), so the risk of regression should be limited. Also, this is a non-key leaf package. The debdiff is attached. unblock workrave/1.10.44-7.1 Thanks, -- ⢀⣴⠾⠻⢶⣦⠀ Sébastien Villemot ⣾⠁⢠⠒⠀⣿⡁ Debian Developer ⢿⡄⠘⠷⠚⠋⠀ https://sebastien.villemot.name ⠈⠳⣄⠀⠀⠀⠀ https://www.debian.org
diff -Nru workrave-1.10.44/debian/changelog workrave-1.10.44/debian/changelog --- workrave-1.10.44/debian/changelog 2021-01-19 09:09:17.000000000 +0100 +++ workrave-1.10.44/debian/changelog 2021-04-15 21:29:48.000000000 +0200 @@ -1,3 +1,11 @@ +workrave (1.10.44-7.1) unstable; urgency=medium + + * Non-maintainer upload. + * fix-gnome-extension-crash.patch: new patch, fixes GNOME extension crash at + Shell startup. (Closes: #986968) + + -- Sébastien Villemot <sebast...@debian.org> Thu, 15 Apr 2021 21:29:48 +0200 + workrave (1.10.44-7) unstable; urgency=medium * Bump copyright years in debian/copyright. diff -Nru workrave-1.10.44/debian/patches/fix-gnome-extension-crash.patch workrave-1.10.44/debian/patches/fix-gnome-extension-crash.patch --- workrave-1.10.44/debian/patches/fix-gnome-extension-crash.patch 1970-01-01 01:00:00.000000000 +0100 +++ workrave-1.10.44/debian/patches/fix-gnome-extension-crash.patch 2021-04-15 21:28:31.000000000 +0200 @@ -0,0 +1,183 @@ +Description: Fix crash in GNOME Shell extension + On GNOME Shell startup, the extension crashes and disables all other + extensions. +Origin: backport, https://github.com/rcaelers/workrave/commit/56af818cd3e148069134551aacc7b06043d8541a +Bug: https://github.com/rcaelers/workrave/issues/281 +Bug-Debian: https://bugs.debian.org/986968 +Last-Update: 2021-04-14 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/frontend/applets/common/src/timebar.c ++++ b/frontend/applets/common/src/timebar.c +@@ -25,7 +25,7 @@ + static void workrave_timebar_class_init(WorkraveTimebarClass *klass); + static void workrave_timebar_init(WorkraveTimebar *self); + +-static void workrave_timebar_init_ui(WorkraveTimebar *self); ++static void workrave_timebar_init_ui(WorkraveTimebar *self, cairo_t *c); + static void workrave_timebar_draw_filled_box(WorkraveTimebar *self, cairo_t *cr, int x, int y, int width, int height); + static void workrave_timebar_draw_frame(WorkraveTimebar *self, cairo_t *cr, int width, int height); + static void workrave_timebar_compute_bar_dimensions(WorkraveTimebar *self, int *bar_width, int *sbar_width, int *bar_height); +@@ -48,8 +48,6 @@ enum + + struct _WorkraveTimebarPrivate + { +- gchar *name; +- + //! Color of the time-bar. + WorkraveColorId bar_color; + +@@ -77,9 +75,6 @@ struct _WorkraveTimebarPrivate + int width; + int height; + +-#ifndef USE_GTK2 +- GtkStyleContext *style_context; +-#endif + PangoContext *pango_context; + PangoLayout *pango_layout; + }; +@@ -127,8 +122,10 @@ workrave_timebar_init(WorkraveTimebar *s + priv->secondary_bar_value = 100; + priv->secondary_bar_max_value = 600; + priv->bar_text = g_strdup(""); +- +- workrave_timebar_init_ui(self); ++ priv->width = 0; ++ priv->height = 0; ++ priv->pango_context = NULL; ++ priv->pango_layout = NULL; + } + + +@@ -249,80 +246,54 @@ workrave_timebar_draw_text(WorkraveTimeb + } + + +-#ifndef USE_GTK2 +-static void +-workrave_timebar_init_ui(WorkraveTimebar *self) +-{ +- WorkraveTimebarPrivate *priv = workrave_timebar_get_instance_private(self); +- +- priv->style_context = gtk_style_context_new(); +- +- GtkWidgetPath *path = gtk_widget_path_new(); +- gtk_widget_path_append_type(path, GTK_TYPE_BUTTON); +- gtk_style_context_set_path(priv->style_context, path); +- gtk_style_context_add_class(priv->style_context, GTK_STYLE_CLASS_TROUGH); +- +- GdkScreen *screen = gdk_screen_get_default(); +- priv->pango_context = gdk_pango_context_get_for_screen(screen); +- +- PangoFontDescription *font_desc = NULL; +- gtk_style_context_get (priv->style_context, GTK_STATE_FLAG_ACTIVE, "font", &font_desc, NULL); +- +- pango_context_set_language(priv->pango_context, gtk_get_default_language()); +- pango_context_set_font_description(priv->pango_context, font_desc); +- +- priv->pango_layout = pango_layout_new(priv->pango_context); +- pango_layout_set_text(priv->pango_layout, "-9:59:59", -1); +- +- pango_layout_get_pixel_size(priv->pango_layout, &priv->width, &priv->height); +- +- priv->width = MAX(priv->width + 2 * MARGINX, MIN_HORIZONTAL_BAR_WIDTH); +- priv->height = MAX(priv->height + 2 * MARGINY, MIN_HORIZONTAL_BAR_HEIGHT); +- +- gtk_widget_path_free(path); +-} +- +-static void +-workrave_timebar_draw_frame(WorkraveTimebar *self, cairo_t *cr, +- int width, int height) ++static PangoFontDescription * ++workrave_timebar_get_font(void) + { +- WorkraveTimebarPrivate *priv = workrave_timebar_get_instance_private(self); ++ PangoFontDescription *font_desc; + +- gtk_style_context_save(priv->style_context); +- gtk_style_context_set_state(priv->style_context, (GtkStateFlags)GTK_STATE_FLAG_ACTIVE); ++#ifndef USE_GTK2 ++ if (gdk_screen_get_default()) ++ { ++ GtkStyleContext *style = gtk_style_context_new(); ++ GtkWidgetPath *path = gtk_widget_path_new(); + +- gtk_render_frame(priv->style_context, cr, 0, 0, width -1, height -1); ++ gtk_widget_path_append_type(path, GTK_TYPE_BUTTON); ++ gtk_style_context_set_path(style, path); ++ gtk_widget_path_unref(path); + +- GdkRGBA color = bar_colors[COLOR_ID_BG]; +- set_color(cr, color); +- cairo_rectangle(cr, BORDER_SIZE, BORDER_SIZE, width - 2 * BORDER_SIZE , height - 2 *BORDER_SIZE); +- cairo_fill(cr); ++ gtk_style_context_get(style, GTK_STATE_FLAG_NORMAL, GTK_STYLE_PROPERTY_FONT, &font_desc, NULL); ++ g_object_unref(style); ++ } ++ else ++#endif ++ { ++ font_desc = pango_font_description_from_string("Sans 10"); ++ } + +- gtk_style_context_restore(priv->style_context); ++ return font_desc; + } + +-#else +- + static void +-workrave_timebar_init_ui(WorkraveTimebar *self) ++workrave_timebar_init_ui(WorkraveTimebar *self, cairo_t *cr) + { + WorkraveTimebarPrivate *priv = workrave_timebar_get_instance_private(self); + +- GdkScreen *screen = gdk_screen_get_default(); +- priv->pango_context = gdk_pango_context_get_for_screen(screen); +- +- const PangoFontDescription *font_desc = pango_font_description_from_string("Sans 10"); ++ if (priv->pango_layout == NULL) ++ { ++ PangoFontDescription *font_desc = workrave_timebar_get_font(); + +- pango_context_set_language(priv->pango_context, gtk_get_default_language()); +- pango_context_set_font_description(priv->pango_context, font_desc); ++ priv->pango_layout = pango_cairo_create_layout(cr); ++ priv->pango_context = pango_layout_get_context(priv->pango_layout); + +- priv->pango_layout = pango_layout_new(priv->pango_context); +- pango_layout_set_text(priv->pango_layout, "-9:59:59", -1); ++ pango_context_set_language(priv->pango_context, gtk_get_default_language()); ++ pango_context_set_font_description(priv->pango_context, font_desc); + +- pango_layout_get_pixel_size(priv->pango_layout, &priv->width, &priv->height); ++ pango_layout_set_text(priv->pango_layout, "-9:59:59", -1); ++ pango_layout_get_pixel_size(priv->pango_layout, &priv->width, &priv->height); + +- priv->width = MAX(priv->width + 2 * MARGINX, MIN_HORIZONTAL_BAR_WIDTH); +- priv->height = MAX(priv->height + 2 * MARGINY, MIN_HORIZONTAL_BAR_HEIGHT); ++ priv->width = MAX(priv->width + 2 * MARGINX, MIN_HORIZONTAL_BAR_WIDTH); ++ priv->height = MAX(priv->height + 2 * MARGINY, MIN_HORIZONTAL_BAR_HEIGHT); ++ } + } + + static void +@@ -353,7 +324,6 @@ workrave_timebar_draw_frame(WorkraveTime + cairo_rectangle(cr, 2, 2, width - 4 , height - 4); + cairo_fill(cr); + } +-#endif + + static void + workrave_timebar_draw_filled_box(WorkraveTimebar *self, cairo_t *cr, +@@ -417,6 +387,8 @@ workrave_timebar_set_text(WorkraveTimeba + void + workrave_timebar_draw(WorkraveTimebar *self, cairo_t *cr) + { ++ workrave_timebar_init_ui(self, cr); ++ + workrave_timebar_draw_bar(self, cr); + workrave_timebar_draw_text(self, cr); + } diff -Nru workrave-1.10.44/debian/patches/series workrave-1.10.44/debian/patches/series --- workrave-1.10.44/debian/patches/series 2021-01-19 09:09:17.000000000 +0100 +++ workrave-1.10.44/debian/patches/series 2021-04-15 21:28:31.000000000 +0200 @@ -2,3 +2,4 @@ fix_workrave-dump.patch libayatana-indicator.patch xfce-4.15-compatibility.patch +fix-gnome-extension-crash.patch