fix-crash.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. From 5efc0f05fc06cdb52c54338d0139d7316c3c1133 Mon Sep 17 00:00:00 2001
  2. From: Mamoru TASAKA <mtasaka@fedoraproject.org>
  3. Date: Sun, 4 Mar 2018 23:15:51 +0900
  4. Subject: [PATCH] [SF#900] taskbutton: detach menu from widget before widget is
  5. destroyed
  6. Although GTK+ 2 version doxygen lacks such information,
  7. https://developer.gnome.org/gtk3/stable/GtkMenu.html#gtk-menu-attach-to-widget
  8. says that the attached menu is to be destroyed when the widget is destroyed.
  9. So to "reuse" created menu, menu must be detached before the widget is to
  10. be destroyed,
  11. ---
  12. plugins/task-button.c | 8 ++++++++
  13. 1 file changed, 8 insertions(+)
  14. diff --git a/plugins/task-button.c b/plugins/task-button.c
  15. index 3e99068..9e8c398 100644
  16. --- a/plugins/task-button.c
  17. +++ b/plugins/task-button.c
  18. @@ -1538,7 +1538,17 @@ void task_button_update_windows_list(TaskButton *button, Window *list, gint n)
  19. l = next; /* go next details */
  20. }
  21. if (button->details == NULL) /* all windows were deleted */
  22. + {
  23. + GList *menu_list = gtk_menu_get_for_attach_widget(GTK_WIDGET(button));
  24. + menu_list = g_list_copy(menu_list);
  25. + for (l = menu_list; l; l = l->next)
  26. + {
  27. + GtkMenu *menu = GTK_MENU(l->data);
  28. + gtk_menu_detach(menu);
  29. + }
  30. + g_list_free(menu_list);
  31. gtk_widget_destroy(GTK_WIDGET(button));
  32. + }
  33. else if (has_removed && task_update_visibility(button))
  34. task_redraw_label(button);
  35. // FIXME: test if need to update menu
  36. --
  37. 2.1.4
  38. From 7aa84571eef5247c0335df57d6ac616cd03d46ee Mon Sep 17 00:00:00 2001
  39. From: Mamoru TASAKA <mtasaka@fedoraproject.org>
  40. Date: Wed, 14 Feb 2018 00:11:53 +0900
  41. Subject: [PATCH] [SF#905] plugins/monitors: reset the color if empty
  42. User may remove color value, or when doing copy/paste color value from somewhere,
  43. it seems that color value can once disappear.
  44. In such case, reset to the default to prevent segv
  45. ---
  46. plugins/monitors/monitors.c | 4 ++++
  47. 1 file changed, 4 insertions(+)
  48. diff --git a/plugins/monitors/monitors.c b/plugins/monitors/monitors.c
  49. index 19b8472..75f00c1 100644
  50. --- a/plugins/monitors/monitors.c
  51. +++ b/plugins/monitors/monitors.c
  52. @@ -748,6 +748,10 @@ monitors_apply_config (gpointer user_data)
  53. start:
  54. for (i = 0; i < N_MONITORS; i++)
  55. {
  56. + /* User may remove color value. In such case, reset to the default */
  57. + if (!colors[i])
  58. + colors[i] = g_strndup(default_colors[i], COLOR_SIZE-1);
  59. +
  60. if (mp->displayed_monitors[i])
  61. current_n_monitors++;
  62. --
  63. 2.1.4