1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 20:10:29 +01:00
Commit Graph

3609 Commits

Author SHA1 Message Date
Doug Torrance
b295a2029e debian: Import version 0.95.6-1.1. 2015-05-26 23:49:28 +01:00
Doug Torrance
67da339ccb debian: Import version 0.95.6-1. 2015-05-26 23:49:28 +01:00
Alwin
945f4d2389 WPrefs: creating more space for translations
Making some wasted pixels available in the Options section of Icon
Preferences, by redividing the heights and vertical offsets.

The reason is that one or more translations may easily become
larger, and will automatically be wrapped to a second line. In the
current situation, those two lines appear more or less stripped,
depending on the font size. The upper and/or lower part of the fonts
become invisible, which make them hard to read. It's ugly also.

Currently the Dutch and other translations benefit from this
change.
2015-05-25 22:41:04 +01:00
Christophe CURIS
b64d9e6be0 wrlib: changed Gamma Correction calculation to use single-precision float
The original code was using double precision floating point to perform the
color corrections for the creation of the standard colormap. This precision
is not necessary because color coding is 16 bits anyway, and on some
architecture the double precision comes with a cost.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-24 23:25:57 +01:00
Christophe CURIS
9ab2203456 Use single-precision math functions when available
Since C99 we have floating point functions available for single precision,
so as it is what we need we detect them (configure) and use them when
appropriate. The goal is to avoid unnecessary float->double + double->float
conversion.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-24 23:25:57 +01:00
Christophe CURIS
d28edde23e Added some explicit conversion to double precision
When the result of the operation is expected to use double precision, this
patchs adds an explicit conversion to that type to tell the compiler that
this is what we want, and not an unexpected side effect.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-24 23:25:57 +01:00
Christophe CURIS
79a95d7173 Fixed floating point constants defined as double but expected as float
To preserve the accuracy of the operation, the C standard request that the
mathematical operation is performed using double precision, but in many
case this is not necessary so this patch fixes a few constants to avoid
that conversion.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-24 23:25:57 +01:00
Christophe CURIS
1df08cc492 configure: Add compiler detection on non optimal floating point constant
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-24 23:25:57 +01:00
Christophe CURIS
bae28b2fae doc: changed section for translated man pages from 1x to 1
Similarly to the previous patch that changed the section for the core man
pages, this patch updates the translated man pages.

Took opportunity to re-order alphabetically the files in the Makefile
because it eases maintenance.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-23 18:53:19 +01:00
Christophe CURIS
d6d165c29d doc: do not install translated man pages if the language was not enabled in LINGUAS
When people cherry-pick the languages they want to install, they certainly
do not care for man pages in other languages. So, instead of always
installing them, the configure script will now automatically detect which
ones need to be installed.

Took opportunity to add a section in the I18N manual to invite contributors
to think about the man pages if contribute to translations.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-23 18:53:19 +01:00
Christophe CURIS
0a009143c3 util: improve the command line argument parsing in wmmenugen
The code ignored the last argument provided on the command line;

It did not support the recommended '--version' and '--help' from GNU which
are often handy;

It used an unusual syntax to specify the parser, now it can also use more
usual "-parser=name" and "-parser name", the old syntax is still supported
to avoid breaking compatibility;

When a problem is found with an argument, the program stops instead of
printing an error message and continuing;

There's been updates on the exit codes in case of problem because it is an
information that could be useful for people calling the program from a
script;

Took the opportunity to provide more information in the man page and to
get it cross-checked against the program's option list during "make check".

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-23 18:53:19 +01:00
Christophe CURIS
8088dc1eab doc: changed section for man pages from 1x to 1
As pointed by Douglas Torrance, nowadays no application is using anymore
the 1x section for the man pages, so this patch is changing the section for
all our concerned man pages to 1 (general commands).

Took opportunity to add some missing references in "see also" sections.

Reported-by: Doug Torrance <dtorrance@monmouthcollege.edu>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-23 18:53:19 +01:00
Alwin
4d0585ede2 WMaker: trivial fix in text string
Typo.
2015-05-18 13:43:34 +01:00
Alwin
81e51182e5 Translations: Dutch language files updated
New entries were translated, a few improved.
2015-05-18 13:43:34 +01:00
Christophe CURIS
42acb5d34c doc: describe Iain Patterson's new feature for ICCCM compliance
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS
6aad540b88 wmaker: support providing ICCCM version, for compliance with the standard
The standard specify that the pseudo-selection which is used to
cooperatively replace window managers should actually contain the version
of the ICCCM standard which is supported. As this could be handy for
compatibility checks in the future, let Window Maker comply.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS
ea2b5f0641 wmaker: make the '--replace' de-activable at compile time
As it is really unlikely that in normal use case someone would need this
feature, it is now conditional code, which is not enabled by default; the
configure scripts now propose a '--enable-wmreplace' option to enable the
corresponding code, as people making package for distributions may want to
enable the feature to provide users the ability to give a try of all the
window managers.

Suggested-by: Carlos R. Mafra <crmafra@gmail.com>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Iain Patterson
28b0169147 wmaker: replace and be replaced (ICCCM protocol)
Use the same logic used by xfwm4, metacity et al to replace an existing
window manager on the screen and allow other window managers to replace
us, as defined by the ICCCM 2.0:

http://www.x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html
  Communication with the Window Manager by Means of Selections

By convention those window managers try to become the selection owner of
the WM_Sn atom where n is the screen number.  If the atom is owned by
another window manager and the --replace argument was not given to wmaker
we fail to start.  If the argument was given we try to become the new
owner and wait for the existing window manger to exit.

After a successful startup we watch for SelectionClear events on the
atom and initiate a shutdown if one arrives, as that implies that
another window manager was started with --replace.
2015-05-15 17:44:50 +01:00
Christophe CURIS
fa5f8d9937 wmaker-check: rewrote parsing of structure fields for callback checker
Doug Torrance reported a problem with some versions of AWK which caused the
signed/unsigned attribute to not be properly ignored, because the regular
expression was using a GNU extension to keep it simple.

While trying to reproduce it, I discovered that mawk was chocking on one
regexp used in parsing the type+names parsing of structure members.

This patch is rewriting the parsing, because hacking regexp to make them
fall working is still not the best solution for maintainability. There is
now a clearer code which is also safer because it will handle more
gracefully corner cases.

Reported-by: Doug Torrance <dtorrance@monmouthcollege.edu>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS
ea42641033 Add a configuration option to ignore Decoration Hints from GTK-based application
As reported by Nerijus Baliunas and Paul Jakma, the GNOME application,
which use the GTK toolkit, are asking to have no window decoration. This
can be solved by editing the window's attributes in Window Maker, but this
can be tedious when there are many GNOME application used.

This patch adds a configuration option: Window Maker tries to detect for
GTK-based windows and in this case ignore the decoration hints that were
provided by the application.

Suggested-by: Paul Jakma <paul@jakma.org>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS
5ecb96cbf4 doc: describe the GNOME application issue in the FAQ
Now that Window Maker have been fixed to allow the user to properly control
and save the title bar/resize bar/other decoration settings on the window,
describe the problem reported (first) by Nerijus Baliunas, so more people
may find the answer.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS
14d1d3f141 wmaker: fix clearing of window attribute that was not saved properly
As reported by Nerijus Baliunas, there was a problem when unchecking an
attribute in the Window Inspector and saving it. The original code was
meant to save an attribute that is being checked by user, but not one that
is explicitly unchecked, which means than although it looked ok when using
the "Apply" button, it was not remembered when restarting the application.

In continuation to the clean-up started in the previous patches, this one
is updating the Window Inspector to display 2 check-boxes, one read-only on
the left, displaying the state requested by the application, and a second
one which makes use of the new Tri-State button in WINGs to let the user
specify if he wants to force-on, force-off, or leave as-is the attribute.

The saving to the property list is then updated to take into account this
new 3-state when saving to the file, so relaunching the application will
remember correctly the user choice.

Reported-by: Nerijus Baliunas <nerijus@users.sourceforge.net>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS
976083f5b9 WINGs: create a new type of Tri-State Switch Button (to doc)
There are some times when we need a Switch Button (aka CheckBox) with more
than 2 states, generally to express check/uncheck/leave-as-is.

This patch extends the Button widget to support the new WBTTriState type,
similar to the existing WBTSwitch except it supports a 3rd state which is
reported to application as '-1'.

The implementation was done in order to not break the binary API. The
version have been incremented in the WINGs header to reflect the change,
but not the version in the 'configure.ac' because that have already been
done in commit c6e323e75d for the next Window Maker release.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS
997b3e5d91 wmaker: honour MWM Hint to have no border to a window
As there is already an attribute to allow changing this behaviour, and this
is being using for the Net WM hints, there is no reason to not support it
for MWM Hints also; contrary to the initial guess suggested by the comment
it costs actually nothing to properly support that.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS
fd1dd9c7ea wmaker: fix misuse of 'user_flags' instead of 'client_flags' for window attributes
The structure containing the information on windows contains 2 sets of
attributes, client_flags which contains those asked by the application
through Hints (like MWM Hints and others) and user_flags which was defined
to allow the user to override them.

Unfortunately many places of the code was using the wrong structure to save
the attributes to (for example by using the WSETUFLAG macro) which was
merely ok as the user_flags have priority, but when we want to provide a
clean consistent behaviour to users, we need to get things in the right
place.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS
a8f6abc9ea wmaker: moved the list of Application Attributes into an array, for the Window Inspector
The Window Inspector is used to let user change a list of advanced options
for all the windows of an application. This list was defined through many
hard-coded things; by defining an array with everything at the beginning of
the file it is easier to maintain (the code is simpler because it is more
generic) and to make it evolve.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS
8276ff1331 wmaker: moved the list of Advanced Options into an array, for the Window Inspector
The Window Inspector is used to let user change a list of advanced options
for a window. This list was defined through many hard-coded things; by
defining an array with everything at the beginning of the file it is easier
to maintain (the code is simpler because it is more generic) and to make it
evolve in the future.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS
1a068faa49 wmaker: moved the list of Window Attributes into an array, for the Window Inspector
The Window Inspector is used to let user change the list of attributes for
a window. This list of attributes was defined through many hard-coded
things; by defining an array with everything at the beginning of the file
it is easier to maintain (the code is simpler because it is more generic)
and to make it evolve.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS
c3ba9aeba3 wmaker: moved calculation of internal offset in handleDockMove outside the loop
As pointed by the "checkpatch.pl" script, one line was too long in respect
of the coding style.

This line contains the calculation of an offset when storing a value in an
array, as this offset is a constant during all the loop, this patch is
calculating the offset only once before the loop and then uses this result,
which should make the code faster (although gcc may already optimise this
kind of things), makes it compliant with coding style, and takes the
opportunity to explain the reasons behind this offset.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:30 +01:00
Christophe CURIS
5881d1a8ba wmaker: moved the definition of the entries for the window menu options to an array
By defining the const array with everything at the beginning of the file,
it is easier to maintain and to make evolve.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:30 +01:00
Christophe CURIS
bed5ebea89 wmaker: moved the definition of the list of entries for the window menu to an array
By defining the const array with everything at the beginning of the file,
it is easier to maintain and to make evolve (all stuff at the same place).

Merged the function makeMakeShortcutMenu into makeOptionsMenu because it
allows to use a simple callback in the structure like for the other
submenus and because its complexity did not justify a dedicated function.

Took opportunity to give a more appropriate name to the index
MC_DUMMY_MOVETO which did not mean what the entry is about.

As a side effect, this should close Coverity #50251 which was about saving
the return value of function into a variable but not using it, which is not
really good for maintainability.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:30 +01:00
Rodolfo García Peñas (kix)
edc12fad9f wmaker: removed dead code related to 'GLOBAL_SUBMENU_FILE'
There was the possibility to include a global sub-menu to the root menu
using a dedicated file, but this does not look like it is really useful as
this root menu is already defined by a user file, and the root menu is
already specific enough that it does not need anything more 'global'.

Furthermore, the variable enabling this feature (GLOBAL_SUBMENU_FILE) is
not defined anywhere (neither from "configure", nor in "wconfig.h", ...) and
is also not documented at all.

Considering it was introduced a very long time ago (1999!) and was not
touched anymore, this patch removes the dead code associated with it.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:30 +01:00
Christophe CURIS
af2aba6f95 wmaker: do not use strcmp twice on the same thing, in function appiconBalloon
It is not really efficient to call it twice because the strings will not
change, and by using the appropriate trick it can make the code smaller,
with less redundancy, so less prone to bugs and easier to maintain.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:30 +01:00
Christophe CURIS
784f6794e5 wmaker: remove one level of pointers for the function SlideWindows
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>
2015-05-08 18:53:30 +01:00
Christophe CURIS
8fa16bef00 wmaker: reorganisation of the control flow of the function 'findDock'
Changed the code to return as soon as the result is known because it makes
the code simpler to understand, which is good for maintainability.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:30 +01:00
Christophe CURIS
1c1909d5fe wmaker: took as much assignation as possible outside 'if' statements
It is generally considered bad practice to place an assignation inside the
expression for an "if" statement because it is often a source of bug,
because of possible typos and because it makes reviewing code more
complicated.

This patch fixes as much cases as possible to make the code easier to read.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:29 +01:00
Christophe CURIS
e14fad1162 wmaker: fix warnings from compiler when animations are disabled
The code for animating stuff needs some parameters in a few functions,
which are not used when animations are disabled at compile time, so the
compiler issues some warnings about them.

This patch adds the appropriate statements to disable declaration that
are not needed in this case, and tell the compiler it is ok to not use
the parameters not needed, thus fixing the warnings.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:29 +01:00
Christophe CURIS
0bab67f9be configure: Added option to disable animations
The old behaviour was to expect the user to go modify manually a source
file which is not a great idea because that's typically the kind of things
in charge of the configure script.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:29 +01:00
Christophe CURIS
6ef010d974 Code refactoring: replaced macro 'ANIMATIONS' by 'USE_ANIMATIONS' for consistency
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>
2015-05-08 18:53:29 +01:00
Christophe CURIS
9d9b6d3fcf wmaker: fix incorrect type for variable in the global preference structure
As pointed by the new check script, the preference "show_clip_title" is
defined as a Boolean value in the preference loading function, which uses
the callback function "getBool", which expect a variable of type "char",
but the variable was not defined with that type.

This patch changes the type for the appropriate one to avoid possible
problems.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:29 +01:00
Christophe CURIS
ba3e575971 wmaker: add script to check the call-back function used when loading configuration
Because the C compiler cannot check the consistency between the type of the
variable being pointed to, and the type expected by the call-back function
that is used to parse and store the value from the configuration file,
there is a risk of mismatch that can cause Window Maker to misbehave due to
data corruption, which depends strongly on the configuration values and the
architecture on which Window Maker is running.

This patch introduces a script that checks the consistency where possible, to
raise the issues when performing "make check".

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:29 +01:00
Alwin
3d6da4b210 WPrefs: trivial fixes in text strings
Fix some typos.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2015-04-28 09:06:33 -04:00
Alwin
f2f1bcb209 WMaker: trivial fixes in text strings
Remove an error message with the same meaning, because a synonym
was used. Also fix a typo.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2015-04-28 09:06:33 -04:00
Alwin
495e82fc9a WINGs: trivial fixes in text strings
Fixing typos and/or inconsistencies in error messages. Some
backports for the Dutch .po file.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2015-04-28 09:06:33 -04:00
Alwin
ea39621f91 Translations: Dutch language files updated
Recently added/changed msgid's were translated, plus a few
improvements. Kept some entries for last stable release. Removed
abbreviated forms from menu comment.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2015-04-28 09:06:33 -04:00
Christophe CURIS
e03088ebe2 wmaker: fix non-portable int argument for printf in error message
The original code assumed that the sizeof returns a long int type, which is
true on 64 bits platform but not on 32 bits platforms, as pointed by gcc.

The new code does an explicit conversions to 'int' (which should be enough
for that case) so the format specifier in printf will always be ok,
whatever platform Window Maker is compiled for.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:07 -04:00
Christophe CURIS
bc4f3352b6 wmaker: fix crash when switching workspace with "Affiche.app"
As reported by Martin Dietze, when switching workspace (mainly with
keyboard shortcut) while the focus was set on a sticky note from the
GNUstep application "Affiche.app" would cause Window Maker to crash.

This crash was due to the application creating its menu with an Omnipresent
state; Window Maker tried to be smart by smartly setting the focus to this
window after the workspace change, unfortunately when removing the window
of the note from the screen the application would decide to remove also the
omnipresent menu (because it is not necessary anymore).

Because we kept a pointer to an outdated WWindow, we would silently corrupt
memory, which would later cause a crash in an unrelated place (fortunately
in this case it happened quite soon).

This patch adds a check to make sure the window we want to focus is still
a valid one, and if it is not we just ignore it to fall back on another
mechanism already in place for picking the window to focus.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:06 -04:00
Christophe CURIS
c8ea949b1a wmaker: converted macro 'SAME' into a static function
There are some risks associated with the way arguments are used in macros,
and using a function also allows check on the type of arguments and leaves
more room to the compiler for making the best optimisation choice; it also
allows writing easier to read code (and thus, to maintain).

As a side effect, this should also help Coverity in avoiding false positive
bug reports (like #109605 and #109607).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:06 -04:00
Christophe CURIS
6ef343ed87 WUtil: fix improper use of de-allocated variable (Coverity #109618)
As pointed by Coverity, the variable 'path_dst' was first free'd, then it
was used in the 'unlink' function.

This patch fixes the call order to de-allocate the string only when it is
no more needed.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:06 -04:00
Christophe CURIS
032f6587d9 WINGs: remove useless function call in WColorPanel (Coverity #109617)
As reported by Coverity, the function 'customSetPalette' is making a call
to 'WMGetPopUpButtonSelectedItem', but this function does nothing to the
widget but only return a value, which is not used at all, so this patch
removes the call to the function.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:06 -04:00