The cause of the bug was that X*DrawImageString draws background
according to the extents of the given string, not to extents of the font set,
which determine terminal line height.
Now, when such a situation is detected, the background is cleared before
drawing the characters.
The patch converts desktop_grid[] from Boolean array into array of
counters of objects, which are placed on cells. When object is
placed on /removed from the screen the counter gets incremented/decremented.
The panel registration code rather stupidly assumed that display
size is always 1280x1024 pixels. Because of this, depending on screen
size, the panel could be registered somewhere in the center of the screen
or completely or partially beyond of it.
The panels were registered only on startup, not those, which were added
from UI.
The fix moves panel registration into separate routine and removes assumption
about display size. The fix yet is not complete since it still makes assumption
about panel's geometry: from dtfile there is still no way to find out
dinamically the size of panel and it's location.
On small screens segfaults could be also triggered without any icons on dtfile
startup if dtwm panel (or part of it) was registered beyond the screen when
RegisterInGrid() was called by InitializeDesktopGrid().
The patch also makes grid registration work for large objects (larger than
2 cells in any direction, like dtwm panel or icon with long file name).
Previously only rectangle vertices were registered.
There was a check in linux.cf for the Linux libc version that didn't
work, since these were never set anywhere. Presumably current Xorg
imake sets these, but since we aren't using that... (yet)
As a result, the build assumed that thread-safe API's were not
supported. Setting the default libc major version to '6' allows the
proper build to take place. libc5 was never threadsafe and no one has
probably used it in over 10 years.
As a result, some earlier porting fixes that referenced '__fds_bits'
on linux systems had to be reverted as these are not valid in an MT
environment. They are also not neccessary when building in such an
environment, as the normal 'fds_bits' works fine.
This patch defintely needs testing on many linux systems.
On some systems with libtcl installed, it might be linked into instant
rather than the locally provided version. This can result in random
coredumps.
Seen on Ubuntu 12.04, x86_64.
Now, we force linking with ../tcl/libtcl.a.
In init() there was code iterating over all of the possible file
descriptors in a svc_fdset. fdsets are limited to FD_SETSIZE. This
caused coredumps on FreeBSD 10, and possibly other hidden issues.
Moving to poll(), rather than select() would be better, but is a bigger
job. For now, just limit to the FD_SETSIZE that select() requires.