Mojave glitch: dock disappears, menus turn black
I'm running Mojave on an early 2015 MBP, 3.1 ghz i7 16 gb RAM. A couple of times since I got this machine I've encountered an error where the system will halt like it's loading some kind of process with the cursor spinning, only for the dock to suddenly disappear and the Finder menus to turn black. Sometime the dock comes back gray, other times it's translucent. I can still hover over apps in the dock and select them, but no text inputs appear if I try to type anything in (though if I save, they're there when I come back.) As for the Finder menus, they turn completely black, though I can still select menu options, but anything that pops up is completely glitched.
This seems mostly like an appearance issue and I've fixed it by logging out or forcing a restart. Restarting Finder doesn't seem to do anything and is often impossible as I can't tell which buttons to press. What could be causing this error?
MacBook Pro 13", macOS 10.13