summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-05-06 22:02:08 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-05-10 22:04:18 -0400
commit87e3484aa74f1daa212a6ff3d3492d81e7d37b8d (patch)
tree5fad7bd49a94ad6c40fe8be35df4216b3655771f /modules
parent38bbde200e51916535c0293c0c49d913a0c17805 (diff)
downloadgtk+-87e3484aa74f1daa212a6ff3d3492d81e7d37b8d.tar.gz
parasite: Don't open a window upon load
Instead, we want to let GTK+ open a window whose life-cycle it can control. We just ensure that all our types are registered when the module is loaded, so GTK+ can find them.
Diffstat (limited to 'modules')
-rw-r--r--modules/other/parasite/module.c24
-rw-r--r--modules/other/parasite/window.c24
-rw-r--r--modules/other/parasite/window.ui1
3 files changed, 21 insertions, 28 deletions
diff --git a/modules/other/parasite/module.c b/modules/other/parasite/module.c
index f54eadaca2..2b2db7a225 100644
--- a/modules/other/parasite/module.c
+++ b/modules/other/parasite/module.c
@@ -22,10 +22,18 @@
*/
#include <glib.h>
-#include "window.h"
+#include "button-path.h"
+#include "classes-list.h"
+#include "css-editor.h"
+#include "object-hierarchy.h"
+#include "property-cell-renderer.h"
+#include "prop-list.h"
#include "python-hooks.h"
+#include "python-shell.h"
#include "resources.h"
-
+#include "themes.h"
+#include "widget-tree.h"
+#include "window.h"
void
gtk_module_init (gint *argc, gchar ***argv)
@@ -36,7 +44,17 @@ gtk_module_init (gint *argc, gchar ***argv)
parasite_register_resource ();
- gtk_window_present (GTK_WINDOW (parasite_window_new ()));
+ g_type_ensure (PARASITE_TYPE_THEMES);
+ g_type_ensure (PARASITE_TYPE_CSS_EDITOR);
+ g_type_ensure (PARASITE_TYPE_BUTTON_PATH);
+ g_type_ensure (PARASITE_TYPE_WIDGET_TREE);
+ g_type_ensure (PARASITE_TYPE_PROP_LIST);
+ g_type_ensure (PARASITE_TYPE_OBJECT_HIERARCHY);
+ g_type_ensure (PARASITE_TYPE_CLASSES_LIST);
+ g_type_ensure (PARASITE_TYPE_PYTHON_SHELL);
+ g_type_ensure (PARASITE_TYPE_PROPERTY_CELL_RENDERER);
+ g_type_ensure (PARASITE_TYPE_WINDOW);
}
+
// vim: set et sw=2 ts=2:
diff --git a/modules/other/parasite/window.c b/modules/other/parasite/window.c
index 9fc8646e58..31242a6b96 100644
--- a/modules/other/parasite/window.c
+++ b/modules/other/parasite/window.c
@@ -37,19 +37,6 @@
G_DEFINE_TYPE (ParasiteWindow, parasite_window, GTK_TYPE_WINDOW)
-static void
-delete_window (GtkWidget *widget)
-{
- GApplication *app = g_application_get_default ();
-
- gtk_widget_hide (widget);
-
- if (app)
- g_application_quit (app);
- else
- exit (0);
-}
-
extern void on_inspect (GtkWidget *button, ParasiteWindow *pw);
static void
@@ -161,7 +148,6 @@ parasite_window_class_init (ParasiteWindowClass *klass)
gtk_widget_class_bind_template_child (widget_class, ParasiteWindow, python_shell);
gtk_widget_class_bind_template_child (widget_class, ParasiteWindow, widget_popup);
- gtk_widget_class_bind_template_callback (widget_class, delete_window);
gtk_widget_class_bind_template_callback (widget_class, on_inspect);
gtk_widget_class_bind_template_callback (widget_class, on_graphic_updates_toggled);
gtk_widget_class_bind_template_callback (widget_class, on_widget_tree_selection_changed);
@@ -171,16 +157,6 @@ parasite_window_class_init (ParasiteWindowClass *klass)
GtkWidget *
parasite_window_new (void)
{
- g_type_ensure (PARASITE_TYPE_THEMES);
- g_type_ensure (PARASITE_TYPE_CSS_EDITOR);
- g_type_ensure (PARASITE_TYPE_BUTTON_PATH);
- g_type_ensure (PARASITE_TYPE_WIDGET_TREE);
- g_type_ensure (PARASITE_TYPE_PROP_LIST);
- g_type_ensure (PARASITE_TYPE_OBJECT_HIERARCHY);
- g_type_ensure (PARASITE_TYPE_CLASSES_LIST);
- g_type_ensure (PARASITE_TYPE_PYTHON_SHELL);
- g_type_ensure (PARASITE_TYPE_PROPERTY_CELL_RENDERER);
-
return GTK_WIDGET (g_object_new (PARASITE_TYPE_WINDOW, NULL));
}
diff --git a/modules/other/parasite/window.ui b/modules/other/parasite/window.ui
index 5de9238bfc..5f71470ce6 100644
--- a/modules/other/parasite/window.ui
+++ b/modules/other/parasite/window.ui
@@ -23,7 +23,6 @@
<template class="ParasiteWindow" parent="GtkWindow">
<property name="default-height">500</property>
<property name="default-width">1000</property>
- <signal name="delete-event" handler="delete_window"/>
<child type="titlebar">
<object class="GtkHeaderBar">
<property name="visible">True</property>