Skip to content

Commit

Permalink
More work on getting layer to actually render
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Mar 25, 2024
1 parent 46db1f7 commit d56fbb8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion glfw/wl_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,11 @@ static void
layer_surface_handle_configure(void* data, struct zwlr_layer_surface_v1* surface, uint32_t serial, uint32_t width, uint32_t height) {
debug("Layer shell configure event: width: %u height: %u\n", width, height);
_GLFWwindow* window = data;
if (!window->wl.surface_configured_once) {
window->swaps_disallowed = false;
window->wl.waiting_for_swap_to_commit = true;
window->wl.surface_configured_once = true;
}
GLFWvidmode m = {0};
if (window->wl.monitorsCount) _glfwPlatformGetVideoMode(window->wl.monitors[0], &m);
window->wl.layer_shell.config.size_callback(
Expand All @@ -806,8 +811,8 @@ layer_surface_handle_configure(void* data, struct zwlr_layer_surface_v1* surface
_glfwInputWindowSize(window, width, height);
window->wl.width = width; window->wl.height = height;
resizeFramebuffer(window);
_glfwInputWindowDamage(window);
}
_glfwInputWindowDamage(window);
commit_window_surface_if_safe(window);
}

Expand Down
2 changes: 2 additions & 0 deletions kitty/glfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,7 @@ edge_spacing(GLFWEdge which) {
static void
calculate_layer_shell_window_size(
GLFWwindow *window, const GLFWLayerShellConfig *config, unsigned monitor_width, unsigned monitor_height, uint32_t *width, uint32_t *height) {
request_tick_callback();
if (config->type == GLFW_LAYER_SHELL_BACKGROUND) {
if (!*width) *width = monitor_width;
if (!*height) *height = monitor_height;
Expand Down Expand Up @@ -1332,6 +1333,7 @@ create_os_window(PyObject UNUSED *self, PyObject *args, PyObject *kw) {
// macOS: Show the window after it is ready
glfwShowWindow(glfw_window);
#endif
w->is_damaged = true;
return PyLong_FromUnsignedLongLong(w->id);
}

Expand Down

0 comments on commit d56fbb8

Please sign in to comment.