diff options
Diffstat (limited to 'src/screen.c')
-rw-r--r-- | src/screen.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/screen.c b/src/screen.c index 6446357..762ecbc 100644 --- a/src/screen.c +++ b/src/screen.c @@ -49,7 +49,7 @@ static void init_x() { memset(key_checked, 0, sizeof(bool) * key_count); } -static Window create_window(int x, int y, int w, int h, int d) { +static Window create_window(int x, int y, int w, int h, int d, const char* t) { XVisualInfo vis_info; if(!XMatchVisualInfo(dpy, scr, d, TrueColor, &vis_info)) { @@ -68,6 +68,8 @@ static Window create_window(int x, int y, int w, int h, int d) { long wm = CWBackPixel | CWColormap | CWBorderPixel | CWEventMask; Window window = XCreateWindow(dpy, root, x, y, w, h, 0, d, InputOutput, visual, wm, &xwa); + XStoreName(dpy, window, t); + XSetIconName(dpy, window, t); return window; } @@ -88,7 +90,7 @@ static XImage* create_image(int width, int height, void* data) { } -void init_screen(struct Screen* screen, uint16_t width, uint16_t height) { +void init_screen(struct Screen* screen, uint16_t width, uint16_t height, const char* title) { if (dpy == NULL) { init_x(); @@ -103,7 +105,7 @@ void init_screen(struct Screen* screen, uint16_t width, uint16_t height) { screen->pixels = malloc(pixel_count * bit_depth / 8); memset(screen->pixels, 0, pixel_count * bit_depth / 8); - Window window = create_window(0, 0, width, height, bit_depth); + Window window = create_window(0, 0, width, height, bit_depth, title); XMapWindow(dpy, window); Pixmap pixel_map = XCreatePixmap(dpy, window, width, height, bit_depth); |