From 092f3e497447eee1ae159cd7203846b5b91ae9b8 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Fri, 27 Mar 2009 02:23:13 +0000 Subject: [PATCH] turn off composite on segfault. one of the most annoying problems while using bling is that when E segfaults it will launch an alert window, but since composite manager is using the same process/connection as e17, it will not die and e will not compose as required, so you basically end with a black screen. this patch will forcely turn off manual redirection and you'll get the white-screen-of-death, being able to restart e17. future: if we really do composite in e18, then please handle this in a better way. SVN revision: 39741 --- src/bin/e_signals.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/bin/e_signals.c b/src/bin/e_signals.c index 52650ceac..0b7890b63 100644 --- a/src/bin/e_signals.c +++ b/src/bin/e_signals.c @@ -5,6 +5,25 @@ * to add backtrace support. */ #include "e.h" +#include + +static volatile Eina_Bool _e_x_composite_shutdown_try = 0; +static void +_e_x_composite_shutdown(void) +{ + Ecore_X_Display *dpy; + Ecore_X_Window root; + + if (_e_x_composite_shutdown_try) return; /* we failed :-( */ + _e_x_composite_shutdown_try = 1; + + dpy = ecore_x_display_get(); + root = DefaultRootWindow(dpy); + + /* ignore errors, we really don't care at this point */ + ecore_x_composite_unredirect_subwindows(root, ECORE_X_COMPOSITE_UPDATE_MANUAL); + _e_x_composite_shutdown_try = 0; +} #ifdef OBJECT_PARANOIA_CHECK @@ -21,6 +40,7 @@ e_sigseg_act(int x, siginfo_t *info, void *data) write(2, "**** Printing Backtrace... *****\n\n", 34); size = backtrace(array, 255); backtrace_symbols_fd(array, size, 2); + _e_x_composite_shutdown(); ecore_x_pointer_ungrab(); ecore_x_keyboard_ungrab(); ecore_x_ungrab(); @@ -41,6 +61,7 @@ EAPI void e_sigseg_act(int x, siginfo_t *info, void *data) { write(2, "**** SEGMENTATION FAULT ****\n", 29); + _e_x_composite_shutdown(); ecore_x_pointer_ungrab(); ecore_x_keyboard_ungrab(); ecore_x_ungrab(); @@ -62,6 +83,7 @@ EAPI void e_sigill_act(int x, siginfo_t *info, void *data) { write(2, "**** ILLEGAL INSTRUCTION ****\n", 30); + _e_x_composite_shutdown(); ecore_x_pointer_ungrab(); ecore_x_keyboard_ungrab(); ecore_x_ungrab(); @@ -82,6 +104,7 @@ EAPI void e_sigfpe_act(int x, siginfo_t *info, void *data) { write(2, "**** FLOATING POINT EXCEPTION ****\n", 35); + _e_x_composite_shutdown(); ecore_x_pointer_ungrab(); ecore_x_keyboard_ungrab(); ecore_x_ungrab(); @@ -102,6 +125,7 @@ EAPI void e_sigbus_act(int x, siginfo_t *info, void *data) { write(2, "**** BUS ERROR ****\n", 21); + _e_x_composite_shutdown(); ecore_x_pointer_ungrab(); ecore_x_keyboard_ungrab(); ecore_x_ungrab(); @@ -122,6 +146,7 @@ EAPI void e_sigabrt_act(int x, siginfo_t *info, void *data) { write(2, "**** ABORT ****\n", 21); + _e_x_composite_shutdown(); ecore_x_pointer_ungrab(); ecore_x_keyboard_ungrab(); ecore_x_ungrab();