# macOS 10.14 (Mojave) issues

**URL:** <https://discourse.libsdl.org/t/macos-10-14-mojave-issues/25060>\
**Category:** SDL Development\
**Created:** [September 25, 2018, 9:47pm UTC](https://discourse.libsdl.org/t/macos-10-14-mojave-issues/25060 "2018-09-25T21:47:18Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![blacktm](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/blacktm/32/2704_2.png) [@blacktm](https://discourse.libsdl.org/u/blacktm)\
**Post date:** [September 25, 2018, 9:47pm UTC](https://discourse.libsdl.org/t/macos-10-14-mojave-issues/25060/1 "2018-09-25T21:47:18Z")

</div>

Hi everyone. I’m testing SDL’s default branch on Mojave and noticing a weird glitch. The window appears just fine, but is empty (black) _until_ you move (e.g. drag title bar with cursor) or resize the window. Basically, it seems like the entire OpenGL context isn’t being rendered until some window action takes place to force it — even `glClearColor()` has no effect until the window interaction. So far, I’ve seen the same results in the tests `testdraw2.c` and `testshader.c`, and also in [my 2D engine](https://github.com/simple2d/simple2d) with custom GL2.1 and GL3.3 forward-compatible backends. I’m happy to dig in further to troubleshoot (been looking for an opportunity to contribute back), but wanted to post here to see if anyone has some initial ideas or areas to investigate. Thanks!

---

<div class="post-metadata">

**Author:** ![blacktm](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/blacktm/32/2704_2.png) [@blacktm](https://discourse.libsdl.org/u/blacktm)\
**Post date:** [September 25, 2018, 11:02pm UTC](https://discourse.libsdl.org/t/macos-10-14-mojave-issues/25060/2 "2018-09-25T23:02:05Z")

</div>

Ok, I’ve done some naïve testing and found that in `testshader.c`, if I put a…

```auto
SDL_PumpEvents();
SDL_SetWindowSize(window, width, height);

```

…_after_ the call to `SDL_GL_CreateContext(window)`, the OpenGL contents will appear. Very interesting. 🧐

---

<div class="post-metadata">

**Author:** ![DanB91](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/d/b77776/32.png) [@DanB91](https://discourse.libsdl.org/u/DanB91)\
**Post date:** [September 26, 2018, 4:08am UTC](https://discourse.libsdl.org/t/macos-10-14-mojave-issues/25060/3 "2018-09-26T04:08:55Z")

</div>

I currently have this issue with my application as well.

To add to this, my application has 2 SDL windows, one that just uses the SDL\_Renderer and one that uses an explicit OpenGL context. The OpenGL window can be opened optionally and renders on a separate thread. This worked fine on High Sierra, but now with Mojave, whenever I open this window now, the entire program freezes. Stepping through the debugger during these freezes works fine at first glance.

Haven’t figured out a way around this yet.

---

<div class="post-metadata">

**Author:** ![Gred](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/13edae/32.png) [@Gred](https://discourse.libsdl.org/u/Gred)\
**Post date:** [September 26, 2018, 4:57pm UTC](https://discourse.libsdl.org/t/macos-10-14-mojave-issues/25060/4 "2018-09-26T16:57:21Z")

</div>

Same problem for me. As a temporary solution I’ve added  
[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(scheduleUpdate) userInfo:nil repeats:NO];  
at the end of - (void)setWindow:(SDL\_Window \*)newWindow method in video/cocoa/SDL\_cocoaopengl.m

---

<div class="post-metadata">

**Author:** ![Gred](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/13edae/32.png) [@Gred](https://discourse.libsdl.org/u/Gred)\
**Post date:** [September 26, 2018, 5:03pm UTC](https://discourse.libsdl.org/t/macos-10-14-mojave-issues/25060/5 "2018-09-26T17:03:19Z")

</div>

Also I had a problem with wrong OpenGL scissor coordinates. Method static int GL\_UpdateClipRect(SDL\_Renderer \* renderer) in render/opengl/SDL\_render\_gl.c doesn’t works correctly after updating to Mojave.  
SDL\_GL\_GetDrawableSize(renderer-\>window, &w, &h); now returns double size for drawable dimensions when launched on HiDPI screen, so scissor coordinates become broken and nothing is displayed on screen. Probably it is not a problem with SDL, but problem with SDL usage in my code, but same code worked fine in High Sierra.

---

<div class="post-metadata">

**Author:** ![David\_Ludwig](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/david_ludwig/32/4016_2.png) [@David\_Ludwig](https://discourse.libsdl.org/u/David_Ludwig)\
**Post date:** [September 27, 2018, 12:36am UTC](https://discourse.libsdl.org/t/macos-10-14-mojave-issues/25060/6 "2018-09-27T00:36:34Z")

</div>

Here are a few, logistically-inclined notes on this, posted for posterity, and perhaps convenience:

Two bugs (at least) have been filed against this:

- [https://bugzilla.libsdl.org/show\_bug.cgi?id=4272](https://bugzilla.libsdl.org/show_bug.cgi?id=4272)
- [https://bugzilla.libsdl.org/show\_bug.cgi?id=4274](https://bugzilla.libsdl.org/show_bug.cgi?id=4274)

Ryan (icculus) has posted at least one fix so far, which is how up on SDL HG, specifically at [https://hg.libsdl.org/SDL/rev/55489adbb75c](https://hg.libsdl.org/SDL/rev/55489adbb75c)

---

<div class="post-metadata">

**Author:** ![Dominus](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/dominus/32/2730_2.png) [@Dominus](https://discourse.libsdl.org/u/Dominus)\
**Post date:** [October 9, 2018, 8:01pm UTC](https://discourse.libsdl.org/t/macos-10-14-mojave-issues/25060/7 "2018-10-09T20:01:48Z")

</div>

I’ve read a report about it being a problem for SDL 1.2x as well

---

<div class="post-metadata">

**Author:** ![icculus](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/icculus/32/81_2.png) [@icculus](https://discourse.libsdl.org/u/icculus)\
**Post date:** [October 11, 2018, 2:24am UTC](https://discourse.libsdl.org/t/macos-10-14-mojave-issues/25060/8 "2018-10-11T02:24:16Z")

</div>

> [@Dominus](#):
>
> I’ve read a report about it being a problem for SDL 1.2x as well

Once we wrestle this to the ground in SDL2, I assume a 1.2 fix will be straightforward enough.

---

<div class="post-metadata">

**Author:** ![henrikno](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/henrikno/32/3594_2.png) [@henrikno](https://discourse.libsdl.org/u/henrikno)\
**Post date:** [January 7, 2019, 1:14am UTC](https://discourse.libsdl.org/t/macos-10-14-mojave-issues/25060/9 "2019-01-07T01:14:05Z")

</div>

FWIW, my app stopped working in Mojave and failed on either glClear (when checking glGetError) or GL\_FRAMEBUFFER\_UNDEFINED (when checking glCheckFramebufferStatus) when switching to framebuffer 0 (default), but I built latest SDL from source (dbdc76) and my application works there.

---

<div class="post-metadata">

**Author:** ![Dominus](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/dominus/32/2730_2.png) [@Dominus](https://discourse.libsdl.org/u/Dominus)\
**Post date:** [March 23, 2020, 7:38pm UTC](https://discourse.libsdl.org/t/macos-10-14-mojave-issues/25060/10 "2020-03-23T19:38:42Z")

</div>

@icculus has there been a fix for SDL 1.2 yet? I’m kind of desperate for one 🙂

---

<div class="post-metadata">

**Author:** ![Dominus](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/dominus/32/2730_2.png) [@Dominus](https://discourse.libsdl.org/u/Dominus)\
**Post date:** [April 5, 2020, 5:40pm UTC](https://discourse.libsdl.org/t/macos-10-14-mojave-issues/25060/11 "2020-04-05T17:40:39Z")

</div>

first testing seems to indicate that [https://hg.libsdl.org/SDL/rev/ab7529cb9558](https://hg.libsdl.org/SDL/rev/ab7529cb9558) fixed it
