Blank Touch Bar
DuckDungeon opened this issue · 29 comments
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.
See: #61
Does it work if you restart your computer?
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.
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.
@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?
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?
Works on My Machine™, Macbook Pro from 2015 (before the touch bar existed).
@ThatsJustCheesy Interesting! And this is on 10.15.5?
@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.
I just tried on my MacBook Pro 2013 (without native Touch Bar) and Touch Bar Simulator is just black there.
@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.
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.
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.
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.
@danielpunkass It looks like you solved this. Care to share the answer, please? Thank you!
@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
@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
@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.
@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
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.
@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
@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)):
@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
@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!
@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
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.
@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
Closing as this app is now discontinued.