Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package workrave for openSUSE:Factory checked in at 2021-04-15 16:58:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/workrave (Old) and /work/SRC/openSUSE:Factory/.workrave.new.12324 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "workrave" Thu Apr 15 16:58:00 2021 rev:6 rq:885586 version:1.10.44 Changes: -------- --- /work/SRC/openSUSE:Factory/workrave/workrave.changes 2020-09-16 19:39:12.694790577 +0200 +++ /work/SRC/openSUSE:Factory/.workrave.new.12324/workrave.changes 2021-04-15 16:58:41.914795940 +0200 @@ -1,0 +2,6 @@ +Thu Apr 15 06:38:32 UTC 2021 - Timo Jyrinki <[email protected]> + +- Add fix-wayland-gnome-crash.patch (boo#1184773). + * Cherry-pick and rebase a fix from upstream git to fix a GNOME crash. + +------------------------------------------------------------------- New: ---- fix-wayland-gnome-crash.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ workrave.spec ++++++ --- /var/tmp/diff_new_pack.lnWXkX/_old 2021-04-15 16:58:42.362796649 +0200 +++ /var/tmp/diff_new_pack.lnWXkX/_new 2021-04-15 16:58:42.366796655 +0200 @@ -1,7 +1,7 @@ # # spec file for package workrave # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,6 +26,8 @@ URL: http://www.workrave.org Source: https://github.com/rcaelers/workrave/archive/v%{upstream_version}.tar.gz Source2: %{name}-rpmlintrc +# PATCH-FIX-UPSTREAM fix-wayland-gnome-crash.patch boo#1184773 +Patch0: fix-wayland-gnome-crash.patch BuildRequires: autoconf BuildRequires: autoconf-archive BuildRequires: automake @@ -79,6 +81,7 @@ %prep %setup -q -n %{name}-%{upstream_version} +%patch0 -p1 %build ./autogen.sh ++++++ fix-wayland-gnome-crash.patch ++++++ >From 56af818cd3e148069134551aacc7b06043d8541a Mon Sep 17 00:00:00 2001 From: Rob Caelers <[email protected]> Date: Sun, 4 Apr 2021 20:11:24 +0200 Subject: [PATCH] Fix crash in Gnome Shell applet (#281) --- frontend/applets/common/src/timebar.c | 107 ++++++++++---------------- 1 file changed, 40 insertions(+), 67 deletions(-) diff --git a/frontend/applets/common/src/timebar.c b/frontend/applets/common/src/timebar.c index b35004f51..62bcf3282 100644 --- 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; }; @@ -129,8 +124,10 @@ workrave_timebar_init(WorkraveTimebar *self) 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; } @@ -239,80 +236,54 @@ workrave_timebar_draw_text(WorkraveTimebar *self, cairo_t *cr) } -#ifndef USE_GTK2 -static void -workrave_timebar_init_ui(WorkraveTimebar *self) +static PangoFontDescription * +workrave_timebar_get_font(void) { - 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; - 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) -{ - WorkraveTimebarPrivate *priv = workrave_timebar_get_instance_private(self); - - 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 @@ -341,7 +313,6 @@ workrave_timebar_draw_frame(WorkraveTimebar *self, cairo_t *cr, int width, int h 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, @@ -403,6 +374,8 @@ workrave_timebar_set_text(WorkraveTimebar *self, const gchar *text) 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); }
