diff --git a/docs/changelog.rst b/docs/changelog.rst index 1d2a9c2be..2dcb44fea 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -20,6 +20,9 @@ To update |kitty|, :doc:`follow the instructions `. - macOS: Fix a regression that caused :kbd:`cmd+v` to double up in the dvorak keyboard layout (:iss:`1652`) +- When resizing and only a single window is present in the current layout, + use that window's background color to fill in the blank areas. + 0.14.0 [2019-05-24] --------------------- diff --git a/kitty/glfw.c b/kitty/glfw.c index 43db6c147..10504351b 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -103,7 +103,18 @@ static int min_width = 100, min_height = 100; void blank_os_window(OSWindow *w) { - blank_canvas(w->is_semi_transparent ? w->background_opacity : 1.0f); + color_type color = OPT(background); + if (w->num_tabs > 0) { + Tab *t = w->tabs + w->active_tab; + if (t->num_windows == 1) { + Window *w = t->windows + t->active_window; + Screen *s = w->render_data.screen; + if (s) { + color = colorprofile_to_color(s->color_profile, s->color_profile->overridden.default_bg, s->color_profile->configured.default_bg); + } + } + } + blank_canvas(w->is_semi_transparent ? w->background_opacity : 1.0f, color); } static void @@ -513,7 +524,7 @@ create_os_window(PyObject UNUSED *self, PyObject *args) { bool is_semi_transparent = glfwGetWindowAttrib(glfw_window, GLFW_TRANSPARENT_FRAMEBUFFER); // blank the window once so that there is no initial flash of color // changing, in case the background color is not black - blank_canvas(is_semi_transparent ? OPT(background_opacity) : 1.0f); + blank_canvas(is_semi_transparent ? OPT(background_opacity) : 1.0f, OPT(background)); #ifndef __APPLE__ if (is_first_window) glfwSwapInterval(OPT(sync_to_monitor) && !global_state.is_wayland ? 1 : 0); #endif diff --git a/kitty/shaders.c b/kitty/shaders.c index 943239413..404ccd208 100644 --- a/kitty/shaders.c +++ b/kitty/shaders.c @@ -476,8 +476,8 @@ set_cell_uniforms(float current_inactive_text_alpha) { } void -blank_canvas(float background_opacity) { -#define C(shift) (((GLfloat)((OPT(background) >> shift) & 0xFF)) / 255.0f) +blank_canvas(float background_opacity, color_type color) { +#define C(shift) (((GLfloat)((color >> shift) & 0xFF)) / 255.0f) glClearColor(C(16), C(8), C(0), background_opacity); #undef C glClear(GL_COLOR_BUFFER_BIT); diff --git a/kitty/state.h b/kitty/state.h index 5d8365581..30e3a481e 100644 --- a/kitty/state.h +++ b/kitty/state.h @@ -214,7 +214,7 @@ void update_surface_size(int, int, uint32_t); void free_texture(uint32_t*); void send_image_to_gpu(uint32_t*, const void*, int32_t, int32_t, bool, bool); void send_sprite_to_gpu(FONTS_DATA_HANDLE fg, unsigned int, unsigned int, unsigned int, pixel*); -void blank_canvas(float); +void blank_canvas(float, color_type); void blank_os_window(OSWindow *); void set_titlebar_color(OSWindow *w, color_type color); FONTS_DATA_HANDLE load_fonts_data(double, double, double);