libdraw

Minimal window and drawing library
git clone http://git.omkov.net/libdraw
Log | Tree | Refs | Download

AuthorJakob Wakeling <[email protected]>
Date2024-03-16 05:12:38
Commit62f7b776ad20c7b9628cc79f896725a69420839e
Parent0c1b980371b5318e4b136d5a58328b17cf2b60c9

Replace CW_BACK_PIXEL to fix resize flicker

Diffstat

M src/x11/draw.c | 8 ++++----

1 files changed, 4 insertions, 4 deletions

diff --git a/src/x11/draw.c b/src/x11/draw.c
index d65ff0f..5ef86c5 100644
--- a/src/x11/draw.c
+++ b/src/x11/draw.c
@@ -47,12 +47,12 @@ int draw_window_init(draw_window **window, int32_t w, int32_t h, const char *tit
 	(*window)->window = xcb_generate_id((*window)->connection);
 	if ((*window)->window == -1) { xcb_disconnect((*window)->connection); return -1; }
 
-	uint32_t mask = XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL | XCB_CW_EVENT_MASK | XCB_CW_COLORMAP;
+	uint32_t mask = XCB_CW_BACK_PIXMAP | XCB_CW_BORDER_PIXEL | XCB_CW_EVENT_MASK | XCB_CW_COLORMAP;
 	uint32_t values[4] = {
-		0x00000000, 0x00000000,
+		0, 0,
 		XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE | XCB_EVENT_MASK_BUTTON_PRESS |
-		XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY |
-		XCB_EVENT_MASK_BUTTON_MOTION
+		XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_BUTTON_MOTION | XCB_EVENT_MASK_EXPOSURE |
+		XCB_EVENT_MASK_STRUCTURE_NOTIFY, XCB_VISUAL_CLASS_TRUE_COLOR
 	};
 
 	/**/