Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank window on macOS 10.14 #887

Closed
wizardfrag opened this issue Sep 6, 2018 · 28 comments
Closed

Blank window on macOS 10.14 #887

wizardfrag opened this issue Sep 6, 2018 · 28 comments

Comments

@wizardfrag
Copy link

Hi,

I've installed kitty using the bash script, however once it started it presented me with a blank window as below:
image 2018-09-06 16 22 20

Interacting with the terminal (such as by typing say Hello world) works, however nothing is output to the screen. I'm not sure if this is an issue with kitty or with macOS 10.14, but it would be nice to use this!

Required info

kitty version: 0.12.0
macOS version: 10.14 Beta (18A384a)
kitty config: default as installed by bash script

@kovidgoyal
Copy link
Owner

sorry, I dont have the resources to support beta OSes. I can tell you that kitty works fine with 10.13.

Make sure that the text is not just invisible because the foreground color is the same as the background color. (You can drag witht he mouse to selelct which should test that).

@wizardfrag
Copy link
Author

That's fine, I understand that.

Is there any way I can try to debug this myself?

@kovidgoyal
Copy link
Owner

As I said, the first step is to check if it si a color problem. Assuming it isn't run kitty from the command like with the --debug-gl flag and see if it reports any errors. Also check console.app for any error messages.

@wizardfrag
Copy link
Author

Ah I thought I'd mentioned that I tried selecting text... --debug-gl doesn't show anything, however moving/resizing the window around causes it to start rendering... I'll close this for now...

@kovidgoyal
Copy link
Owner

See if the following patch helps:

diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c
index 063baa0a..6a0b7bb1 100644
--- a/kitty/child-monitor.c
+++ b/kitty/child-monitor.c
@@ -769,6 +769,12 @@ static PyObject*
 main_loop(ChildMonitor *self, PyObject *a UNUSED) {
 #define main_loop_doc "The main thread loop"
     bool has_open_windows = true;
+#ifdef __APPLE__
+    if (global_state.has_pending_resizes) process_pending_resizes(now);
+    render(now);
+    wakeup_main_loop();
+    wait_for_events();
+#endif
 
     while (has_open_windows) {
         double now = monotonic();

@nthapaliya
Copy link

I tried the patch. It doesn't compile.

@wizardfrag
Copy link
Author

I've gotten it to compile by adding double now = monotonic() after the #ifdef and compiling using CFLAGS=-Wno-error make however it still doesn't seem to render...

Without the CFLAGS it complains that a lot of the calls from glfw are deprecated... I can provide logs if necessary?

@kovidgoyal
Copy link
Owner

Well that was just a shot in the dark. Apple has deprecated OpenGL so that's not a surprise.

@kovidgoyal
Copy link
Owner

Well now that mojave has been released officially, I am re-opening. Sadly I wont have access o my mac for another day or two, so I dont know if the issue is still present.

@kovidgoyal kovidgoyal reopened this Sep 24, 2018
@zackangelo
Copy link

Can confirm that the issue is still present in the Mojave GA release.

@wy15
Copy link

wy15 commented Sep 25, 2018

The issue is still present in the release.

@kovidgoyal
Copy link
Owner

Well, I will look into figuring out what apple broke in a few days when I have access to my mac again

@wy15
Copy link

wy15 commented Sep 25, 2018

screen shot 2018-09-25 at 11 20 13

@kovidgoyal
Copy link
Owner

In the meantime, for anybody that wants to experiment themselves, since we know that a resize causes rendering to start behaving normally, you just need to see what happens in the resize code path and do that once at startup. The relevant functions are framebuffer_size_callback and update_os_window_viewport

@erf
Copy link

erf commented Sep 25, 2018

it seem to work as normal if background_opacity is set to less than 1.

@net
Copy link

net commented Sep 25, 2018

Possibly related: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31904

@d53dave
Copy link

d53dave commented Sep 26, 2018

it seem to work as normal if background_opacity is set to less than 1.

I have just tried this but it didn't fix the issue for me.

Also possibly related: if I try to start it from the command line, I get the following error twice:

[269 12:19:21.314076] [PARSE ERROR] Unknown OSC code: 7

@kovidgoyal
Copy link
Owner

An update. Either moving or resizing the window will cause it to draw. I looked into what happens on a move and basically commenting out the line:

[window->context.nsgl.object update]

in windowDidMove causes moving to not cause correct rendering. So obviously we now need to call update ont he context object. The problem is I am not sure where is a good place to do that. Doing it in the constructor or the call to showwindow does not work. So I suppose it will simply have to be called once per window on first render. Which will need a new native call api in glfw, sigh.

@jameswritescode
Copy link

Will there be a release with this fix soon / documented way to generate a new dmg from source?

@kovidgoyal
Copy link
Owner

there already is a documented way to build the app from source https://sw.kovidgoyal.net/kitty/build.html

@kovidgoyal
Copy link
Owner

https://sw.kovidgoyal.net/kitty/faq.html#how-do-i-build-kitty-app-on-macos

@jameswritescode
Copy link

Thanks!

@kovidgoyal
Copy link
Owner

changing the NSView into a layer backed view is likely to have performance implications or other side-effects, seem safer to just call NSOpenGLContext update a couple of times at startup.

@elnormous
Copy link

Yes, I agree. I did some more debugging and disassembling and came to a solution. I posted the results here: https://stackoverflow.com/questions/52938516/opengl-not-rendering-on-macos-mojave/52938517#52938517
Basically, you have to update the NSOpenGLContext in NSView's setLayer: method because OpenGL is rendered in a layer on Mojave even if you explicitly disable it by setting wantsLayer to NO.
Here is my commit to the Ouzel engine: elnormous/ouzel@7e70863

@kovidgoyal
Copy link
Owner

yeah that works well

@Tagar
Copy link

Tagar commented Nov 4, 2019

I have similar issue not only on macOS, but on Windows as well.
Blank screen first, and when window is resized, it renders fine again.

@Luflosi
Copy link
Contributor

Luflosi commented Nov 4, 2019

kitty does not run on Windows. I think you're talking about a different project, possibly KiTTY.

@Tagar
Copy link

Tagar commented Nov 4, 2019

@Luflosi you're right, created cyd01/KiTTY#67 instead
sorry for the confusion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests