This patch adds the ability to set the colors for IconTitleColor, IconTitleBack,
ClipTitleColor, and CClipTitleColor, the only four colors set by setstyle which
previously were not configurable using WPrefs.
The icon in the preview window appears as a miniwindow if IconTitleColor or
IconTitleBack are being configured and as the clip if ClipTitleColor or
CClipTitleColor are being configured.
Based on libexif feature, this patch is adding orientation
detection and provides 2 more shortcuts for live
right/left rotation. Internal version was bumped to 0.7.
Having the warning displayed will help devs to understand what is going
on and where to look at for a fix.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, the allocated value returned by XGetModifierMapping
is assumed to be non-NULL everywhere except when releasing it.
Removed this last check (useless) and added a little check at the beginning
to avoid an (improbable) crash.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, the functions WMCreatePLString return a newly
allocated WMPropList, which must be released when not needed anymore.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As reported by Coverity, the return string of WMGetTextFieldText is
malloced so it needs to be freed.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, the string returned by 'WMGetTextFieldText' is
allocated dynamically, so it must be freed when not needed anymore.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, the function 'WMGetTextFieldText' already allocates
memory for its return string, so it is not necessary to wstrdup it.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, if there is a problem when reading the binary data
of an RImage from a file, the area allocated to store it would not be
freed.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, the PLArray that is created to store the return
value of the function 'processData' can be left allocated if some case
handling decide to return NULL instead.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, there is a possible NULL pointer dereference in the
code that extracts the selected modifier (from a popup button list).
The code assumes that there is always a space between the core name of the
modifier (which is used for saving) and the more user friendly name. This
is true if the list could be successfully generated in fillModifierPopUp,
but it may not be the case if that function has to fall-back to the
default list (XGetModifierMaping failure).
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, it is possible to dereference the NULL pointer in
the function 'browseForFile'.
This should have been reported by the compiler ("possible use of
uninitialised variable") but the assignation of a default value to the
variable 'lPtr' hides this, but as the default value is not a good one then
the code could crash.
This patch removes the default value, so we may have some info from the
compiler and handles the case smoothly.
It also fixes a potential memory leak pointed also by Coverity in the
case where the string returned by WMGetFilePanelFileName would be a 0
length non-null string.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, the return value of 'sscanf' is not checked, which
may not be a problem because the fall-back value for 'i' is provided before.
However, if sscanf fails there is no guarantee that all implementation would
leave 'i' untouched in case of parsing error, and for convenience it is more
logical to write the code is such a way that the value assignment looks like
the fall-back value it is.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
cppcheck is reporting the msg below:
[../WINGs/winputmethod.c:215] -> [../WINGs/winputmethod.c:209]:
(style) Found duplicate branches for 'if' and 'else'.
The patch is fixing it by setting a default return call.
With a set of images i was able to detect that
the flip functions was shifting the image by 1px.
The 90 and 270 degrees rotation were not working as
the functions were also mirroring the img.
The patch is also fixing the C style based on checkpatch.
when the rotation angle value passed to RRotateImage is a modulo of 90,
the function is working well but in other cases the rotateImage()
function is called. That last function is half implemented but
the half already implemented part is also segfaulting (use the testrot.c
to replay the crash).
So the patch is moving the 'not implemented' msg to disable the whole
rotateImage() function and comment it out.
As pointed by Coverity, the function GetCommandForPid did use a macro
'RETRY' for the 'close' of file descriptor, which is not correct because
on success the function 'close' does not reset errno, and in case of
failure the file descriptor is not more valid anyway.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Factually, the program works because the function 'drawerRemoveFromChain'
uses only the address of the drawer and not the content of the structure,
but conceptually this address point to a storage space that has been
de-allocated, so that's calling for trouble for future code changes.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, the function 'wdefaultspathfordomain' cannot
return a NULL path, so it is not necessary to check for it. (in the
present case, it led Coverity to think it was possible to have the
structure 'stbuf' uninitialised)
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, there is one case where the string returned by
WMGetTextFieldText could be left allocated.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, there is one case where the application dictionary
which is created temporarily (when saving the changes in the Window
Inspector) could be left allocated. It is now freed in the common path to
avoid problems.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As reported by Coverity, it was possible to return early from the function
'listCallback' without de-allocating a temporary string. The string is now
requested after this early return.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointer by Coverity, the function wstrappend may move the string in
memory (because that's what realloc does if it can't expand the allocated
buffer in-place), so it is important to use the returned address and not
assume the old pointer is still valid.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, the caller of the function 'getSavedState' assumes
that if the function returns 0 then the wstate is not initialised. This was
not actually true, so this patch changes 'getSavedState' to behave as
expected.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, the memory allocated to contain the argument list
for spawning ourself was never released.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, if the function wShowCrashingDialogPanel is not
able to connect to the default screen, then the memory allocated for the
panel would be leaked.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, there are some cases where the name of the file
returned by wIconChooserDialog could be left unfreed.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The function wIconChooserDialog already makes sure that it returns
NULL if its result would have been an empty string, so it is not
necessary to re-check this in setIconCallback, this leads to
more complicated code and can't be optimised by the compiler.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, if the function wScreenInit fails to properly
attach to the screen then the storage structure and content were not
released before returning.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, if the target width or height for the center ended
being <= 0 then the image created to contain the generated assemblage would
be leaked.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, if there's no window to unmap in a workspace, then
the array used to build the list of the windows to be unmapped for
workspace change would not be freed.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, if an invalid OPEN_MENU is used then the memory
allocated when parsing the line containing it would be leaked.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, if the word "WITH" was used in the content of the
root menu definition then its string would not be freed.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, the function 'ProgGetWMClass' always allocates the
strings returned in wm_class and wm_instance, so they always must be freed.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, a string could be left unfreed in the case where
the window's attribute dialog is closed before an icon would be actually
chosen from the Icon Chooser Dialog.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, a string could be left unfreed in the case where
the docked application's settings dialog is closed before an icon would be
actually chosen from the Icon Chooser Dialog.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, in this specific case the string previously stored
in 'file' was lost when replaced with the string from 'db_icon'. The logic
have been simplified to avoid the case.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, there was a memory leak when updating the shortcuts
in the menu for windows which occured when a shortcut was associated with
the window and this shortcut did not change.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, there is a check to make sure a pointer is not NULL
but it is still dereferenced later in the function. As the code is done so
that this pointer cannot be NULL then it is not necessary to check that.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This patch adds "FrameFocusedBorderColor" option for theming,
It should allow having borders better matching titlebar colors.
By default it's set to black.
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>