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

[macOS] Issues introduced by macOS 10.14 and 10.15 #4109

Open
hrubymar10 opened this issue Jun 8, 2019 · 7 comments

Comments

Projects
None yet
5 participants
@hrubymar10
Copy link
Member

commented Jun 8, 2019

This issue replaces issue #3455

Checklist

  • Issue 1) - "The Battle for Wesnoth" would like to receive keystrokes from any application.
  • Issue 2) - Notarizing - Enable hardened runtime
  • Issue 3) - OpenGL deprecation (Long term issue)

Description of issues introduced by macOS 10.14 and 10.15

1) "The Battle for Wesnoth" would like to receive keystrokes from any application.

Apple added some new privacy monitoring tools to his new macOS 10.15 Catalina. Problem is that for some reason macOS thinks that Wesnoth want's to receive keystrokes (for hotkeys (probably)) even while we aren't inside wesnoth.

This popup appears:
image

This is how System Preferences looks like:
image

And the log is full of these messages:

2019-06-08 13:54:31.922875+0200 The Battle for Wesnoth[47964:2879999] [default] TCC deny IOHIDDeviceOpen
2019-06-08 13:54:31.923058+0200 The Battle for Wesnoth[47964:2879999] [default] TCC deny IOHIDDeviceOpen
2019-06-08 13:54:31.923147+0200 The Battle for Wesnoth[47964:2879999] [default] TCC deny IOHIDDeviceOpen
2019-06-08 13:54:31.923175+0200 The Battle for Wesnoth[47964:2879999] [default] TCC deny IOHIDDeviceOpen
2019-06-08 13:54:31.923327+0200 The Battle for Wesnoth[47964:2879999] [default] TCC deny IOHIDDeviceOpen

2) Notarizing - Enable hardened runtime

Apple wants to control even apps, distributed outside of the Mac AppStore. Wesnoth is in available in Mac AppStore right now, but that doesn't mean, we can pass notarizing requirements without any problems. We have to enable hardened runtime for wesnoth. I was trying to enable hardened runtime once but there was some problem with it and I can't remember exactly which. I need to test it more. For more informations about notarizing, use this link: https://developer.apple.com/news/?id=06032019i .

3) OpenGL deprecation (Long term issue)

Long story short: In macOS 10.14 apple deprecated OpenGL in favour of Metal. That's sad information for wesnoth as wesnoth 1.15 was planned to migrate to the OpenGL.

Long story:
From macOS 10.14 Beta Release notes:

OpenGL and OpenCL Deprecation
Deprecations
• The APIs in the OpenGL and OpenCL frameworks are deprecated and remain present for compatibility purposes. Transition to Metal if your app is using OpenGL or OpenCL.

There is also project which tends to be the next major version of wesnoth - project Haldric. It uses Godot game engine which could make this issue easier to solve.

So far there are these options:

  • Write our Metal renderer
  • Use something like MoltenGL
  • Use something else for wesnoth 1.15 (eg. Vulkan)
  • Finish project Haldric and hope, that godot will solve this issue for us

@hrubymar10 hrubymar10 added the macOS label Jun 8, 2019

@hrubymar10 hrubymar10 self-assigned this Jun 8, 2019

@hrubymar10 hrubymar10 referenced this issue Jun 8, 2019

Closed

[WIP][macOS] Issues introduced by macOS 10.14 #3455

5 of 6 tasks complete
@Vultraz

This comment has been minimized.

Copy link
Member

commented Jun 8, 2019

To be fair, it's unlikely macOS is going to completely remove OGL support any time soon. And right now, neither 1.14 nor 1.15 use it.

@GregoryLundberg

This comment has been minimized.

Copy link
Contributor

commented Jun 9, 2019

Issue 1: This may indicate a problem with other platforms. I'd suggest a separate PR against 1.14 and/or Master, and not just for macOS (initially) so we can check.

Issue 2: Probably macOS-specific. Sounds like a good idea, if you can get it working. Probably needs a quick check to see if the changes should be cross-platform, but I'd be surprised if they are.

Issue 3: Isn't this a non-issue? We don't use OpenGL. Agreed macOS probably won't take it out any time soon, but this IS Apple and they do what they want, so it might go away tomorrow. If we're truly not using OpenGL, is there a problem with eliminating it completely?

@hrubymar10

This comment has been minimized.

Copy link
Member Author

commented Jun 9, 2019

@GregoryLundberg :
Issue 1: I can't confirm it, but it could be false positive. To be honest, I don't know how to findout which code "listens" for keystrokes also on background. I can try find hotkeys handler in wesnoth and disable it by commenting it out but I don't know when I'll have enough time for it.

Issue 2: Enabling hardened runtime is question of checking one checkbox in Xcode project. I already checked it once, but I have to revert that change an I am not sure why. 9ee9721

Issue 3: Yes, it is, but branch 1.15 is still planed to be merged with OpenGL branch.

@Vultraz

This comment has been minimized.

Copy link
Member

commented Jun 9, 2019

No, there are no plans to merge the ogl branch into 1.15, nor is the ogl branch under active development.

@CelticMinstrel

This comment has been minimized.

Copy link
Member

commented Jun 15, 2019

There are no immediate plans, sure, but it's still a possibility in the future. In any case, I don't think Apple will outright drop OpenGL for a very long time, and even if it eventually does, I expect something like MoltenGL will be readily available by then.

As for the other issues, personally I don't really care about #2 and thus won't comment on it, but regarding #1... is it possible it's either a bug in SDL or an unfortunate side-effect of how SDL handles input?

@jostephd

This comment has been minimized.

Copy link
Member

commented Jun 15, 2019

I thought it might be because of the "Pause music on focus loss" preference?

@CelticMinstrel

This comment has been minimized.

Copy link
Member

commented Jun 15, 2019

Huh? Does that listen for keyboard input? I would've thought it just listens for the app gaining/losing focus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.