Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Blank Touch Bar #73

Closed
DuckDungeon opened this issue Jun 18, 2020 · 29 comments
Closed

Blank Touch Bar #73

DuckDungeon opened this issue Jun 18, 2020 · 29 comments

Comments

@DuckDungeon
Copy link

DuckDungeon commented Jun 18, 2020

Whenever I run TBS, it is completely blank and I am lost as to how to change that. Doesn't show any contextual buttons for apps, just sits there blank.
I tried to figure this out on my own, but when I searched for a solution, everyone just seemed to be talking about how it worked.

On iMac 2019 running Catalina 10.15.5. I did nothing beyond downloading and launching the app.

@sindresorhus
Copy link
Owner

See: #61

Does it work if you restart your computer?

@danielpunkass
Copy link

FYI my app, Touché, suffers the same exact problem starting, I think, with 10.15.5. If I discover a workaround I'll let you know, and will keep my eyes open for anybody else who finds a solution first.

@danielpunkass
Copy link

Probably worth mentioning: in my tests the issue only occurs if the Mac in question does not have a Touch Bar itself. At least, it works on my late-2016 MacBook Pro, but I'm able to reproduce the bug easily on a Mac Mini.

@sindresorhus
Copy link
Owner

@danielpunkass Sorry. I totally forgot to answer you on Slack. I wanted to test before answering and then obviously forgot.

I wonder if this is the same as #61? On your Mac Mini does Touché not work at all, even after restarting the computer?

@danielpunkass
Copy link

I don't think it's the same as #61 because as far as I have been able to tell the blank Touch Bar is new to 10.15.5. It sounds ike #61 has been around for a long time and it was not clear from the description if the touch bar is actually blank or not. It sounds like it's just not registering clicks in that case.

I just rebooted my Mac Mini and confirmed the Touch Bar is still blank. Have you confirmed the Touch Bar Simulator works on ANY 10.15.5 Mac that doesn't also have a hardware Touch Bar?

@ThatsJustCheesy
Copy link
Collaborator

Works on My Machine™, Macbook Pro from 2015 (before the touch bar existed).

@danielpunkass
Copy link

@ThatsJustCheesy Interesting! And this is on 10.15.5?

@ThatsJustCheesy
Copy link
Collaborator

ThatsJustCheesy commented Jul 18, 2020

@danielpunkass Yup. To be specific, it's a MacbookPro12,1 (the 13-in) on 10.15.5.

Edit: Though I should note that the touch bar goes blank for me in the vein of #61, after restarting the app.

@sindresorhus
Copy link
Owner

I just tried on my MacBook Pro 2013 (without native Touch Bar) and Touch Bar Simulator is just black there.

@danielpunkass
Copy link

@sindresorhus I'm glad you're able to reproduce it at least. I think in our Slack conversation I shared some preliminary thoughts about it. I'm really not sure though how hard it will be to fix, or even if it's possible.

@tinacious
Copy link

Same problem here with it loading blank. macOS 10.15.5.

The documentation's suggestion to restart your computer and never open XCode (without having to restart again) is quite disruptive and isn't exactly a net gain in terms of convenience for those of us who use XCode. Other issues (e.g. #61) allude to the overall flakiness on Catalina.

If you're an XCode user on Catalina and looking for a convenient way to access the touch bar, the most convenient thing is to just leave XCode open in the background and access the touch bar from the Window menu.

@L1cardo
Copy link

L1cardo commented Nov 22, 2020

So what is the solution for this issue?
The touch bar from xcode works fine, but when I open TBS, both touch bars(xcode touch bar and TBS) go to black.
I am running on a Mac mini with an M1 chip.

@trulyspinach
Copy link

trulyspinach commented Jul 28, 2021

Seems like it only works for a couple of time until it don't, then you have to restart to make it work again.
This is the same on Big Sur and Monterey. DFRSetStatus set back to initial value also doesn't help. I suspect there're some changes in the private framework(SkyLight) that might require you to call some additional function to free out resources? I'm happy to dig a bit into the binary but not sure of the outcome.

@pktmterenceg
Copy link

@danielpunkass It looks like you solved this. Care to share the answer, please? Thank you!

@danielpunkass
Copy link

@pktmterenceg Give this project a look - does it work for you? If so maybe it will provide the clues to how to update this one if it's still not working. https://github.com/jslegendre/TouchBar-Simulator

@pktmterenceg
Copy link

pktmterenceg commented Mar 23, 2022

@danielpunkass Thanks for the quick response!

Full confession: I'm not a Swift coder (yet?) and it appears that repo suffers from a change between Swift (n<4) to Swift (n>=4) which has broken the build there. (I'm struggling through it, but it appears to be around serialization protocols.) So, I can't (yet?) say whether or not it works for me.

However: I've looked at the two side by side, paying special attention to any of the work with _stream, SLSDFRDisplayStreamCreate(), and so on, but I haven't spotted a difference yet. I've also played with the very interesting projects https://github.com/zydeco/TouchBarServer and https://github.com/steventroughtonsmith/TouchBarScreenshotter. As far as I can tell, though, they're all more or less taking the same approach. (Heck, maybe they even borrowed liberally from each other?)

And, as far as I can tell, they all exhibit the same "blank view" described in this thread.

Best I've done so far is that it appears that anything checking the status return of SLSDFRDisplayStreamCreate() (i.e., (status == kCGDisplayStreamFrameStatusFrameComplete) ) never executes. But as for why... I'm stumped.

With gratitude,

pktmterenceg

@danielpunkass
Copy link

@pktmterenceg It's been a while now since I sorted through this junk and my code is kind of integrated with other app-specific stuff, otherwise I would just spell it out more plainly what needs to be done. Let me take a quick look at this project again and see if I can reproduce the blankness. If I can maybe I can submit a fix.

@danielpunkass
Copy link

@pktmterenceg FYI I found this workaround posted by @sindresorhus and confirmed it gets around the serialization issues you were running into: https://github.com/sindresorhus/Defaults/blob/main/workaround.md

@danielpunkass
Copy link

Unfortunately I was able to confirm that Touch Bar Simulatoir still shows blank. Running side by side with Touché also built and run from source. I'll take a crack at seeing if I can get it working.
image

@danielpunkass
Copy link

Ah, take a look at this file https://github.com/jslegendre/TouchBar-Simulator/blob/25f6404315c00d0c96987fd2d5221cf836a44a72/TouchBarSimulatorService/TouchBarSimulatorService.m

See how it uses the "TouchBarSimulatorCreate" function? I think that's the difference between Touché and Touch Bar SImulator now. I'm using that function if it exists, and falling back to the older mechanism using DFRSetStatus only for older systems. I think if you can figure out how to integrate a similar split in functionality with Touch Bar Simulator, where it uses the newer mechanism when available, it will be as reliable as Touché is now.

@pktmterenceg
Copy link

@danielpunkass Thanks again for diving in on this.

I see what you mean about that function, but it doesn't look like this project or the others use that function. In other words, I don't think that's making the difference. Each has a slightly different approach, but none - aside from yours, of course 🙂 - seems to get it quite right.

With gratitude,
pktmterenceg

@danielpunkass
Copy link

@pktmterenceg Did you try downloading and running the latest release from that linked project? It seems to work for me. Does it not work for you? I think that other project is an open source example of one that is working like Touché does, but maybe I'm missing something subtly wrong if it's not working for you. Here's a screenshot of it running on my Mac (M1 Max, 12.3 (21E230)):

image

@pktmterenceg
Copy link

@danielpunkass Thank you, again, for helping me dig in to this.

The release here https://sindresorhus.com/touch-bar-simulator/ does not work for me, but Touché does. Not sure what to make of that, really.

With gratitude,
pktmterenceg

@danielpunkass
Copy link

@pktmterenceg I wonder if you are getting confused by the fact that the other project I'm linking to is ALSO called Touch Bar Simulator. It's not the same project at this. Try the release posted here:

https://github.com/jslegendre/TouchBar-Simulator/releases

If that works, then I think you'll have your work cut out for your comparing the solution in that repository with the one in this one, but at least you'll know that the code is there to lean on and learn from!

@pktmterenceg
Copy link

@danielpunkass Thank you - great catch!

I had multiple "simulator" projects open, and didn't pay enough attention to which was "active". You were right - this one does work for me!

Now, hopefully, none of the things I want to change will break that! Haha!

Again, I'm very grateful to you for your help and time.

With gratitude,
pktmterenceg

@danielpunkass
Copy link

Great to hear it's working! That should be an effective lead for anybody who gets time to pursue integrating an equivalent fix in this project.

@pktmterenceg
Copy link

@danielpunkass Thanks again.

Yes, I think I'm going to explore possible differences and make notes here in this thread for future explorers.

Warmly,
pktmterenceg

@tiankaima
Copy link

Hey guys. I know this has been quite a long discussion and some of you might already forgot about this, but here's "somewhat" a solution that definitely would work:
image

Try setting the status all the way from 0..<7 works if you've encountered problems like this.

@sindresorhus
Copy link
Owner

Closing as this app is now discontinued.

@sindresorhus sindresorhus closed this as not planned Won't fix, can't repro, duplicate, stale Mar 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants