diff options
author | madpilot <madpilot@FreeBSD.org> | 2018-01-23 04:15:09 +0800 |
---|---|---|
committer | madpilot <madpilot@FreeBSD.org> | 2018-01-23 04:15:09 +0800 |
commit | 618cebbcd61bcdcd757e071ca0bdfdb8f7ce115a (patch) | |
tree | daba27e464e8bd6eac9f9145494e2e04f9cc4788 | |
parent | f27e4ea7fd6625f4712d85990c0a8151ab644a1a (diff) | |
download | freebsd-ports-gnome-618cebbcd61bcdcd757e071ca0bdfdb8f7ce115a.tar.gz freebsd-ports-gnome-618cebbcd61bcdcd757e071ca0bdfdb8f7ce115a.tar.zst freebsd-ports-gnome-618cebbcd61bcdcd757e071ca0bdfdb8f7ce115a.zip |
Import code from mousepad development repository which fixes a dbus
messages storm causing heavy CPU usage, memory allocation and disk
usage when working with multiple windows.
While here also import a GTK3 specific fix.
Ref.:
https://bugzilla.xfce.org/show_bug.cgi?id=14184
https://bugzilla.xfce.org/show_bug.cgi?id=12134
Reported by: Erich Dollansky <freebsd.ed.lists@sumeritec.com>
Obtained from: https://git.xfce.org/apps/mousepad/
MFH: 2018Q1
-rw-r--r-- | editors/mousepad/Makefile | 2 | ||||
-rw-r--r-- | editors/mousepad/files/patch-mousepad_mousepad-action-group.c | 59 | ||||
-rw-r--r-- | editors/mousepad/files/patch-mousepad_mousepad-util.c | 11 | ||||
-rw-r--r-- | editors/mousepad/files/patch-mousepad_mousepad-window.c | 72 |
4 files changed, 112 insertions, 32 deletions
diff --git a/editors/mousepad/Makefile b/editors/mousepad/Makefile index cc396bf915cf..770165c9caa1 100644 --- a/editors/mousepad/Makefile +++ b/editors/mousepad/Makefile @@ -3,7 +3,7 @@ PORTNAME= mousepad PORTVERSION= 0.4.0 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= editors xfce MASTER_SITES= XFCE/src/apps/${PORTNAME}/${PORTVERSION:R} DIST_SUBDIR= xfce4 diff --git a/editors/mousepad/files/patch-mousepad_mousepad-action-group.c b/editors/mousepad/files/patch-mousepad_mousepad-action-group.c index 3d50b3a5bd0a..d5af132b96ac 100644 --- a/editors/mousepad/files/patch-mousepad_mousepad-action-group.c +++ b/editors/mousepad/files/patch-mousepad_mousepad-action-group.c @@ -1,25 +1,48 @@ --- mousepad/mousepad-action-group.c.orig 2014-09-01 20:50:07 UTC +++ mousepad/mousepad-action-group.c -@@ -283,7 +283,8 @@ void - mousepad_action_group_set_active_style_scheme (MousepadActionGroup *self, - GtkSourceStyleScheme *scheme) - { -- GtkAction *action; -+ GtkAction *action; -+ const gchar *scheme_name = NULL; +@@ -124,7 +124,7 @@ mousepad_action_group_class_init (MousepadActionGroupC + G_SIGNAL_RUN_LAST, + 0, NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, +- G_TYPE_NONE, 0, ++ G_TYPE_NONE, 1, + GTK_SOURCE_TYPE_LANGUAGE); + } - g_return_if_fail (MOUSEPAD_IS_ACTION_GROUP (self)); - -@@ -303,8 +304,11 @@ mousepad_action_group_set_active_style_s +@@ -302,11 +302,6 @@ mousepad_action_group_set_active_style_scheme (Mousepa + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE); self->locked = FALSE; - /* update the setting when the active action is changed */ -+ if (scheme != NULL) -+ scheme_name = gtk_source_style_scheme_get_id(scheme); -+ - self->locked = TRUE; +- /* update the setting when the active action is changed */ +- self->locked = TRUE; - MOUSEPAD_SETTING_SET_STRING (COLOR_SCHEME, gtk_source_style_scheme_get_id (scheme)); -+ MOUSEPAD_SETTING_SET_STRING (COLOR_SCHEME, scheme_name); - self->locked = FALSE; - +- self->locked = FALSE; +- g_object_notify (G_OBJECT (self), "active-style-scheme"); + } + +@@ -473,6 +468,8 @@ static void + mousepad_action_group_style_scheme_action_activate (MousepadActionGroup *self, + MousepadStyleSchemeAction *action) + { ++ const gchar *scheme_name = NULL; ++ + /* only update the active action if we're not already in the process of + * setting it and the sender action is actually active */ + if (! self->locked && +@@ -481,7 +478,14 @@ mousepad_action_group_style_scheme_action_activate (Mo + GtkSourceStyleScheme *scheme; + + scheme = mousepad_style_scheme_action_get_style_scheme (action); +- mousepad_action_group_set_active_style_scheme (self, scheme); ++ ++ /* update the setting when the active action is changed */ ++ if (scheme != NULL) ++ scheme_name = gtk_source_style_scheme_get_id(scheme); ++ ++ self->locked = TRUE; ++ MOUSEPAD_SETTING_SET_STRING (COLOR_SCHEME, scheme_name); ++ self->locked = FALSE; + } + } + diff --git a/editors/mousepad/files/patch-mousepad_mousepad-util.c b/editors/mousepad/files/patch-mousepad_mousepad-util.c new file mode 100644 index 000000000000..6197ad04bc92 --- /dev/null +++ b/editors/mousepad/files/patch-mousepad_mousepad-util.c @@ -0,0 +1,11 @@ +--- mousepad/mousepad-util.c.orig 2014-09-01 20:50:07 UTC ++++ mousepad/mousepad-util.c +@@ -1063,7 +1063,7 @@ mousepad_util_search (GtkTextBuffer *buffer, + GtkAction * + mousepad_util_find_related_action (GtkWidget *widget) + { +- GtkAction *action; ++ GtkAction *action = NULL; + + g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); + diff --git a/editors/mousepad/files/patch-mousepad_mousepad-window.c b/editors/mousepad/files/patch-mousepad_mousepad-window.c index 66b112e28197..c59d47d47963 100644 --- a/editors/mousepad/files/patch-mousepad_mousepad-window.c +++ b/editors/mousepad/files/patch-mousepad_mousepad-window.c @@ -1,18 +1,64 @@ --- mousepad/mousepad-window.c.orig 2014-09-01 20:58:02 UTC +++ mousepad/mousepad-window.c -@@ -717,12 +717,13 @@ mousepad_window_action_group_style_schem - MousepadActionGroup *group) - { - GtkSourceStyleScheme *scheme; -- const gchar *scheme_id; -+ const gchar *scheme_id = NULL; - gint npages, i; +@@ -712,32 +712,6 @@ mousepad_window_create_languages_menu (MousepadWindow - /* get the new active language */ - scheme = mousepad_action_group_get_active_style_scheme (group); + + static void +-mousepad_window_action_group_style_scheme_changed (MousepadWindow *window, +- GParamSpec *pspec, +- MousepadActionGroup *group) +-{ +- GtkSourceStyleScheme *scheme; +- const gchar *scheme_id; +- gint npages, i; +- +- /* get the new active language */ +- scheme = mousepad_action_group_get_active_style_scheme (group); - scheme_id = gtk_source_style_scheme_get_id (scheme); -+ if (scheme != NULL) -+ scheme_id = gtk_source_style_scheme_get_id (scheme); +- +- /* update the color scheme on all the documents */ +- npages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->notebook)); +- for (i = 0; i < npages; i++) +- { +- MousepadDocument *document; +- +- document = MOUSEPAD_DOCUMENT (gtk_notebook_get_nth_page (GTK_NOTEBOOK (window->notebook), i)); +- mousepad_view_set_color_scheme (document->textview, scheme_id); +- } +-} +- +- +- +-static void + mousepad_window_create_style_schemes_menu (MousepadWindow *window) + { + GtkWidget *menu, *item; +@@ -751,13 +725,6 @@ mousepad_window_create_style_schemes_menu (MousepadWin + gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), menu); + gtk_widget_show_all (menu); + gtk_widget_show (item); +- +- /* watch for activations of the style schemes actions */ +- g_signal_connect_object (window->action_group, +- "notify::active-style-scheme", +- G_CALLBACK (mousepad_window_action_group_style_scheme_changed), +- window, +- G_CONNECT_SWAPPED); + } + + +@@ -2122,7 +2089,14 @@ mousepad_window_notebook_create_window (GtkNotebook + g_object_ref (G_OBJECT (document)); + + /* remove the document from the active window */ ++#if GTK_CHECK_VERSION (3, 16, 0) ++ gtk_notebook_detach_tab (GTK_CONTAINER (window->notebook), page); ++#else ++ /* crashes on GTK+ 3 somewhere between 3.10-3.16 ++ * Fixed above using new function added in 3.16 ++ * See: https://bugzilla.gnome.org/show_bug.cgi?id=744385 */ + gtk_container_remove (GTK_CONTAINER (window->notebook), page); ++#endif - /* update the color scheme on all the documents */ - npages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->notebook)); + /* emit the new window with document signal */ + g_signal_emit (G_OBJECT (window), window_signals[NEW_WINDOW_WITH_DOCUMENT], 0, document, x, y); |