There are a number of steps in the library check procedure that are a bit
repetitive, and have been placed into the macro WM_LIB_CHECK to make the
code simpler to write.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The function can have a wider use, so moved then to a more neutral place
and gave them more generic names.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The usual way to define a macro in is to name macro with 'USE_xxx' when
they are used to enable a feature 'xxx'
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The default case should not arise because the tested variable is an enum,
but it the case someone would get a value wrong, we're safer with a little
warning and proper fallback than with unknown behaviour.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The other extension detection have the same situation and they already
have a variable for that, do not do differently for Xrandr because it adds
unnecessary complexity in the code.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
When autoconf encounters a macro name that it does not know, it assumes
that it is just a standard keyword that needs to end up in the generated
configure script.
This patch teaches m4 about the syntax used for our macros so it can now
that it is supposed to be a macro, and then it can stop and report the
problem.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The macro 'AC_ISC_POSIX' is now said to be deprecated, so we use the new
recommended check instead as we make light use of the corresponding
function.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This attribute reports cases where GCC has to generate special code to
handle some C constructs, for which we'd prefer an explicit code instead
of counting on GCC doing the work.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
In the present case, it just led to a compiler warning on unused variable
when the XShape extension is disabled, but in general case it just adds
complexity by duplicating things; this should be reserved for complex
cases.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As suggested by GCC, this function is a good candidate. There is a little
constraint on how to do it however, as it is part of the public API so we
have to do it in a portable fashion (We can't rely on our "config.h" when
the file will have been installed).
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This attribute helps the compiler checking the type matching between
arguments and the specification in a printf-like format string, to
avoid invalid output. This attribute is optional, but some compilers
can suggest functions that could have it.
This patch adds the appropriate compiler flags if they are supported when
the source is being compiled with DEBUG enabled.
The patch also introduces a new macro WM_CFLAGS_CHECK_FIRST because in some
cases AX_CFLAGS_GCC_OPTION is not really efficient and in present case it
does not fits the job.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
A previous commit broke the behaviour of the left and right arrow keys
in the switchpanel. Releasing either of the keys would correctly select
a new window but the panel would then close. The original, and desired,
behaviour is for the panel to remain open after selecting a new window
with the arrow keys.
Reported by Yury Tarasievich.
Fixes bug report:
The 0.80.2 and older versions allowed the miniwindows to lay down in
parallel with wmdock (if one wanted it that way) but newer Windowmaker
versions could only partially simulate such behavior and that includes
to either setting an option NoWindowOverDock to yes or to manually set
the dock to "Keep on Top".
Reported-by: Josip Deanovic <djosip+news@linuxpages.net>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
It is not only not very efficient, but in present case it also participates
in memory fragmentation.
This patch replaces this with a stack allocated buffer with a buffer which
is way too large.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As this label is being displayed in the window, it is a good idea to make
it translatable to the user's locale.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The parameters for the textures were stored all together in an array
which made its usage error prone; now there a struct to clearly identify
which string is what, so it is clear in the source what's being done.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The parameters for the theme colors were stored all together in an array
which made its usage error prone; now there a struct to clearly identify
which string is what, so it the source is clearer on what's being done.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The idea is that an array is easier to work with, when it's about to add,
remove or change entries, because all data end up stored in one place
instead of dispatched around the code.
It also makes code smaller as it avoids repetitions.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
When animations are disabled, we still create the function but we make it
empty to keep the rest of the code simple. This patch does:
- mark the function inline, to increase the probability that the compiler
will not generate the function at all;
- mark arguments as unused to avoid some compilation warnings.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Allocating memory with 'malloc' has a cost and participate to memory
fragmentation, so for a temporary buffer that has a fixed size let's
prefer allocating it on the stack.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The check on length of string before comparing is not necessary
because this will be checked as part of strcmp; the check won't
save time and may actually cost.
As the number of element in the array is not going to change during
the loop, took the call to 'WMGetArrayItemCount' outside the loop
to be faster (and ease compiler's optimisation work).
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The idea is to:
- have a consistent looking file by using autoconf macros
- provide better feedback on improper option usage
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Some compiler support C11 standard by default, some need an explicit
option, and some don't support at all; this new macro only tries to enable
support if possible, the actual feature support being done by other checks
on case-by-case
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The previous code made a dumb change to CFLAGS which would cause user
supplied CFLAGS to be ignored, and possible compiler compatibility issues.
The new code does the same changes in a smoother way, so we do not totally
drop user specified or script detected compiler options.
When debug is enabled, we also include a reminder for the final CFLAGS
value.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The new macro 'wlengthof' from WUtil makes code easier to read than the
previous [sizeof() / sizeof([0]) ] construct.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The new macro 'wlengthof' from WUtil makes code easier to read than the
previous [sizeof() / sizeof([0]) ] construct.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The new macro 'wlengthof' from WUtil makes code easier to read than the
previous [sizeof() / sizeof([0]) ] construct.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The new macro 'wlengthof' from WUtil makes code easier to read than the
previous [sizeof() / sizeof([0]) ] construct.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The new macro 'wlengthof' returns the number of elements for which a local
array have been defined, which makes code easier to read than the
previous [sizeof() / sizeof([0]) ] construct.
The macro includes a static assertion to stop compilation if it is being
used on a pointer, for which we cannot know the size of the array, to
avoid generating dummy result. This can work only with C11 which
standardised the static assertions.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This patch makes all files appear together when listing files and
it is more clear about their function.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The two functions require an argument which is used when the libXpm is
used, which means having the same argument list for the builtin code to be
permutable.
This patch adds the appropriate stuff to avoid a false report from the
compiler.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Now that the builtin XPM loading is separated from the saving code, the
use of the conditionals provided by autotools provides a better result
as it avoids unnecessary compilation.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>