Technical discussions | Discussions techniques
matttbe, Sunday 18 March 2012 à 16:06
|
|
Subscription date : 24 January 2009
Messages : 12573
|
Hello,
I think it can be interesting to catch the SIGINT signal in order to easily and quickly test modifications or for debugging purposes.
But if we catch this SIGINT signal, we first display a message to say that the dock is trying to quit properly but if there is a problem, the user can send a SIGQUIT signal (Ctrl+\).=== modified file 'src/cairo-dock.c'
--- src/cairo-dock.c 2012-03-07 00:32:00 +0000
+++ src/cairo-dock.c 2012-03-18 14:57:14 +0000
@@ -199,6 +166,13 @@
{
gtk_main_quit ();
}
+static void _cairo_dock_quit_with_message (int signal)
+{
+ g_print ("SIGINT detected (sig %d)\n"
+ "The dock is trying to quit properly.\n"
+ "If you have any problem, you can send a SIGQUIT signal simply by using this shortkey: Ctrl + \\\n", signal);
+ _cairo_dock_quit (signal);
+}
static void _cairo_dock_intercept_signal (int signal)
{
cd_warning ("Cairo-Dock has crashed (sig %d).\nIt will be restarted now.\nFeel free to report this bug on glx-dock.org to help improving the dock!", signal);
@@ -199,8 +210,9 @@
signal (SIGSEGV, _cairo_dock_intercept_signal); signal (SIGFPE, _cairo_dock_intercept_signal); signal (SIGILL, _cairo_dock_intercept_signal); - signal (SIGABRT, _cairo_dock_intercept_signal); - signal (SIGTERM, _cairo_dock_quit); + signal (SIGABRT, _cairo_dock_intercept_signal); + signal (SIGTERM, _cairo_dock_quit); + signal (SIGINT, _cairo_dock_quit_with_message); }
static gboolean on_delete_maintenance_gui (GtkWidget *pWidget, GdkEvent *event, GMainLoop *pBlockingLoop)
@@ -836,6 +867,8 @@
signal (SIGILL, NULL); signal (SIGABRT, NULL);
signal (SIGTERM, NULL);
+ signal (SIGINT, NULL);
+
gldi_free_all ();
rsvg_term ();
|
matttbe, Saturday 07 April 2012 à 02:53
|
|
Subscription date : 24 January 2009
Messages : 12573
|
If it's not possible to use SIGINT to properly quit the dock, another possibility is to use SIGQUIT (Ctrl+\)
=== modified file 'src/cairo-dock.c'
--- src/cairo-dock.c 2012-04-07 00:48:14 +0000
+++ src/cairo-dock.c 2012-04-07 00:48:29 +0000
@@ -161,6 +161,13 @@
{
gtk_main_quit ();
}
+static void _cairo_dock_quit_with_message (int signal)
+{
+ g_print ("SIGQUIT detected (sig %d):\n"
+ " The dock is trying to quit properly.\n"
+ " If you have any problem, you can send a SIGINT signal simply by using this shortkey: Ctrl + C\n\n", signal);
+ _cairo_dock_quit (signal);
+}
static void _cairo_dock_intercept_signal (int signal)
{
cd_warning ("Cairo-Dock has crashed (sig %d).\nIt will be restarted now.\nFeel free to report this bug on glx-dock.org to help improving the dock!", signal);
@@ -201,6 +208,7 @@
signal (SIGILL, _cairo_dock_intercept_signal); signal (SIGABRT, _cairo_dock_intercept_signal); signal (SIGTERM, _cairo_dock_quit); + signal (SIGQUIT, _cairo_dock_quit_with_message); }
static gboolean on_delete_maintenance_gui (GtkWidget *pWidget, GdkEvent *event, GMainLoop *pBlockingLoop)
@@ -837,6 +845,8 @@
signal (SIGILL, NULL); signal (SIGABRT, NULL);
signal (SIGTERM, NULL);
+ signal (SIGQUIT, NULL);
+
gldi_free_all ();
rsvg_term ();
It's only useful for dev and testers but it's a interesting way to quickly and properly quit the dock. The other solution is to use the menu or another terminal to quit and relauch the dock (we can use 'Reboot' DBus command) |
Technical discussions | Discussions techniques
|