summaryrefslogtreecommitdiff
path: root/pluma/pluma-window.c
diff options
context:
space:
mode:
authormbkma <[email protected]>2021-02-10 12:02:25 +0100
committerraveit65 <[email protected]>2021-03-02 22:19:58 +0100
commitc0c513f3ef7e7ea432e799d8a5e10cfe94d38908 (patch)
treee4b7840617c282855884bd3fac3c1c1313cb68fa /pluma/pluma-window.c
parent814ae9fdeb8367d0f5b43a4691b32a514cf3e6e9 (diff)
downloadpluma-c0c513f3ef7e7ea432e799d8a5e10cfe94d38908.tar.bz2
pluma-c0c513f3ef7e7ea432e799d8a5e10cfe94d38908.tar.xz
Introduce PlumaWindowActivatable, PlumaAppActivatable, PlumaViewActivatable
These interfaces are for extensions that should be activated against a window/app/view. Backport from - https://gitlab.gnome.org/GNOME/gedit/-/commit/4fe7161560941ae1aa42165ff4d71121ad6f67b9 - https://gitlab.gnome.org/GNOME/gedit/-/commit/56a790a6851ebc98766cc4aca27cb32dde1b41bf - https://gitlab.gnome.org/GNOME/gedit/-/commit/210ed41e48988646203fc94eba19ce94657821cd In pluma-app.c we use gtk_main_quit instead of app object unref when last window closed. Plugin engine finalization calls app_get_default which reconstructs the app object. Before that was reasonably ok because it didn't really do anything, but now the app does stuff in 'init'. See https://gitlab.gnome.org/GNOME/gedit/-/commit/90c9889a4a31fbebfa042c5d2c64bb2b05160b10
Diffstat (limited to 'pluma/pluma-window.c')
-rw-r--r--pluma/pluma-window.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/pluma/pluma-window.c b/pluma/pluma-window.c
index 337af89c..e797b6e0 100644
--- a/pluma/pluma-window.c
+++ b/pluma/pluma-window.c
@@ -41,7 +41,6 @@
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <gtksourceview/gtksource.h>
-#include <libpeas/peas-activatable.h>
#include <libpeas/peas-extension-set.h>
#include "pluma-ui.h"
@@ -57,6 +56,7 @@
#include "pluma-panel.h"
#include "pluma-documents-panel.h"
#include "pluma-plugins-engine.h"
+#include "pluma-window-activatable.h"
#include "pluma-enum-types.h"
#include "pluma-dirs.h"
#include "pluma-status-combo-box.h"
@@ -919,7 +919,7 @@ set_sensitivity_according_to_tab (PlumaWindow *window,
update_next_prev_doc_sensitivity (window, tab);
- peas_extension_set_call (window->priv->extensions, "update_state", window);
+ peas_extension_set_call (window->priv->extensions, "update_state");
}
static void
@@ -2771,7 +2771,7 @@ sync_name (PlumaTab *tab,
g_free (escaped_name);
g_free (tip);
- peas_extension_set_call (window->priv->extensions, "update_state", window);
+ peas_extension_set_call (window->priv->extensions, "update_state");
}
static PlumaWindow *
@@ -3167,7 +3167,7 @@ selection_changed (PlumaDocument *doc,
editable &&
gtk_text_buffer_get_has_selection (GTK_TEXT_BUFFER (doc)));
- peas_extension_set_call (window->priv->extensions, "update_state", window);
+ peas_extension_set_call (window->priv->extensions, "update_state");
}
static void
@@ -3176,7 +3176,7 @@ sync_languages_menu (PlumaDocument *doc,
PlumaWindow *window)
{
update_languages_menu (window);
- peas_extension_set_call (window->priv->extensions, "update_state", window);
+ peas_extension_set_call (window->priv->extensions, "update_state");
}
static void
@@ -3188,7 +3188,7 @@ readonly_changed (PlumaDocument *doc,
sync_name (window->priv->active_tab, NULL, window);
- peas_extension_set_call (window->priv->extensions, "update_state", window);
+ peas_extension_set_call (window->priv->extensions, "update_state");
}
static void
@@ -3196,7 +3196,7 @@ editable_changed (PlumaView *view,
GParamSpec *arg1,
PlumaWindow *window)
{
- peas_extension_set_call (window->priv->extensions, "update_state", window);
+ peas_extension_set_call (window->priv->extensions, "update_state");
}
static void
@@ -3408,7 +3408,7 @@ notebook_tab_removed (PlumaNotebook *notebook,
if (window->priv->num_tabs == 0)
{
- peas_extension_set_call (window->priv->extensions, "update_state", window);
+ peas_extension_set_call (window->priv->extensions, "update_state");
}
update_window_state (window);
@@ -4096,9 +4096,10 @@ pluma_window_init (PlumaWindow *window)
pluma_debug_message (DEBUG_WINDOW, "Update plugins ui");
window->priv->extensions = peas_extension_set_new (PEAS_ENGINE (pluma_plugins_engine_get_default ()),
- PEAS_TYPE_ACTIVATABLE, "object", window, NULL);
-
- peas_extension_set_call (window->priv->extensions, "activate");
+ PLUMA_TYPE_WINDOW_ACTIVATABLE,
+ "window",
+ window,
+ NULL);
g_signal_connect (window->priv->extensions,
"extension-added",
@@ -4109,8 +4110,10 @@ pluma_window_init (PlumaWindow *window)
G_CALLBACK (on_extension_removed),
window);
- /* set visibility of panes.
- * This needs to be done after plugins activatation */
+ peas_extension_set_call (window->priv->extensions, "activate");
+
+ /* set visibility of panes.
+ This needs to be done after plugins activatation */
init_panels_visibility (window);
update_sensitivity_according_to_open_tabs (window);