From 657be3f3120e2671c5b01367978258cbdd805597 Mon Sep 17 00:00:00 2001 From: yuanxing Date: Tue, 10 Jan 2023 16:21:37 +0800 Subject: [PATCH] fix(theme):remove pie in kiran MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除kiran主题中的饼图倒计时 --- 0001-fix-kiran-remove-pie-draw-in-kiran.patch | 144 ++++++++++++++++++ mate-notification-daemon.spec | 6 +- 2 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 0001-fix-kiran-remove-pie-draw-in-kiran.patch diff --git a/0001-fix-kiran-remove-pie-draw-in-kiran.patch b/0001-fix-kiran-remove-pie-draw-in-kiran.patch new file mode 100644 index 0000000..df4d73b --- /dev/null +++ b/0001-fix-kiran-remove-pie-draw-in-kiran.patch @@ -0,0 +1,144 @@ +From eca0ea6e009c6f4f1edca2baa70004b217a533a2 Mon Sep 17 00:00:00 2001 +From: yuanxing +Date: Wed, 7 Dec 2022 11:08:08 +0800 +Subject: [PATCH] fix(kiran):remove pie draw in kiran +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 在kiran主题中去除饼图倒计时功能 +--- + src/themes/kiran/kiran.c | 91 ---------------------------------------- + 1 file changed, 91 deletions(-) + +diff --git a/src/themes/kiran/kiran.c b/src/themes/kiran/kiran.c +index 7f6b9b1..b7ba1cd 100644 +--- a/src/themes/kiran/kiran.c ++++ b/src/themes/kiran/kiran.c +@@ -200,27 +200,6 @@ fill_background_when_pointer_enter(GtkWidget *widget, WindowData *windata, cairo + cairo_fill(cr); + } + +-static void +-draw_pie(GtkWidget *pie, WindowData *windata, cairo_t *cr) +-{ +- if (windata->timeout == 0) +- return; +- +- gdouble arc_angle = 1.0 - (gdouble)windata->remaining / (gdouble)windata->timeout; +- cairo_set_source_rgba(cr, +- 92 / 255.0, +- 92 / 255.0, +- 92 / 255.0, 1); +- cairo_move_to(cr, PIE_RADIUS, PIE_RADIUS); +- cairo_arc_negative(cr, +- PIE_RADIUS, PIE_RADIUS, +- PIE_RADIUS, +- -G_PI / 2, (-0.25 + arc_angle) * 2 * G_PI); +- cairo_line_to(cr, PIE_RADIUS, PIE_RADIUS); +- +- cairo_fill(cr); +-} +- + static void + update_shape_region(cairo_surface_t *surface, + WindowData *windata) +@@ -354,52 +333,6 @@ on_draw(GtkWidget *widget, cairo_t *cr, WindowData *windata) + return FALSE; + } + +-static gboolean +-countdown_expose_cb(GtkWidget *pie, +- cairo_t *cr, +- WindowData *windata) +-{ +- cairo_t *cr2; +- cairo_surface_t *surface; +- GtkAllocation alloc; +- +- cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); +- +- gtk_widget_get_allocation(pie, &alloc); +- +- surface = cairo_surface_create_similar(cairo_get_target(cr), +- CAIRO_CONTENT_COLOR_ALPHA, +- alloc.width, +- alloc.height); +- +- cr2 = cairo_create(surface); +- +- cairo_translate(cr2, -alloc.x, -alloc.y); +- +- GtkStateFlags flags = gtk_widget_get_state_flags(windata->win); +- if (flags & GTK_STATE_FLAG_PRELIGHT) +- { +- fill_background_when_pointer_enter(pie, windata, cr2); +- } +- else +- { +- fill_background(pie, windata, cr2); +- } +- cairo_translate(cr2, alloc.x, alloc.y); +- draw_pie(pie, windata, cr2); +- cairo_fill(cr2); +- +- cairo_destroy(cr2); +- +- cairo_save(cr); +- cairo_set_source_surface(cr, surface, 0, 0); +- cairo_paint(cr); +- cairo_restore(cr); +- +- cairo_surface_destroy(surface); +- return TRUE; +-} +- + static gboolean + on_configure_event(GtkWidget *widget, GdkEventConfigure *event, WindowData *windata) + { +@@ -766,19 +699,6 @@ void add_notification_action(GtkWindow *nw, + if (gtk_widget_get_visible(windata->actions_box)) + { + gtk_widget_show(windata->actions_box); +- /* Don't try to re-add a pie_countdown */ +- if (!windata->pie_countdown) +- { +- windata->pie_countdown = gtk_drawing_area_new(); +- gtk_widget_set_halign(windata->pie_countdown, GTK_ALIGN_END); +- gtk_widget_set_valign(windata->pie_countdown, GTK_ALIGN_END); +- gtk_widget_show(windata->pie_countdown); +- +- gtk_box_pack_end(GTK_BOX(windata->actions_box), windata->pie_countdown, FALSE, FALSE, 0); +- gtk_widget_set_size_request(windata->pie_countdown, PIE_WIDTH, PIE_HEIGHT); +- g_signal_connect(G_OBJECT(windata->pie_countdown), "draw", +- G_CALLBACK(countdown_expose_cb), windata); +- } + } + + if (windata->action_icons) +@@ -846,8 +766,6 @@ void clear_notification_actions(GtkWindow *nw) + { + WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata"); + +- windata->pie_countdown = NULL; +- + gtk_widget_hide(windata->actions_box); + gtk_container_foreach(GTK_CONTAINER(windata->actions_box), + (GtkCallback)gtk_widget_destroy, NULL); +@@ -916,13 +834,4 @@ void notification_tick(GtkWindow *nw, glong remaining) + { + WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata"); + windata->remaining = remaining; +- +- if (windata->pie_countdown != NULL) +- { +- gtk_widget_queue_draw_area(windata->pie_countdown, +- 0, +- 0, +- PIE_WIDTH, +- PIE_HEIGHT); +- } + } +-- +2.36.1 + diff --git a/mate-notification-daemon.spec b/mate-notification-daemon.spec index 24af684..00bbc24 100644 --- a/mate-notification-daemon.spec +++ b/mate-notification-daemon.spec @@ -15,7 +15,7 @@ Name: mate-notification-daemon Version: %{branch}.1 %if 0%{?rel_build} -Release: 3 +Release: 4 %else Release: 0.13%{?git_rel} %endif @@ -46,6 +46,7 @@ Patch1014: 0001-fix-kiran-theme-Remove-the-blue-border-when-the-mous-e49594 Patch1015: 1015-fix-css-modify-css-error-and-improve-style-of-kiran-0ee639d8.patch Patch1016: 1016-fix-control-center-fix-mate-notification-properties--5dc16c41.patch Patch1017: 1017-fix-daemon-return-false-while-dbus-proxy-init-failed.patch +Patch1018: 0001-fix-kiran-remove-pie-draw-in-kiran.patch BuildRequires: desktop-file-utils BuildRequires: libcanberra-devel @@ -110,6 +111,9 @@ rm -f %{buildroot}%{_datadir}/applications/mate-notification-daemon.desktop %changelog +* Tue Jun 10 2023 yuanxing - 1.22.1-4 +- KYOS-F: remove pie in kiran theme + * Wed Aug 24 2022 liuxinhao - 1.22.1-3 - KYOS-F: autoreconf before the build phase