#include <ev.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <iconv.h>
#include <signal.h>
#include <xcb/xcb.h>
#include <xcb/xcb_aux.h>
#include <xcb/xcb_event.h>
#include <xcb/xcb_keysyms.h>
#include <X11/keysym.h>
#include "all.h"
Go to the source code of this file.
Functions | |
static int | sig_draw_window (xcb_window_t win, int width, int height, int font_height) |
static int | sig_handle_key_press (void *ignored, xcb_connection_t *conn, xcb_key_press_event_t *event) |
static xcb_window_t | open_input_window (xcb_connection_t *conn, Rect screen_rect, uint32_t width, uint32_t height) |
void | handle_signal (int sig, siginfo_t *info, void *data) |
void | setup_signal_handler () |
Setup signal handlers to safely handle SIGSEGV and SIGFPE. | |
Variables | |
static xcb_gcontext_t | pixmap_gc |
static xcb_pixmap_t | pixmap |
static int | raised_signal |
static char * | crash_text [] |
static int | crash_text_longest = 5 |
void handle_signal | ( | int | sig, | |
siginfo_t * | info, | |||
void * | data | |||
) |
Definition at line 149 of file sighandler.c.
References xoutput::active, config, conn, convert_utf8_to_ucs2(), crash_text, crash_text_longest, DLOG, Config::font, Font::height, Font::id, open_input_window(), outputs, pixmap, pixmap_gc, predict_text_width(), raised_signal, xoutput::rect, root_depth, sig_draw_window(), sig_handle_key_press(), TAILQ_FOREACH, and xcb_change_gc_single().
Referenced by setup_signal_handler().
static xcb_window_t open_input_window | ( | xcb_connection_t * | conn, | |
Rect | screen_rect, | |||
uint32_t | width, | |||
uint32_t | height | |||
) | [static] |
Definition at line 110 of file sighandler.c.
References Rect::height, root, Rect::width, Rect::x, Rect::y, and y.
Referenced by handle_signal().
void setup_signal_handler | ( | ) |
Setup signal handlers to safely handle SIGSEGV and SIGFPE.
Definition at line 211 of file sighandler.c.
References ELOG, and handle_signal().
Referenced by main().
static int sig_draw_window | ( | xcb_window_t | win, | |
int | width, | |||
int | height, | |||
int | font_height | |||
) | [static] |
Definition at line 49 of file sighandler.c.
References conn, convert_utf8_to_ucs2(), crash_text, get_colorpixel(), pixmap, pixmap_gc, and xcb_change_gc_single().
Referenced by handle_signal().
static int sig_handle_key_press | ( | void * | ignored, | |
xcb_connection_t * | conn, | |||
xcb_key_press_event_t * | event | |||
) | [static] |
Definition at line 81 of file sighandler.c.
References DLOG, i3_restart(), keysyms, raised_signal, and xcb_numlock_mask.
Referenced by handle_signal().
char* crash_text[] [static] |
{ "i3 just crashed.", "To debug this problem, either attach gdb now", "or press", "- 'e' to exit and get a core-dump,", "- 'r' to restart i3 in-place or", "- 'f' to forget the current layout and restart" }
Definition at line 35 of file sighandler.c.
Referenced by handle_signal(), and sig_draw_window().
int crash_text_longest = 5 [static] |
Definition at line 43 of file sighandler.c.
Referenced by handle_signal().
xcb_pixmap_t pixmap [static] |
Definition at line 32 of file sighandler.c.
Referenced by handle_signal(), and sig_draw_window().
xcb_gcontext_t pixmap_gc [static] |
Definition at line 31 of file sighandler.c.
Referenced by handle_signal(), and sig_draw_window().
int raised_signal [static] |
Definition at line 33 of file sighandler.c.
Referenced by handle_signal(), and sig_handle_key_press().