The function does not need to be passed a array of pointer to windows
because it does not change content of the pointers. It is more efficient to
directly use an array of windows as the parameter, and simpler also.
As 'SlideWindow' is also concerned, it can be simplified and turned into
an inlinable function so the compiler can optimise it.
Took opportunity to de-CamelCase the name of the functions to comply with
the project's coding style.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, there is a safety check on the number of workspace
which aborts the function, but the storage memory have already been
allocated so it would leak this buffer.
The case where the number of workspace is 0 is probably not supposed to
happen (there should always be at least 1 workspace, the current one), but
it is better to keep safety checks, so this patch is moving the check at
the beginning so no leak will occur.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
To be consistent, all place where the not-properly-written "apercu" was
used in the source code (of wmaker and WPrefs) it has been replaced by an
appropriate "minipreview" or similar, to be in line with the new name
suggested by Yuri Tarasievich.
This new name is better understood by contributors who speak usual english,
but not this word which comes From french but is sparsely understood by
british people.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The function is called only if wsmap is not null, and the function is not
modifying its value so it won't become null. Removed the checks to keep the
code as simple as possible for maintainability.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The definition in the local header was not correct; it works because gcc is
tolerant to this kind of errors but other compilers are not. The
declaration was creating a local variable in each file that call header,
and because it is not static gcc's linker will merge them. Other compilers
will at best complain for duplicate symbol, and at worst silently duplicate
the variable so it will not work as expected.
The variable is now moved to the existing structure meant for global
variables, so now the code is really clear about using a global variable
instead of a static/local one.
Took opportunity to add some missing 'static' attributes to some variables.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This patch is adding the core code needed to run the workspace pager.
Currently when called, a new frame presenting mini workspace images
are displayed at the bottom of the screen above other windows.
When clicking on one of the miniatures, the workspace is switched and
the frame is closed.
Drawbacks: a screenshot of the workspace is used for the miniatures.
This screenshot is taken only when a workspace switched event occurs.
First, it means that the workspace switching process can be longer than
usual. Secondly, updated minitatures can only be available when the
workspace is "opened" (cause windows have to be mapped to be able to
be copied).
So when wmaker is (re)started or when for example a window is moved to
another workspace the corresponding miniature is NOT updated.
(I did not find a clean and easy way to do so, feel free to share if
you have some ideas)
for arq in `git ls-files *.c`; do
echo $arq;
indent -linux -l115 $arq;
done
The different line break at 115 columns is because
I use a widescreen monitor :-)