fix: blank screen on macOS resume from sleep - #9520
Merged
Merged
Conversation
Owner
|
Would it work to just not draw (aka return early) in the out of sequence render function when the framebuffer is not ready. Presumably if we do that, eventually macOS will repair the framebuffer? If not then it should use the context creation code in nsgl_context.m so as to avoid code duplication and ensure the new context is created with all the correct properties. |
Author
|
do you mean something like this? diff --git a/kitty/glfw.c b/kitty/glfw.c
index 846e51900..4ae5d3b7e 100644
--- a/kitty/glfw.c
+++ b/kitty/glfw.c
@@ -346,6 +346,12 @@ window_iconify_callback(GLFWwindow *window, int iconified) {
static void
cocoa_out_of_sequence_render(OSWindow *window) {
make_os_window_context_current(window);
+ GLenum fb_status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ if (fb_status != GL_FRAMEBUFFER_COMPLETE) {
+ window->needs_render = true;
+ request_tick_callback();
+ return;
+ }
window->needs_render = true;
bool rendered = false;
if (window->fonts_data->sprite_map) rendered = render_os_window(window, monotonic(), true);This was my first attempt, but that didn't work unfortunately :/ |
Author
👀 I'll try this |
Owner
|
On Wed, Feb 18, 2026 at 03:09:55AM -0800, Jorge Silva wrote:
This was my first attempt, but that didn't work unfortunately :/
Yes, that's what I meant. OK if it doesnt work then your approach looks
OK, modulo the point about re-using as much existing context creation code
as possible.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.