From 0ea7392729d9f7f12898b049117ad2fd61898598 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Thu, 27 Sep 2012 23:23:55 +0200 Subject: xcbviewfs: larger screen, black background, remove bg from gc --- xcbviewfs.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/xcbviewfs.c b/xcbviewfs.c index 157d68d..1e5933a 100644 --- a/xcbviewfs.c +++ b/xcbviewfs.c @@ -74,14 +74,15 @@ int main(int argc, char **argv) { win = xcb_generate_id(c); /* For each mask, need to add valwin item in order as defined by the * enum, see See http://xcb.freedesktop.org/tutorial/events/ */ - uint32_t mask = XCB_CW_EVENT_MASK; + uint32_t mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK; uint32_t valwin[] = { + screen->black_pixel, XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_KEY_PRESS, }; xcb_create_window(c, 0, win, /* conn, depth, WinID */ screen->root, /* parent */ 0, 0, /* x y */ - 100, 100, /* width height */ + screen->width_in_pixels, screen->height_in_pixels, 0, /* border_width */ XCB_WINDOW_CLASS_INPUT_OUTPUT, /* class */ screen->root_visual, @@ -172,11 +173,7 @@ int main(int argc, char **argv) { xcb_create_pixmap(c, 24, pmap, win, image_width, image_height); gc = xcb_generate_id(c); - uint32_t mask = XCB_GC_BACKGROUND; - uint32_t value_list[] = { - screen->black_pixel - }; - xcb_create_gc(c, gc, pmap, mask, value_list); + xcb_create_gc(c, gc, pmap, 0, NULL); xcb_image_put(c, pmap, gc, img, 0, 0, 0); xcb_flush(c); -- cgit v1.2.1