Prevent removal of dock icons due to resolution changes
commit0f26c43371e5e7af43c99ecd941d6624b30ff9a7
authorDavid Couzelis <drcouzelis@gmail.com>
Fri, 13 Jan 2012 01:36:52 +0000 (12 20:36 -0500)
committerCarlos R. Mafra <crmafra@gmail.com>
Fri, 13 Jan 2012 09:54:14 +0000 (13 09:54 +0000)
tree8c1bf1d136fe5c1547701650a567ed7672ecdc7f
parent6ae01b9d9045a4f8489ecd0dc4ee3bd847b6e736
Prevent removal of dock icons due to resolution changes

I use xrandr to decrease the resolution of my display when I connect
it to my TV. When I change the resolution back to my monitor, a few
of the icons at the bottom of my dock are deleted.

This happens because wmaker computes the maximum number of dockapps
which the dock can hold based on the screen resolution:

        icon_count = scr->scr_height / wPreferences.icon_size;

and drops the dockapps above that number (in wDockRestoreState()).

But now the resolution can change via xrandr, so the above computation
can lead to dockapps being dropped when the new resolution is smaller
than it used to be.

To fix this it's enough to have a resolution-invariant number of allowed
dockapps.
src/dock.c
src/wconfig.h.in