Date: Tue, 23 Jan 2018 13:10:33 +0000 (UTC) From: Guido Falsi <madpilot@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r459748 - in branches/2018Q1/editors/mousepad: . files Message-ID: <201801231310.w0NDAXCw053496@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: madpilot Date: Tue Jan 23 13:10:32 2018 New Revision: 459748 URL: https://svnweb.freebsd.org/changeset/ports/459748 Log: MFH: r459693 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/ Approved by: ports-secteam (swills) Added: branches/2018Q1/editors/mousepad/files/patch-mousepad_mousepad-util.c - copied unchanged from r459693, head/editors/mousepad/files/patch-mousepad_mousepad-util.c Modified: branches/2018Q1/editors/mousepad/Makefile branches/2018Q1/editors/mousepad/files/patch-mousepad_mousepad-action-group.c branches/2018Q1/editors/mousepad/files/patch-mousepad_mousepad-window.c Directory Properties: branches/2018Q1/ (props changed) Modified: branches/2018Q1/editors/mousepad/Makefile ============================================================================== --- branches/2018Q1/editors/mousepad/Makefile Tue Jan 23 13:08:18 2018 (r459747) +++ branches/2018Q1/editors/mousepad/Makefile Tue Jan 23 13:10:32 2018 (r459748) @@ -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 Modified: branches/2018Q1/editors/mousepad/files/patch-mousepad_mousepad-action-group.c ============================================================================== --- branches/2018Q1/editors/mousepad/files/patch-mousepad_mousepad-action-group.c Tue Jan 23 13:08:18 2018 (r459747) +++ branches/2018Q1/editors/mousepad/files/patch-mousepad_mousepad-action-group.c Tue Jan 23 13:10:32 2018 (r459748) @@ -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; + } + } + Copied: branches/2018Q1/editors/mousepad/files/patch-mousepad_mousepad-util.c (from r459693, head/editors/mousepad/files/patch-mousepad_mousepad-util.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2018Q1/editors/mousepad/files/patch-mousepad_mousepad-util.c Tue Jan 23 13:10:32 2018 (r459748, copy of r459693, head/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); + Modified: branches/2018Q1/editors/mousepad/files/patch-mousepad_mousepad-window.c ============================================================================== --- branches/2018Q1/editors/mousepad/files/patch-mousepad_mousepad-window.c Tue Jan 23 13:08:18 2018 (r459747) +++ branches/2018Q1/editors/mousepad/files/patch-mousepad_mousepad-window.c Tue Jan 23 13:10:32 2018 (r459748) @@ -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); + } - /* update the color scheme on all the documents */ - npages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->notebook)); + +@@ -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 + + /* emit the new window with document signal */ + g_signal_emit (G_OBJECT (window), window_signals[NEW_WINDOW_WITH_DOCUMENT], 0, document, x, y);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801231310.w0NDAXCw053496>