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

3580 Commits

Author SHA1 Message Date
Christophe CURIS
0c659c1618 WINGs: removed unnecessary size checks in WMGetBrowserPaths
The function is building strings from the directory names into an allocated
buffer, but the function took time first to calculate the exact size needed
for the resulting string, so the check on wstrlcat's result will never
fail.

As we still use wstrlcat it is not possible to overrun the buffer, we would
just return a truncated string in the list instead of return no list at all
but the case where it would happen is impossible.

This should fix Coverity #50111 (Resource leak) which was present in the
code of one of the related early return.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:42:18 +00:00
Christophe CURIS
082de93ca0 WINGs: inverted the direction for mouse wheel on WMSliders
The original choice may have looked mathematically correct, but it was
actually counter-intuitive and opposite to what every other application
do with sliders.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:42:18 +00:00
Christophe CURIS
01fbeab1d4 WUtil: fix default rights for file created when saving PropList
When creating the temporary file that will become the final file if no
problem occurs, there is a chmod done which does not give write access to
the group and to the others, but this is the task of the user-set umask.

This patch makes the rights to everything (except execution, of course) and
still applies the umask, so in the end the file will have the rights that
user wants.

Took the opportunity to make a little change related to the umask: it seems
that some version of mkstemp have a security issue, which is in not a
problem in our use case, but Coverity reports it (#50201) so as it does not
cost anything, the patch also fixes it with an appropriate comment to
explain the situation.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:42:18 +00:00
Christophe CURIS
155e1f1fe1 WUtil: rewrote wcopy_file for better error handling and to fix Coverity #50234
The original code used the libc "fopen" kind of operation, which are handy
when manipulating text files, but:
 - bring an overhead for binary files that we don't need here;
 - does not provide the mechanisms for safe error handling and special cases

As Coverity reported a Time-of-Check/Time-of-Use type of security issue,
took the opportunity to fix it and increased the size of the buffer used
for data to allow better use of modern disk performances.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:42:18 +00:00
Christophe CURIS
662b83769a WUtil: changed order for null pointer check in array functions (Coverity #72806, #72807, #72819)
As pointed by Coverity, there were some null pointer checks that had been
misplaced, due to a pointer dereference present in a preceding check. This
had been fixed by adding another null check in the check, making a
duplicate check.

This patch moves the null pointer check in first place, and remove the
pointer check from the range check to separate the pointer check on one
side and the range check on the other side.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:42:18 +00:00
Alwin
40139e208b Catch-up and some cosmetic changes of the Dutch .po files
Catch-up and some cosmetic changes of the Dutch .po files

Recently added msgid's were translated, plus a few really minor
changes. Kept some entries for last stable release.
2014-11-23 22:42:18 +00:00
Gaspar Chilingarov
7cb948098a wmaker: Support omnipresent setting toggle from keyboard 2014-11-23 22:42:18 +00:00
Christophe CURIS
33855a7a12 WPrefs: replaced call to external program "chmod" by the equivalent system call
It is more efficient to use the dedicated function than to call an external
binary program to do the job, and it reduce the risk of problem in case the
path would end up with potentially problematic characters.

It should also close Coverity bug #50225 ("Use of untrusted string value")

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-23 22:42:18 +00:00
Christophe CURIS
34f35ee534 WPrefs: changed label from "msec" to the standard "ms" from the SI
The International System of Units defines "ms" as the standard abbreviation
for milliseconds, so let's use it everywhere to be consistent.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-23 22:42:18 +00:00
Christophe CURIS
3846609072 WPrefs: minor improvements to the Workspace panel
It is general practice to not consider the strings displayed in a dialog as
real sentences, so this patch removes the dots at the end (including in the
translation);

Took the opportunity to fix some translated string that were probably not
found anymore to due other changes;

Moved a few widgets to make everything look better centered;

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-23 22:42:18 +00:00
Christophe CURIS
7e40a61d16 WPrefs: minor reorganisation in the Keyboard Shortcut panel
The goal was to reduce the risk of truncated lines in the list of actions
(a few of them are a bit long - and need to be!), so it was an opportunity
to align the widgets with consistent spacing.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:04 +00:00
Christophe CURIS
14dc8dd415 WPrefs: minor improvements to the Focus Preference panel
It is general practice to not consider the strings displayed in a dialog as
real sentences, so this patch removes the dots at the end (including in the
translation);

Took the opportunity to make a light cleanup of the translations in the
concerned areas, and fix some translated string that were probably not
found anymore to due other changes;

Make small reorganisation of the widgets to reduce the risk of truncated
strings, with keeping the overall clean aspect of the panel;

Took the opportunity to clarify the label related to the colormap to avoid
misunderstanding, and include a balloon text to clarify its reason-to-be
because, as modern display tend to all be TrueColor, it may not be
intuitive to new user what it's for.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:04 +00:00
Christophe CURIS
1b183633e1 WPrefs: small reorganisation in the Dock Preferences panel
The goal is to reduce the risk for truncated label, and take the
opportunity to align everything with consistent spacings.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:03 +00:00
Christophe CURIS
c3c8a0654c WPrefs: reorganised the Window Handling Settings panel for better look
Due to a long history of evolution, it was time to rethink the placement
of all widgets to achieve a clean look. The frames have been reshuffled to
be aligned to each other, and as a bonus the Mod+Wheel setting now has its
own frame instead of being part of another unrelated frame.

Took opportunity to include an info balloon to explain what the "by
keyboard" checkbox actually means.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:03 +00:00
Christophe CURIS
753f44ca83 WPrefs: reorganised the Preference panel for better look
As many option have been added to it, the panel started to look overloaded.
With a little rework, it now displays the same options in a cleaner way.
Took opportunity to include some balloon help for the AppIcon option to try
to be clearer than what the short label allows.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:03 +00:00
Christophe CURIS
03a7771c86 WPrefs: reorganised the Mouse Settings panel for better look
As many option have been added to it, the panel started to look overloaded.
Content have been slightly moved to make it look nicely organised inside
the window, and with possibly less truncated text.

Took opportunity to include a visual feedback to the user, when checking
the "Disable mouse actions" box then we disable the related popup menu
buttons to reflect this.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:03 +00:00
Christophe CURIS
60d9fc5bb7 WPrefs: grouped items related to the mouse actions in a single place
Having all these information spread in different places makes it error
prone when wanting to add/remove/change something in the list are there are
many unrelated places to keep in sync.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:03 +00:00
Christophe CURIS
17c3404bef WPrefs: grouped the balloon text for the dock configuration with the rest of the struct
As the data to create the icons for the dock configuration was already
grouped in a structure, it is a good idea to also include the balloon text
which is linked to them in the array, so the code is simpler and safer.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:03 +00:00
Christophe CURIS
68e550b924 WPrefs: moved the titles of Clip Delay frames to an array
As the code is already treating these frames as an array, it is a good idea
to do the same for their titles so it is possible to reuse its size at
convenient places to make the code safer.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:03 +00:00
Doug Torrance
48ce9d046e debian: Capitalize "Maker" in X session desktop entry. 2014-11-08 11:22:52 +00:00
Doug Torrance
0acbec36ac WINGs: Link examples against Xlib.
The font lister WINGs example program was failing to build because it uses
the XOpenDisplay() function from Xlib.
2014-11-04 14:33:08 +00:00
Doug Torrance
4a2e202af8 WINGs: Avoid cast from pointer to integer of different size compiler warnings. 2014-11-02 13:14:54 +01:00
Doug Torrance
a47f07cfc3 WINGs: Fix unused parameter compiler warnings in examples. 2014-11-02 13:14:54 +01:00
Doug Torrance
fc35dfd277 WINGs: Fix decimal/hexadecimal conversion bug in color panel.
In particular, the values were only being converted when the RGB slider was used
to pick the color.  If another tool was used, e.g., the magnifying glass, th e
value was assumed to be decimal, even if hexadecimal was selected.
2014-11-02 13:14:54 +01:00
Christophe CURIS
74dc2d2cc0 WPrefs: use length of array instead of hard-coded constant for sample colours
In the panel for Appearance configuration, there are some sample colours
proposed to users; the code used to have a bunch of constants hard-coded
to handle these colours.

This patch replace all constants with the macro wlengthof to use the number
of element in the array determined by the compiler, so modifying the list
won't cause hidden bugs. This include a somehow smarter code to dispatch
the colours in the window to automatically arrange them cleanly whatever
their number is.

Took opportunity to de-CamelCase the name of the array as it did not add
complexity in the patch.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:20 +01:00
Christophe CURIS
efe0da4618 WPrefs: grouped items related to the possible window placement algorithms in a single place
Having all these information spread in different places makes it error
prone when wanting to add/remove/change something in the list are there are
many unrelated places to keep in sync.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:20 +01:00
Christophe CURIS
8522283d68 WPrefs: grouped items related to the behaviour of moving a maximized window in a single place
Having all these information spread in different places makes it error
prone when wanting to add/remove/change something in the list are there are
many unrelated places to keep in sync.

Took the opportunity to de-CamelCase the name of the variable to comply
with project's coding rules.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:20 +01:00
Christophe CURIS
d02d362295 WPrefs: grouped items related to the AppIcon bouncing configuration in a single place
Having all these information spread in different places makes it error
prone when wanting to add/remove/change something in the list are there are
many unrelated places to keep in sync.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:20 +01:00
Christophe CURIS
e73c3e84de WPrefs: grouped items related to the help balloon configuration in a single place
Having all these information spread in different places makes it error
prone when wanting to add/remove/change something in the list are there are
many unrelated places to keep in sync. It also makes the code simpler.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:19 +01:00
Christophe CURIS
454c7bec5d WPrefs: grouped items related to the window title alignment in a single place
Having all these information spread in different places makes it error
prone when wanting to add/remove/change something in the list are there are
many unrelated places to keep in sync.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:19 +01:00
Christophe CURIS
c0d4c16336 WPrefs: grouped items related to the menu style in a single place
Having all these information spread in different places makes it error
prone when wanting to add/remove/change something in the list are there are
many unrelated places to keep in sync.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:19 +01:00
Christophe CURIS
4bb93d3dab WPrefs: replaced a few constants by the macro 'wlengthof'
This reduce the risk to miss something in case the array they refer to gets
updated, because with the macro the proper number of element will be
evaluated by the compiler automatically.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:19 +01:00
Christophe CURIS
6ac27ba842 WPrefs: created macro 'wlengthof_nocheck' for the cases were wlengthof cannot be used
Because the macro wlengthof preforms a check of validity of its argument
with static_assert, there is a use case where it fails with a compiler
error. This patch introduces an alternate macro without the check, to be
used only for this specific case.

To be able to use the size of the array, a few of those array declaration
have to be moved before the structure in which their size is used.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:19 +01:00
Christophe CURIS
7d09b2c04f wrlib: add support for release 5.1.0 of the libgif
As reported by Andrew, the compilation of the WRaster broke because
there was an API change in libgif v5.1 versus the v5.0 (something had been
forgotten for DGifCloseFile to be easily used in wrappers for dynamic
languages).

Now, if we have detected that we're in 5.x release, we use the GIFLIB_MINOR
macro to see what the function prototype is (this macro was introduced only
in 4.1.6 so we cannot fully rely on it to detect the version of the
library).

The possible error code is not used because at the place we use the
function we would not be able do do anything more meaningful with it.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:08:59 +01:00
Christophe CURIS
3de5b8fb42 util: removed usage of external '__progname' because it is not portable
As reported by Milan Čermák, using this variable breaks compilation on
Solaris, because it is a hack which is not standard. To ensure portability,
we now rely on main's argv[0] which is always available.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:08:59 +01:00
Christophe CURIS
ff8fc10a65 configure: add detection for 'nanosleep' function with appropriate headers
As reported by Milan Čermák, Solaris needs extra library 'rt' to have
access to that POSIX function, so we properly check for it.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:08:59 +01:00
Milan Čermák
484c880fd0 wmaker: remove call to internal X11 header
The header 'Xarch' is not part of the standard, it is an internal header
that is already included by the other headers; furthermore it is not needed
directly by the code in wmspec.c.

As it breaks compilation on some platforms (namely Solaris 10), its call is
removed.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:08:59 +01:00
Milan Čermák
1748a18380 wrlib: fix usage of deprecated attribute for gcc 3.x
It seems that the argument to the attribute 'deprecated' is a novelty of
gcc 4.x, the attribute introduced in gcc 3.x did not take any parameter.

As Solaris 10 is providing gcc 3.4.3, this patch updates the detection in
the public API header to make it compile properly.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:08:59 +01:00
Christophe CURIS
461214d870 util: clarify error message in "wmaker.inst" in case of directory creation failure
Previously, the directory was expected to already exist, but as now it is
automatically created it is a good idea in case of problem to have the
message clearer.

Took opportunity to indent properly that part of code.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:04:14 +01:00
BALATON Zoltan
cb3702559a wmaker: Restore multi screen functionality by reverting wrong commits
Revert patches that moved variables from WMScreen to global level
because this broke X displays with multiple independent screens and
caused dock and clip icons to become mixed up. When managing multiple
screens each screen used to have it's own state/dock and clip. This
commit restores that by reverting mainly the commits listed below (and
those that are invalidated by reverting these) and fixing up later
commits to apply after the revert.

Reverted commits:
f60e65001b Moved 'workspace_name_font' from the Screen to a Workspace object in the global namespace
9e103a46e9 Variable workspace_count moved to the workspace object in the global namespace
e5ae684d02 Variable last_workspace moved to workspace object in global namespace
c610b8d7ce Variable current_workspace moved to workspace object in global namespace
f0c5073600 Array of workspaces moved to the workspace object in the global namespace
9c252988f8 Variable workspace_menu moved to workspace object in global namespace
e86b8dcb2f Clip, Dock and Drawers menu moved to appropriate global namespace
074092f319 Removed WScreen args not used
4a7daf2322 AppIcon list moved out of WScreen
2103fe390b Variable clip_icon moved to clip object in the global namespace
014bc52531 wClipIconPaint appicon argument removed
40e1ea08b8 Varible session_state moved to global namespace
6987d4aa40 Removed WScreen argument
0de3e590ce shortcutWindows moved to w_global
2e64831fb6 Removed unused variable wapp_list
b6423a7b4f wmaker: Moved variable Screen Count into the global namespace

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 13:04:14 +01:00
Khaled Hosny
e3dcadde30 WINGs: Add optional Pango text layout support
Currently WINGs renders text using Xft directly which does not support
any advanced text layout that is needed for scripts like Arabic or Indic
scripts (or even things like automatic ligature support for Latin
script).

With Pango we also get text fallback for free, so no more square boxes
for characters not supported in the current font (unless no font on the
system supports the specified character, of course).

This patch introduces support for using Pango to render the text (though
its Xft backed), to avoid forcing the additional dependency to everyone
it is made off by default.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 13:04:14 +01:00
David Maciejak
1485233292 wmaker: fix maximizing window in multiple screens env
This patch is fixing the maximize window feature.
As it was reported by Miikka Veijonen, in multiple
screens env wmaker is reserving some space for the dock
even on screen that are not displaying it.

This patch is only adjusting the working area for the head
that is displaying the dock.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 13:04:14 +01:00
David Maciejak
870a73ff32 WINGs: add function to get button caption
This patch is adding a new function WMGetButtonText to get the button caption.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 13:04:14 +01:00
David Maciejak
65f8cb7a4b wmaker: fix arbitrary shell command injection
Workspace background pref can be tricked to run arbitrary cmds.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:04 +01:00
Doug Torrance
a307b9f867 Update ChangeLog, from version 0.92.0+ to most recent commit.
Generated by the new update-changelog.pl script.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:04 +01:00
Doug Torrance
d3f9c2cd75 Add script to update ChangeLog from git log.
This patch adds update-changelog.pl, a script which adds the subject line and
author of every commit since ChangeLog was last touched by git, in a style
consistent with the entries up to version 0.92.0.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:04 +01:00
Doug Torrance
4546065276 wmaker: Consistent whitespace in WindowMaker.h.
Previously, the whitespace in WindowMaker was inconsistent, with some
indentation using spaces and some using tabs, and a mixture of tabs and spaces
used to align comments at the ends of lines.  As a result, patches that touched
this file would often result in warnings from checkpatch.pl.

This patch fixes this so that indentation uses tabs and all other alignment uses
spaces.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:04 +01:00
Doug Torrance
47ec274760 wmaker: Add more directions for window snapping.
This patch adds the ability to "snap" a window to the top, bottom, or any of the
four corners of the screen.  It uses three new helper functions, drawSnapFrame,
getSnapDirection, and doSnap, to reduce code duplication and increase
readability.

It also updates NEWS to indicate the additional directions.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:04 +01:00
Doug Torrance
da940a1e4d NEWS: Add note about dragging maximized windows.
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:04 +01:00
Doug Torrance
b20a58d592 WPrefs.app: Add ability to set behavior when dragging a maximized window.
You can now set the behavior when dragging a maximized window, i.e., the
"DragMaximizedWindow" option from ~/GNUstep/Defaults/WindowMaker, from the
"Window Handling" tab of WPrefs.app.

Note that to make room for the pop-up button required to set this option, the
switch button to set the "OpenTransientOnOwnerWorkspace" option has been moved
to the "Expert User Preferences" tab and the "Edge Resistance" frame has been
made slightly smaller.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:04 +01:00