Fix some a quick crash bug

This commit is contained in:
Kevin Lange 2012-12-10 00:29:04 -08:00
parent 21214256d7
commit e5e67c6410
3 changed files with 6 additions and 3 deletions

View File

@ -223,6 +223,7 @@ int main(int argc, char ** argv) {
window = window_create(10,10, 2 * WINDOW_SIZE, 2 * WINDOW_SIZE);
ctx = init_graphics_window_double_buffer(window);
draw_fill(ctx,rgb(0,0,0));
flip(ctx);
init_decorations();
focus_changed_callback = focus_callback;

View File

@ -68,7 +68,7 @@ void init_decorations() {
}
void render_decorations_(window_t * window, gfx_context_t * ctx, char * title, int decors_active) {
static void render_decorations_(window_t * window, gfx_context_t * ctx, char * title, int decors_active) {
int width = window->width;
int height = window->height;
@ -120,6 +120,7 @@ void render_decorations_(window_t * window, gfx_context_t * ctx, char * title, i
}
void render_decorations(window_t * window, gfx_context_t * ctx, char * title) {
if (!window) return;
if (!window->focused) {
render_decorations_(window, ctx, title, INACTIVE);
} else {
@ -128,6 +129,7 @@ void render_decorations(window_t * window, gfx_context_t * ctx, char * title) {
}
void render_decorations_inactive(window_t * window, gfx_context_t * ctx, char * title) {
if (!window) return;
render_decorations_(window, ctx, title, INACTIVE);
}

View File

@ -569,11 +569,11 @@ int setup_windowing () {
process_windows->windows = list_create();
}
install_signal_handlers();
event_pipe = syscall_mkpipe();
mouse_event_pipe = syscall_mkpipe();
install_signal_handlers();
return wins_connect();
}