Question

I imlemented something similar to terminal emulator, which uses monospace fonts for rendering. Now when user wants to resize the window they can to an arbitraty size but this looks ugly, because characters are about 10x20 pixels. So I need to sort of constrain width and height to a certain amounts that are divisible by the character sizes witout a remainder. I wonder how to achieve that? I am using plain XLib. XNextEvent and company.

Currently I am using ugly hack, once theresize is commencing I start a timer and after 1 second I will fix the window size. This does not look pretty and most of all I cannot make it reliable.

Was it helpful?

Solution

Specify resize increments in WM_NORMAL_HINTS, see documentation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top