1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00
Commit Graph

2925 Commits

Author SHA1 Message Date
Christophe CURIS
04f50a0833 WPrefs: Added noreturn attribute to appropriate functions
clang is a bit more strict on the attribute usage, so let's comply.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:05 +00:00
Christophe CURIS
f8b6871371 util: Added noreturn attribute to appropriate functions
clang is a bit more strict on the attribute usage, so let's comply.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:05 +00:00
Christophe CURIS
7491f5479b util: Removed unused procedure that caused a compilation warning
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:05 +00:00
Christophe CURIS
4976d48b6f WINGs: Added attribute 'noreturn' to public function 'WMScreenMainLoop'
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>
2013-12-30 18:11:05 +00:00
Christophe CURIS
9e90cebc01 configure: Enable compiler warnings to help add 'noreturn' attribute
This attributes helps the compiler to produce better binary code.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:04 +00:00
Christophe CURIS
fc825382d6 configure: Enable compiler warnings to help add 'format' attribute
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>
2013-12-30 18:11:04 +00:00
Iain Patterson
68a902aa2e Fix arrow keys in switchpanel.
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.
2013-12-30 18:11:04 +00:00
Amadeusz Sławiński
9c8398c0dc Fix implicit declaration
usermenu.c:257:12: warning: implicit declaration of function ‘GetShortcutString’ [-Wimplicit-function-declaration]

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2013-12-30 18:11:04 +00:00
Amadeusz Sławiński
cf719c2979 take dock into account when not covering icons next to it
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2013-12-30 18:11:04 +00:00
Amadeusz Sławiński
09b28b92f1 make adjustments for dock when calculating area for miniwindows
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>
2013-12-30 18:11:04 +00:00
Amadeusz Sławiński
952319ae60 move maximization size adjustments to maximization function
now wGetUsableAreaForHead returns better result

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2013-12-30 18:11:04 +00:00
Christophe CURIS
bd4abc5304 wmaker: Do not allocate memory for a short lived string in 'selectSpecification'
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>
2013-12-30 18:11:04 +00:00
Christophe CURIS
8d7db5d744 WPrefs: Make the label internationalised for the texture option in dialog window
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>
2013-12-30 18:11:04 +00:00
Christophe CURIS
d2faac6333 WPrefs: Changed array of strings 'textureOptions' into a struct for explicitness
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>
2013-12-30 18:11:04 +00:00
Christophe CURIS
aa24e862c4 WPrefs: Changed array of strings 'colorOptions' into a struct for explicitness
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>
2013-12-30 18:11:04 +00:00
Christophe CURIS
db9e002ecf wmaker: Created an array to hold the maximize menu entries
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>
2013-12-30 18:11:04 +00:00
Christophe CURIS
1f17fb940c wmaker: Avoid multiple calls to gettext
The original code called gettext twice every time, the new code calls it
only once.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:04 +00:00
Christophe CURIS
667bb9191b wmaker: Minor improvements to function 'shade_animate' when empty on purpose
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>
2013-12-30 18:11:04 +00:00
Christophe CURIS
62565b42f6 WINGs: Do not allocate memory for a fixed-size short-lived buffer
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>
2013-12-30 18:11:04 +00:00
Christophe CURIS
d25631016e WINGs: Minor improvments in 'closestListItem' function
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>
2013-12-30 18:11:04 +00:00
Christophe CURIS
10953b3a7e configure: Add check on function prototypes when debug is enabled
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:04 +00:00
Christophe CURIS
324248ecde configure: Minor changes to option parsing for consistency
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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
f9c1265604 configure: Added a check to try to enable STD C11 if possible
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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
349bc2dda2 configure: Do not keep assertion if debug was not enabled
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:03 +00:00
Christophe CURIS
4cf72c990d configure: Less intrusive CFLAGS change when --enable-debug is chosen
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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
59f5aeeec5 util: Use the macro 'wlengthof' to get the number of element in an array
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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
01c7390be1 WPrefs: Use the macro 'wlengthof' to get the number of element in an array
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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
be022d9623 wmaker: Use the macro 'wlengthof' to get the number of element in an array
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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
a3b6b62049 WINGs: Use the macro 'wlengthof' to get the number of element in an array
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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
fd47650717 WUtil: New macro 'wlengthof' in the public API to get number of elements in an array
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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
c3a132215d wrlib: Renamed image format related files for clarity
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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
f619546af9 wrlib: Marked args as unused for compiler
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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
3b2362662e wrlib: Use a Conditional for XPM in the makefile instead of #if in source
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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
aa99207ab4 wrlib: separated the code to save to XPM from the builtin XPM loading
Big files are harder to work with, so split load and save, which
happen to already be independent anyway.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:03 +00:00
Christophe CURIS
356c242143 configure: Moved PPM image format handling to a consistent place
Even if there is nothing to do for PPM at current time (all builtin
code), for consistency it is better placed with the other image
format checks.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:03 +00:00
Christophe CURIS
b66a890404 wrlib: Moved configure's detection of XPM support to a dedicated macro
The original check was not compliant with autoconf's syntax, did not
have a very good behaviour for user and was not easy to make evolve.

The new macro:
 - uses as much as possible autoconf macros for portability and code
consistency;
 - provides a consistent behaviour on yes/no/auto (if user explicitly
enables support, do not silently disable if not found; if library is found
but not the header, complain to let user install it or explicitly disable
support);
 - makes uses of shell functions to keep generated configure smaller by
sharing reusable stuff;
 - uses an automake conditional to avoid compiling the file is support is
not enabled

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:03 +00:00
Amadeusz Sławiński
311ab6b08c Raise fullscreened window
Make sure that fullscreened window covers all normal windows
2013-12-30 18:11:03 +00:00
Amadeusz Sławiński
a504370f3b Remove WMFullscreenLevel
Make fullscreen windows be on the same level as normal ones.
2013-12-30 18:11:02 +00:00
Christophe CURIS
a5ca34ccb1 wrlib: Moved configure's detection of TIFF support to a dedicated macro
The original check was not compliant with autoconf's syntax, did not
have a very good behaviour for user and was not easy to make evolve.

The new macro:
 - uses as much as possible autoconf macros for portability and code
consistency;
 - provides a consistent behaviour on yes/no/auto (if user explicitly
enables support, do not silently disable if not found; if library is found
but not the header, complain to let user install it or explicitly disable
support);
 - makes uses of shell functions to keep generated configure smaller by
sharing reusable stuff;
 - uses an automake conditional to avoid compiling the file is support is
not enabled

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:02 +00:00
Christophe CURIS
1c21d946ec wrlib: Moved configure's detection of PNG support to a dedicated macro
The original check was not compliant with autoconf's syntax, did not
have a very good behaviour for user and was not easy to make evolve.

The new macro:
 - uses as much as possible autoconf macros for portability and code
consistency;
 - provides a consistent behaviour on yes/no/auto (if user explicitly
enables support, do not silently disable if not found; if library is found
but not the header, complain to let user install it or explicitly disable
support);
 - makes uses of shell functions to keep generated configure smaller by
sharing reusable stuff;
 - uses an automake conditional to avoid compiling the file is support is
not enabled

It includes a typo fixed by Amadeusz S-B³awiñski.-A

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:02 +00:00
Christophe CURIS
777bf28ab3 wrlib: Moved configure's detection of JPEG support to a dedicated macro
The original check was not compliant with autoconf's syntax, did not
have a very good behaviour for user and was not easy to make evolve.

The new macro:
 - uses as much as possible autoconf macros for portability and code
consistency;
 - provides a consistent behaviour on yes/no/auto (if user explicitly
enables support, do not silently disable if not found; if library is found
but not the header, complain to let user install it or explicitly disable
support);
 - makes uses of shell functions to keep generated configure smaller by
sharing reusable stuff;
 - uses an automake conditional to avoid compiling the file is support is
not enabled

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:02 +00:00
Christophe CURIS
f8d9e4cd53 WPrefs: Marked args as unused for compiler in callback code
The function is a callback, which means having a fixed argument list.

It is then correct to not use all the arguments, so this patch adds the
appropriate stuff to avoid a false report from compiler.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2013-12-30 18:11:02 +00:00
Christophe CURIS
5e9ebfea76 WPrefs: Removed unused argument in function 'WGetEditMenuSubmenu'
The function did not use the argument 'mPtr', so removed it.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2013-12-30 18:11:02 +00:00
Christophe CURIS
a7663fbbcf wrlib: Add support for v5 of the gif_lib API
As reported by Nicolas (nhs), compilation of wrlib is broken when
switching to gif_lib v5.

The API of gif_lib has known little change to provide thread-safe usage,
so we now detect this in configure and and use the functions as appropriate
in gif.c

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2013-12-30 18:11:02 +00:00
Christophe CURIS
7831acebe3 wrlib: Use a Conditional for GIF in the makefile instead of #if in source
The use of the conditionals provided by autotools provides a better result
as they avoid unnecessary compilation.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2013-12-30 18:11:02 +00:00
Christophe CURIS
f892ce4d37 configure: Moved detection of GIF support to a dedicated macro
The original check was not compliant with autoconf's syntax, did not
have a very good behaviour for user and was not easy to make evolve.

The new macro:
 - uses as much as possible autoconf macros for portability and code
consistency;
 - provides a consistent behaviour on yes/no/auto (if user explicitly
enables support, do not silently disable if not found; if library is found
but not the header, complain to let user install it or explicitly disable
support);
 - makes uses of shell functions to keep generated configure smaller by
sharing reusable stuff;
 - introduces a tracking of unsupported things to be reported to user

It includes a fixes from a problem found by Amadeusz S-B³awiñski, because-A
the function 'wm_fn_imgfmt_try_link' modified the variable LDFLAGS
instead of LIBS.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:02 +00:00
Christophe CURIS
6223ed1854 Improved ignore for 'm4' macro directory
The previous rule was to ignore the whole directory, while still having
some files tracked inside.

Now we only explicitly ignore the files that have been placed there by the
autotools, so we can have a better view of it in Git when adding stuff.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:02 +00:00
Doug Torrance
e996f58da8 Removed newlines from legal text in translations
A recent patch removed the newlines from the default English legal text, as the
legal panel automatically wraps text so the newlines were unnecessary.  In this
patch, they are removed from all .po files which contain a translation of the
legal text.
2013-12-30 18:10:45 +00:00
Rodolfo García Peñas (kix)
246068a634 Legal Panel size with variables
This patch uses two variables to set the width and the height for the
Info Panel. It also includes a margin space.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-11-02 19:31:38 -02:00
Rodolfo García Peñas (kix)
415ac91afc Window Maker Developers Team Copyright
This patch includes the Dev Team Copyright in the info panel.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-11-02 19:31:38 -02:00