mlvwm icon indicating copy to clipboard operation
mlvwm copied to clipboard

Add option to force monochrome rendering

Open morgant opened this issue 4 years ago • 2 comments

mlvwm supports monochrome (1-bit) rendering (though it is mutually exclusive with the System8 configuration option), but most modern versions of X don't support color depths below 8-bit (256 colors). For those who might want to use the monochrome styling, or for development & testing, it'd be nice to add a configuration option that forces it.

morgant avatar Mar 12 '21 21:03 morgant

I have started in on this.

I've added a System6 configuration option which is mutually exclusive with the System8 option (and will error if you try to use both at once). I also took a first pass of implementing checks for whether we're in System6 mode whenever we're checking Scr.d_depth. That gets us menus rendering correctly as monochrome (sans icons, which are rendered at the native colour depth), but windows & controls are still rendered in the System 7 grayscale style. This is because the colours are set in InitGCs() in mlvwm.c, but that gets called before ReadConfigFile(), so we don't know we're in System6 mode at the time.

At this point I see two options: re-initialize the colours (maybe by just re-running InitGCs() after ReadConfigFile(), unless that'll not free the colours and cause a memory leak) or updating all the rendering calls to render the three styles instead of just the two. I'll see if I can make the first option work reasonably first.

morgant avatar Mar 21 '21 20:03 morgant

While calling InitGCs() after ReadConfigFile() does work as a quick-n-dirty hack, window controls and such are not actually rendered in a System 6 style (just a monochrome System 7 style. So, I need to think how far I want to take this.

morgant avatar Mar 22 '21 17:03 morgant