Dont offset title from left edge

This commit is contained in:
Kovid Goyal 2021-04-01 18:19:59 +05:30
parent 779a06fa72
commit b7d967b6bc
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -55,7 +55,7 @@ render_title_bar(_GLFWwindow *window, bool to_front_buffer) {
uint8_t *output = to_front_buffer ? decs.top.buffer.data.front : decs.top.buffer.data.back;
if (window->wl.title && window->wl.title[0] && _glfw.callbacks.draw_text) {
uint32_t fg_color = is_focused ? 0xff444444 : 0xff888888;
if (_glfw.callbacks.draw_text((GLFWwindow*)window, window->wl.title, fg_color, bg_color, output, decs.top.buffer.width, decs.top.buffer.height, 10, 0)) return;
if (_glfw.callbacks.draw_text((GLFWwindow*)window, window->wl.title, fg_color, bg_color, output, decs.top.buffer.width, decs.top.buffer.height, 0, 0)) return;
}
for (uint32_t *px = (uint32_t*)output, *end = (uint32_t*)(output + decs.top.buffer.size_in_bytes); px < end; px++) {
*px = bg_color;
@ -119,8 +119,10 @@ create_shm_buffers(_GLFWwindow* window) {
void
free_csd_surfaces(_GLFWwindow *window) {
#define d(which) {\
if (decs.which.subsurface) wl_subsurface_destroy(decs.which.subsurface); decs.which.subsurface = NULL; \
if (decs.which.surface) wl_surface_destroy(decs.which.surface); decs.which.surface = NULL; \
if (decs.which.subsurface) wl_subsurface_destroy(decs.which.subsurface); \
decs.which.subsurface = NULL; \
if (decs.which.surface) wl_surface_destroy(decs.which.surface); \
decs.which.surface = NULL; \
}
d(left); d(top); d(right); d(bottom);
#undef d