Choosing the right DPI-Setting My Nexus 5x has a setting for the DPI (using cyanogenmod).

When is use the default 420, twitter doesn't display the cog-icon on profile pages (block, list, mute, ...). Using 400 i get the icon again, but the pebble app doesn't show the install button for apps. Choosing 380, the pebble app works again, but twitter is broken again.

Is there some "safe" DPI setting? Seems like apps assume some dpi and have parts of their interface hidden at "wrong" DPI settings. But when the optimal DPI differs between apps it's really annoying. Despite that i would prefer to choose DPI by my preferences instead of being forced to use a certain setting to avoid misbehaviour of apps.
Xposed + App Settings is what you're looking for. You can modify DPI on a per-app basis and keep system DPI intact. Since the Marshmallow compatible version is not in the official Xposed repo, I reuploaded a copy to my own AndroidFileHost. You're already on CM so Xposed installation shouldn't be a problem for you either.