From 4d8a8e846cb954c8e6f546cbde2f7f8ebb8c8ca2 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 12 Jan 2024 00:02:33 +0100 Subject: Dont draw wallpaper for now --- src/compositor.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/compositor.c b/src/compositor.c index c6b2059..29d3c15 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -100,7 +100,7 @@ void ngxc_compositor_add_window(ngxc_compositor *self, Window window) { window_obj->y = xattr.y; self->num_windows++; - fprintf(stderr, "ADDED WINDOW: %ld, x: %d, y: %d\n", window, xattr.x, xattr.y); + fprintf(stderr, "ADDED WINDOW (#%d): %ld, x: %d, y: %d\n", self->num_windows, window, xattr.x, xattr.y); } static void ngxc_compositor_remove_window_index(ngxc_compositor *self, int window_index) { @@ -178,13 +178,13 @@ static void render_texture(GLuint texture_id, int x, int y, int width, int heigh } /* TODO: Skip windows that are not visible on the screen */ -/* TODO: Disable compositing for fullscreen windows, if that option is enabled */ +/* TODO: Disable compositing for fullscreen windows, if that option is enabled. Or only draw the fullscreen window */ void ngxc_compositor_render(ngxc_compositor *self) { glClearColor(0.5f, 0.5f, 0.5f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); if(self->wallpaper_texture.texture_id > 0) { - render_texture(self->wallpaper_texture.texture_id, 0, 0, self->wallpaper_texture.width, self->wallpaper_texture.height); + //render_texture(self->wallpaper_texture.texture_id, 0, 0, self->wallpaper_texture.width, self->wallpaper_texture.height); } for(int i = 0; i < self->num_windows; ++i) { @@ -201,7 +201,7 @@ void ngxc_compositor_render(ngxc_compositor *self) { glFinish(); const double time_limit = 1.0f / 60.0f; // TODO: Get from randr. This might not be a good way to do this when using multiple monitors with different refresh rate and opengl is synced to one monitor - const double delayed_update = time_limit - frame_duration - 0.003; + const double delayed_update = time_limit - frame_duration - 0.002; //fprintf(stderr, "delayed update: %f\n", delayed_update); if(delayed_update > 0.0) usleep(delayed_update * 1000000.0); -- cgit v1.2.3