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

3580 Commits

Author SHA1 Message Date
Alwin
e3769a0b09 WPrefs: make a text string translatable
The WPrefs miniwindow shows a shorter title that could be translated.
2014-12-23 11:33:36 +00:00
Alwin
1dc7dc4309 Translations: Dutch .po files updated
Recently added/changed msgid's were translated, plus a few cosmetic
improvements. Kept one entry for last stable release.
2014-12-23 11:33:36 +00:00
Doug Torrance
8abf7762cb WPrefs: Clarify purpose of "window snapping" feature in expert panel. 2014-12-23 11:33:36 +00:00
Christophe CURIS
3ed8cb6ffa WPrefs: add possibility to configure the size of the aperçu
The Icon preference panel have been rearranged to include a slider which
controls the size of the Aperçu. This slider is also used to turn off the
feature, so the related checkbox have been removed from the Misc preference
panel, because it is more convenient to have the related settings at the
same place.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-23 11:33:36 +00:00
Christophe CURIS
31c00a8749 WPrefs: add an image to represent the window in the Window Placement frame
The original square box did not look like anything, by using an image that
looks like a small window it is more clear to users what it represents.

The image was drawn as an XPM keeping a style consistent with everything
else; it was then converted to TIFF using ImageMagick:
  convert -depth 8 -compress lzw xpm/smallwindow.xpm tiff/smallwindow.tiff

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-23 11:33:36 +00:00
Christophe CURIS
a887b44977 WPrefs: grouped the choices for Window Move Display in a single place
By having an array, it makes the code simpler in many places, thus easier
to maintain and to implement new possibilities.

It is the opportunity to log an error message to user instead of silently
accepting invalid values.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-23 11:33:36 +00:00
Christophe CURIS
d2101b287a WPrefs: grouped the choices for Window Resize Display in a single place
By having an array, it makes the code simpler in many places, thus easier
to maintain and to implement new possibilities.

It is the opportunity to log an error message to user instead of silently
accepting invalid values.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-23 11:33:36 +00:00
Christophe CURIS
6ef4b06cca WPrefs: created an array to store the database values for the Icon Position setting
By having an array, it makes the code simpler in many places, thus easier
to maintain. Took opportunity to include a comment about the trick used to
have a value convenient for use.

It is the opportunity to log an error message to user instead of silently
accepting invalid values.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-23 11:33:36 +00:00
Christophe CURIS
d89b1f5ca3 WPrefs: moved the list of icon animations into an array
By grouping the information together, it makes the code less prone to
errors and easier to maintain as it links things that are related.

Took opportunity to log a message for the case where an invalid value
was found to ease user's debug.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-23 11:33:36 +00:00
Yury Tarasievich
034edb19e3 WPrefs: improve texts in the Window Handling panel
Did not update the translations msgid because I think translators may
wish to get it visible so they can bring similar improvements.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-21 17:35:06 +00:00
Christophe CURIS
9b67b36276 configure: add detection for O_NOFOLLOW flag to the open function
As discovered by Douglas Torrance, this flag is not really portable, so
this patch adds a check in the configure script to detect if any known
define could help. If no value works, we fall back to defining it with the
neutral value '0', so the compilation will not fail.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-17 17:33:56 +00:00
Christophe CURIS
e1146e56e0 configure: rewrote the detection for WebP image library
Unfortunately, the detection was broken because the header is using a hack
on the function name to provide compatibility between different versions of
the API, which means the usual link test, which uses a known name of a
symbol, cannot work without also using the header to get the hack applied
on the function's name.

The new detection mechanism now simply check for both header and link at
the same time, so we're probably safe until a Major API change is decided,
in which case we will also have to update WRaster's code anyway.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-16 09:37:48 +00:00
Christophe CURIS
7d6ecb51f6 wmaker: rewrote the update of _NET_WORKAREA property
As reported by Moritz, the Qt toolkit (and maybe a few other ones) are
using the content of this property, but WindowMaker did not set it properly
so for examples the menus in KDE could fail to display in multi-screen
configuration (probably because the toolkit is using the property to make
sure the menu stays in the visible area).

The original code just assumed it was safe to use the usable area of the
1st screen in the list, but unfortunately it is not that simple.

The new code calculates a rectangle that contains the usable region from
all the screens, so the toolkit gets a more accurate value.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-16 09:37:48 +00:00
Christophe CURIS
be1c2a01dc configure: require a minimum version for Autoconf to avoid wrong generation
As found by Douglas Torrance, when the 'configure' script is generated
using v2.68 of autoconf then it gets wrongly generated due to a regression
in the handling of names in AS_VAR_PUSHDEF, and crashes with this kind of
sibylline messages:

checking CFLAGS for -Wtrampolines... ./configure: line 11916: wm_cv_c_check_compopt_Werror_trampolines=no, unknown: command not found

This patch adds a check on autoconf version to ensure the problem will get
caught as soon as possible.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-15 20:24:22 +00:00
David Maciejak
c6e323e75d WINGs: increment version
This patch is incrementing version number as the API changed.
2014-12-10 10:19:54 +00:00
Christophe CURIS
0e884f793a util: remove local constants GLOBAL_DEFAULTS_SUBDIR that are not used
As pointed by gcc, this macro is not used anywhere in the 2 files. Because
the code also suggests that they should be inherited from any other place
anyway, remove them from the file to prevent them from being used in the
future.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:20 +00:00
Christophe CURIS
f9b14d7824 WPrefs: remove unused constants ICON_TITLE_*FONT
Apparently, there was a time when it was though to add a label below (?)
the icons of the list of panels, but this has never been finished and the
unfinished code to do this was even removed in commit
  0e01e69205

So, as it is unlikely that the "feature" will return, and if it did the
font should be handled in a better way, this patch removes the definition
of the constants with the names for the font used for those labels.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:20 +00:00
Christophe CURIS
ee617cb291 wmaker: comment out definition of wm-spec constant that we do not use
Include a comment to explain what their aim is, and why WindowMaker is not
making use of them. They are not simply removed because it is informative
for future contributors that we know about them and we purposedly decided
to not use them.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
b3c20610e9 wmaker: remove parameter 'which' from local function 'restoreMenu'
This parameter is given always the same value, so there is not reason to
keep it. The code is updated to take this value into account, and the
related constants are removed.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
1d1c5f77c7 wmaker: remove constants HORIZONTAL and VERTICAL from moveres.c
These 2 constants have been defined at the beginning of the project, but
where never used later. As the use of the associated constants suggests
that they are not bringing anything useful, this patch simply removes them.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
b5e89127ca wmaker: add code to explicitly ignore Motif-WM flags we don't want to handle
The goal is to explain the reason why we don't do anything about them, so
people looking at the code in the future will know why it is this way. The
expected side effect is also to silent warnings [-Wunused-macros] from gcc.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
7ce2636f63 wmaker: removed unused constant SCROLL_STEPS in the switchpanel code
As pointed by gcc, this constant is not used anywhere in the code. It seems
to have been prepared for a scroll animation when the switchpanel would be
too big to fit the screen, but the code looks like to never have been
activated, and was cleaned away in commit
  6d08aa22d8

If the feature were to be re-added, it would be better to use something
proportional to the menu scroll speed parameter that can be configured by
user anyway.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
10b890e920 wmaker: removed unused macro DBLCLICK_TIME
As pointed by gcc, this macro is not used anywhere, that is probably
because the code have been relying on the function "IsDoubleClick" for a
very long time now.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
4799df5506 replaced all local definitions of PI by a single one
For code maintainability, it is better to have a single definition of the
constant than many ones dispatched in many places. In addition, we try to
count on the constant M_PI that can be defined by the header <math.h> if
possible because it may have the best accuracy for the platform.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
723f217355 remove unused macros defining corner positions
As pointed by gcc, the 4 constant the define the corner positions are not
used anywhere in the code, and it looks like it has always been like this.
As it is a cost for maintainability, get rid of them.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
1d0f02f5ca remove a few unused constant for size of buffers
As pointed by gcc, a few constants which contain sizes for buffers are not
used anywhere in the code. This is probably due to code cleanup, where
these buffers have been removed or where size is automatically calculated
by using 'sizeof' instead to reduce risk of bugs.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
bbd42b3a20 WINGs: reuse GNUstep header instead of duplicating stuff in wwindow.c
There is a header that defines the stucts and constants to support GNUstep
specific things, and it is already used somewhere else in WINGs, so instead
of duplicating locally the stuff we re-use the header, it makes code easier
to maintain.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
ff77b6b2e5 WINGs: remove internal XDND macros that are not used
The group of XDND_* macro do not bring a lot in term of clarity, so it is
probable that they will get away someday, but at current time as 2 of them
are not used anywhere they get removed to prevent their use in the future.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
3bf2978e63 WINGs: remove macro ABS_SHIFT from the wcolorpanel code
This macro was define a *very* long time ago, in commit
  d98f1fa645
but was not used at that time, and have never been used anywhere since
then.

As the macro does not look like a good idea for performance anyway, get rid
of it before anyone could get tempted to use it.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
59106395c0 WINGs: remove dead code from 'loadPixmaps'
It seems the code had the possibility to load a default icon, probably to
be used on the windows if the main program does not provide any.

This code however have never been enabled, probably because it is better to
not provide an icon and let the window manager use its own.

This patch then removes that dead code, but keeps the image as part of the
WINGs resource for the case where an application would have been using it.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
e09df40f78 WINGs: remove unused macro NFONT in wbutton
As pointed by gcc, this macro is never used in the code; when no font is
defined by user the 'paintButton' code already falls back to the
'normalFont' of the screen, and this code could not need the macro anyway.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
4b0838e93a WINGs: remove unused constant DEFAULT_BORDER_WIDTH in wcolorwell
As pointed by gcc, this constant is not used anywhere, and it looks like
it have always been the case. As there's no reason to specifically add a
border to this widget, remove the constant.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
781fd777eb WINGs: remove constants used for default width+height for the widget
As pointed by gcc, the height is never used and the code make use of the
SCROLLER_WIDTH constant anyway, so this patch updates the code to directly
use that constant instead of intermediate values that just adds noise for
code maintainability.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
03385c3d78 WINGs: remove the macro DEFAULT_TITLE because it is not used
As pointed by gcc, the macro is not used, that is probably because it is
totally ok to never provide a title from X point of view, so there is now
reason to fall back to that empty constant.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
e5efbe0cf2 configure: make the gcc check for trampolines stronger
Because the use of trampolines can be a lot of problems, this patch changes
the use of the flag to:
 - make it an error if possible, so coders are forced to not use them;
 - always enable them, not just for debug, so we increase the probability
to get them caught.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS
149f6b0390 configure: add a few warning flags for gcc and clang to help catch bugs
They concern topics like:
 - portability;
 - dangerous constructs;
 - clearer code for maintainability

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS
30e1fad926 configure: add macro to check compiler flag '-Wstrict-prototype'
Strict prototype are better for portability and to avoid bugs because it
makes sure the compiler has the information to properly validate the
arguments given when a function is called.

This flag however need special care when checking for it, because the
declaration for 'main' generated by autoconf cannot be a strict prototype
so the detection would always see the flag as failing.

This patch handles this by creating a dedicated macro for this detection
which uses a good prototype because we're in a case where it is possible,
so the detection will not always fail; it also makes sure to add the flag
to CFLAG only at the end, to avoid falsely crashing any further test done
in the configure script.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS
11fe8bd860 configure: rewrote the detection for -Wunused-macro
This flag is always detected as unsupported because every time autoconf is
generating a test program for any feature, it puts at the beginning of the
test source all the '#define' that have been detected so far, which is what
we expect normally.

But for this option, as we cannot reasonably make a dummy use of every
macro, the warning triggers and falsely gets autoconf into thinking it does
not work.

This patch creates a dedicated macro (WM_CFLAGS_GCC_OPTION_UNUSEDMACROS)
for this flag, which works around the problem by having no '#define' in the
test source. It also adds a new macro WM_CFLAGS_GCC_OPTION_POSTPONED
because if the flag works, we still cannot add it to the compilation
command because it could fail all further tests done, so the macro will add
it to CFLAGS only at the end.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
David Maciejak
fa4d50a0ca wrlib: Merge some duplicate code when allocating color
This patch is adding a static function named allocateColor to merge
some duplicate code.
2014-12-10 10:19:18 +00:00
Christophe CURIS
0c938a3c0c WPrefs: fix icon used in the Opaque/Non-opaque Move setting
Apparently, some pixels from the close button on the window image were
missing from the Non-opaque image, they have been added in the XPM file
which was then converted to TIFF with ImageMagick's command:
  convert -depth 8 -compress lzw xpm/nonopaque.xpm tiff/nonopaque.tiff
to have a file similar to what was there before

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS
be4849448f WPrefs: fix memory leak when storing the list of texture in Appearence panel (Coverity #50112)
As pointed by Coverity, the PLStrings created to store the information on
the texture leak. This is due to the fact that they are created with a
refCount of 1, then the PLArray in which they are placed increments that
count, so at list destruction the count would return to 1 instead of 0,
meaning the PLStrings won't be freed.

This patch release the PLStrings once after adding them to the PLArray so
the count will go back to 1, which means they will be properly freed when
the PLArray will be released.

Took opportunity to remove the call to WMRetainPropList on the titem-prop
because it artificially increases the refCount but this is already done
when adding to the PLArray.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS
af1bcde13a checkpatch: fix bug in regular expression
Recent version of perl seem to report incorrect stuff in regular expression
and this seems to be fixed in the kernel reference file, so this patch
brings the fix to our (older) version so we won't get that spurious message
when running the script.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS
34d82e5462 wmaker: replaced macro 'store_modifier' by an inline function, in X Modifier initialisation
A macro can be a source of problems, because the compiler has no type on
the arguments to make checks. Using an inline function allows to do those
checks, meaning clearer error messages, it provides clear info in case of
name collision, it is easier to maintain (no need for the hacky '\' for
multi-lines) and the scope of visibility can be controlled more easily (no
need for #undef).

The macro store_modifier had to face a slight change because its 2nd
parameter is used as a reference, which is now clearly visible in the
prototype of the function.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS
de00154fa1 wmaker: replaced macro by an inline function, in X Modifier initialisation
A macro can be a source of problems, because the compiler has no type on
the arguments to make checks. Using an inline function allows to do those
checks, meaning clearer error messages, it provides clear info in case of
name collision, it is easier to maintain (no need for the hacky '\' for
multi-lines) and the scope of visibility can be controlled more easily (no
need for #undef).

Took opportunity to change a 0 to the constant NoSymbol which is the name
defined by X for this case and another to NULL which is the right way to
set a null pointer in C.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS
d9438e65ef makefile: make silent rule work also for generated files
A few files are generated using custom commands, which so far did not
follow the silent rule as the compilation stuff.

This patch adds the needed stuff so they will also be silent if the user
wants so, leading to a cleaner build process where warning/error messages
are more visible.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS
4bed8d14d7 wmaker: remove unnecessary null pointer checks in handle_event of wsmap
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>
2014-12-10 10:19:18 +00:00
Christophe CURIS
ad84a2dc8f wmaker: moved the variable 'process_workspacemap_event' to the global namespace
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>
2014-12-10 10:19:18 +00:00
David Maciejak
41745d98d4 wmaker: add core workspace pager functions
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)
2014-12-10 10:19:18 +00:00
David Maciejak
519302223c wmaker: add workspace pager underlying configuration
This path is adding the functions and variables needed for workspace pager preferences.
An option to enable/disable the workspace pager, and one to set a default background image.
2014-12-10 10:19:18 +00:00
David Maciejak
ea8f18aff1 WPrefs: add workspace pager configuration
This patch is adding a checkbox in the expert zone to disable
completely the workspace pager and add an entry in keyshortcut
preference to set the shortcut used to open the pager with the
action "Open workspace pager".

The default frame background can be configured by setting an optional
variable "WorkspaceMapBack" from WindowMaker conf file as in:

WorkspaceMapBack = (tpixmap, "/tmp/testme.png", gray20);

or

WorkspaceMapBack = (solid, "#2c2482");
2014-12-10 10:19:18 +00:00