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

3887 Commits

Author SHA1 Message Date
David Maciejak
b6d48420bb wmaker: src/dialog cosmetic code change
This patch is just renaming the variable used for the info panel
from 'thePanel' to 'infoPanel'.
2014-08-20 11:51:47 +01:00
David Maciejak
c92ea52271 wmaker: update drag-nd-drop label related
This patch is updating the drag and drop labels
from docked app settings window. As i am not sure common users
are aware of what 'DND' means.
2014-08-20 11:51:47 +01:00
David Maciejak
3f306184bd wmaker: unset default app logo size
This patch is setting the app logo max size to 128 as what can
be found in the rest of the code, so the logo is not restricted
anymore to the icon size defined by WPrefs.
The goal is to solve the resize issue that appears when the logo
is used in Info and Exit panel.
2014-08-20 11:51:47 +01:00
David Maciejak
58faae8ff5 wmaker: switch back icon name to the window name when needed
This patch is setting the icon name to the window name when
_NET_WM_ICON_NAME is not provided by the app.
2014-08-20 11:51:47 +01:00
David Maciejak
6dc89b1522 wmaker: fix moveres.c compilation warning
This patch is fixing compilation issue:

moveres.c:1801:65: warning: unused parameter 'dx' [-Wunused-parameter]

by removing variable 'dx' from getResizeDirection function.
2014-08-20 11:51:47 +01:00
David Maciejak
d3e5e73bfc wmaker: Add drag-nd-drop support
This patch is removing the experimental status of
drag-nd-drop support on the dock and adding an option
to disable the feature from the configure step.
2014-08-15 01:08:23 +01:00
David Maciejak
166abcd17a wmaker: Add drag-nd-drop support in info panel
This patch is adding a message in the info panel
if drag-nd-drop was compiled in.
2014-08-15 01:08:23 +01:00
David Maciejak
2abb323777 wmaker: Improve drag-nd-drop support
This patch is cleaning the previous DnD support,
and adds the get type list protocol negociation.
Currently only supporting uri-list type.
2014-08-15 01:08:23 +01:00
David Maciejak
be5b58aaee wmaker: fix xdnd accepted type
This patch is ensuring that the data dropped is a file format URI
and converting it as stated by XDND specs.
It solves:
*crash in my env when arbitrary stuff is dropped
*correct handling of non ascii chars
2014-08-07 09:42:35 -06:00
David Maciejak
fe177c6966 wrlib: fix RCreateImageFromDrawable error log msg
This patch is fixing the name of the function from the log message.
2014-07-27 10:07:28 -06:00
David Maciejak
39e1398257 WINGs: correct possible null pointer dereference
As reported by cppcheck:

[WINGs/array.c:129] -> [WINGs/array.c:131]: (warning) Possible null pointer dereference: array - otherwise it is redundant to check it against null.
[WINGs/array.c:151] -> [WINGs/array.c:153]: (warning) Possible null pointer dereference: array - otherwise it is redundant to check it against null.
[WINGs/array.c:170] -> [WINGs/array.c:172]: (warning) Possible null pointer dereference: array - otherwise it is redundant to check it against null.

This patch is checking that the var name 'array' exists.
2014-07-27 09:45:38 -06:00
David Maciejak
abc2d13f7d wmaker: main.c fix realloc mistake
As reported by cppcheck:
[src/main.c:141]: (error) Common realloc mistake: 'wVisualID' nulled but not freed upon failure

The patch is using wrealloc instead of the standard realloc().
2014-07-27 09:45:03 -06:00
David Maciejak
8d731b719e wmaker: superfluous.c possible null pointer dereference
As reported by cppcheck:
[src/superfluous.c:238] -> [src/superfluous.c:199]: (warning) Possible null pointer dereference: aicon - otherwise it is redundant to check it against null.
[src/superfluous.c:239] -> [src/superfluous.c:199]: (warning) Possible null pointer dereference: aicon - otherwise it is redundant to check it against null.
[src/superfluous.c:240] -> [src/superfluous.c:199]: (warning) Possible null pointer dereference: aicon - otherwise it is redundant to check it against null.

The patch is adding a test to check if variable aicon exists.
2014-07-27 09:45:03 -06:00
David Maciejak
f5cb2f3d1c wmaker: dock.c possible null pointer dereference
As reported by cppcheck:
[src/dock.c:568] -> [src/dock.c:571]: (warning) Possible null pointer dereference: aicon - otherwise it is redundant to check it against null.

The aicon test is useless, the patch is removing it.
2014-07-27 09:45:03 -06:00
David Maciejak
f6b9fc8870 WINGs/Tests: make them compile again
This patch is adding the missing X11 libs reference.
2014-07-27 09:41:38 -06:00
David Maciejak
d0bb7ae0c8 wrlib/tests: fix testgrad memory leak
cppcheck is reporting:
[wrlib/tests/testgrad.c:148]: (error) Memory leak: color_name

but seems some other variables were never freed.
This patch is cleaning them property.
2014-07-27 09:41:38 -06:00
Christophe CURIS
16045a6be4 Increment versions of libraries for next release due to public API Changes
WRaster:
- new function 'RShutdown'
- removed flag 'optimize_for_speed' from RContext
- new functions '...(operate_xxx)', '...(flip_image)'

WUtil:
- new function 'wutil_shutdown'
- new macro 'wlengthof'

WINGs:
- new function 'WMReleaseApplication'
- new function 'WMCreateScaledBlendedPixmapFromFile'

(And maybe a few more I missed)

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-20 15:31:57 +01:00
Christophe CURIS
9740c02403 wrlib: re-introduce the optimize_for_speed flag for binary compatibility
The commit #d1f9b801 removed it because the code behind it is actually
useless, unfortunately removing the flag itself from the structure is
breaking the compatibility of the API.

To avoid problems, this patch re-introduces the flag in the structure, but
not the code behind it so it is useless, and adds an attribute so that gcc
will report its use as deprecated, to help application migration.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-20 15:31:57 +01:00
Ioan Moldovan
89295b91fb wmaker: improve the behaviour of window resizing by user
The original behaviour was a bit frustrating because it used the first
small mouse move to deduce the user's wished direction, but that is a bit
imprecise.

This patch divides the window in 9 rectangles:
 - 4 for corners, used for diagonal resizing
 - 4 for middles of sides, for resizing Up, Down, Left and Right
 - 1 useless in the middle of the the window, which falls back on diagonal
resizing
This leads to a more predictive behaviour.
2014-07-20 15:31:57 +01:00
Christophe CURIS
029846dd14 doc: add a few more suggestions for people willing to contribute
Recommend usage for the configure flag 'enable-debug' when testing code and
invite to make use the the checkpatch.pl script.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Christophe CURIS
765814e393 util: add explicit types for calback functions definitions
It makes the code easier to read to explicitly define a type for the
functions that are used for callbacks, so this patch does this for the
wmmenugen tool.

It was an opportunity to highlight some variable definitions that looked
like function prototypes, and were as such misplaced in the code, being a
source of confusion.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Christophe CURIS
b75ac967d9 util: clarify a bit of the code for parsing commands in wmgenmenu
When a command is given for a menu to be run through a terminal, there is
a piece of code that removes everything from a '!' to the end of the line.

The original code was too dense and not really optimal, so this patch
proposes a more explicit code, mainly for maintainability.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Christophe CURIS
f90df24915 util: update wmiv after the RFlipImage API change in wrlib
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Christophe CURIS
18d77de91c WPrefs: grouped items related to the texture selection 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.

By merging everything in a single struct array it is a lot easier to
maintain this list.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Christophe CURIS
2925e54bc1 WPrefs: grouped items related to the color selection 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.

By merging everything in a single struct array it is a lot easier to
maintain this list.

Took the opportunity to properly document a little hack which is used to
avoid complex handling for a special case.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Christophe CURIS
2c9e500b88 WPrefs: replaced NULL terminated lists by 'wlengthof' usages
When a list has a fixed size, it is better to use the size of the list
instead of an end-of-list mark because it avoid unnecessary memory usage
and ease compiler's optimisation task.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Christophe CURIS
0d66ba5735 wmaker: simplify the code for the Xkb event handler
The code uses an extra variable that is specific the the Xkb code but it
is not really needed, removing it makes the code simpler, thus easier to
maintain.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Christophe CURIS
d31472773b wmaker: remove checks on variables that have already been checked
In the function that creates the background image for the switch panel
there are a number of checks on the size of the image, but this has
already been checked at the beginning of the function with an early return
in this case.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Christophe CURIS
30c8c1c645 wmaker: removed variable whose value never changed
In the function wHandleAppIconMove there is an event handling loop
which was supposed to be finished with the variable 'done'.

As the code is using 'return' inside the loop, which is both more
convenient and easier to read, this variable was never set, making
the loop an infinite looking loop.

This patch removes the variable so it will be clear how it behaves.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Christophe CURIS
1bac0c9dcb wmaker: fixed flag to avoid reloading config multiple times
The code includes a check whose goal is to avoid reloading more than once
the configuration, in case Inotify would report more than one change during
the event processing.

But the flag was not set so mechanism was ineffective, which is probably
ok anyway but as it is here let's make it work.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Christophe CURIS
af059d408b WINGs: optimisations to 'WMReadPropListFromPipe'
The function did spend its time re-copying data and searching the
end of the read buffer, which is not really efficient.

The new code reads directly from file to the end of previous data,
avoiding unneccesary duplication, and keeps track of the end of
data to avoid searching it for next read.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Christophe CURIS
654dcfeb28 wrlib: merged both R*FlipImage function into one for the public API
It is generally not a good idea to have an API with a high number of
functions because it adds complexity for user and for maintainability,
so both function have been "merged" into a single RFlipImage with
a parameter to specify what flip is expected.

As a bonus, the function can perform both flips at once if wanted.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Christophe CURIS
cd29983e03 wrlib: do not create an alpha channel if the original image did not have it in RFlipImage
As it does not cost anything in the current code to not add this channel,
it is then probably a good idea to keep the output image with the same
format as the input image, this avoid wasting +33% of memory for something
that may be at best unused and at worst will induce extra cost when
manipulating the image.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Christophe CURIS
f2dea1b840 wrlib: code refactoring in RFlipImage functions
Instead of calling all variables with variants of 'image', changed
the name to reflect what image it is about for clarity.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Christophe CURIS
f85066a19e wrlib: move fixed angle rotation code to dedicated functions
The function RRotateImage contains code to handle efficiently the 4 simple
angles 0, 90, 180 and 270 degrees, which makes it a long function.

This patch separate the code for the different cases into dedicated
functions so the main function's code ends up being simple (aka: easier to
understand/review/maintain).

As a side effect, the function for the 180 degree function is not static
because it can be reused to flip an image both horizontally and vertically.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Alwin
be5d04525d Catch-up with new strings, and overall improvements of the Dutch language files
Catch-up with new strings, and overall improvements of the Dutch language files
2014-06-21 00:13:10 +01:00
Christophe CURIS
b431dcc399 util: cosmetic updates to the list of terminals for wmmenugen
Added a comment to describe each terminal, so it will be easier to maintain
the list in the future; added const attributes to help compiler generate
better code; changed list parsing to use the size of the array instead of
a null pointer mark for better compiled result.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-16 20:00:09 +01:00
Christophe CURIS
ecbee34f3a Removed definitions of dangerous macro RETRY that does not work as expected
This macro supposes that the called lib function clears the 'errno'
variable on success which is not the case. The macro was (luckily) not
used in these file yet, by removing it we make sure it won't happen.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-16 20:00:09 +01:00
Christophe CURIS
35b912dd25 util: rewrote path building in makeThemePack
Use a better name for local variable and allocate the (almost) correct
number of characters for the path instead of a fixed offset that could be
a problem if the constant part of the path were to be updated.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-16 20:00:09 +01:00
Christophe CURIS
d90c8d5370 util: add check for size validity (Coverity #50224)
As pointed by Coverity, when reading the size of data using 'readmsg' that
size cannot be fully trusted (possibly in case of bugs in present case),
so this patch adds a check to ensure it is valid before continuing.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-16 20:00:09 +01:00
Christophe CURIS
8e9c06627d util: replaced sprintf with snprintf to avoid buffer overflow (Coverity #50220)
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-16 20:00:09 +01:00
Christophe CURIS
36ac3b3344 util: fix possible buffer overrun in the function that create L2 menus (Coverity #50219)
As pointed by Coverity, the buffer used to store the command for the menu
has a fixed size, so a check is welcome to avoid buffer overflow.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-16 20:00:09 +01:00
Christophe CURIS
7c142f54d0 util: add proper check for null pointer in wmsetbg (Coverity #50198)
As pointed by Coverity, it is possible that the variable 'image' remains
NULL in the function parseTexture, so this case must be checked
appropriately where it is used.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-16 20:00:09 +01:00
Christophe CURIS
3250826215 util: fix leaks in wmsetbg's changeTextureForWorkspace (Coverity #50169)
As pointed by Coverity, some locally created PropList objects are not freed
when the function returns. The truth is their refCount is 1 more than what
they should be, but that's more than what Coverity can detect today.

This patch adds the appropriate release calls when they are not needed
anymore, which will actually not free them but get their refCount right so
they will be freed as soon as the PropList in which they are used are
released.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-16 20:00:09 +01:00
Christophe CURIS
e5ebe0cb92 util: fixed memleak in wmsetbg's updateDomain (Coverity #50167)
As pointed by Coverity, the function wstrconcat is allocating memory to
return its result, which is not freed in old coding of the function.

This patch uses a local storage buffer to have a simpler code to generate
the command to bu run with 'system' without leak.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-16 20:00:09 +01:00
Christophe CURIS
9cef8c882e util: fix image leak in wmsebg's parseTexture (Coverity #50166)
As pointed by Coverity, in some case of texture with image that needs to
be scaled the temporary scaled image would be leaked if and error occured
during its conversion.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-16 20:00:09 +01:00
Christophe CURIS
1a9ece0438 util: fix leak in getstyle's makeThemePack (Coverity #50164)
As pointed by Coverity, the function is creating a temporary array with
the list of keys of the Style dictionnary, but it was not freed in the end.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-16 20:00:09 +01:00
Christophe CURIS
f2a7f233e3 util: remove unnecesary allocation in addWMMenuEntryCallback (Coverity #50161)
As pointed by Coverity, the string passed to 'findPositionInMenu' is not
freed, and as the function does not modify it it is not necessary to
allocate a new storage for the argument.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-16 20:00:09 +01:00
Christophe CURIS
75511e2ec8 util: fix leak in setstyle (Coverity #50151+#50152)
As pointed by Coverity, there are a few cases where the list of the keys
of a dictionary is being requested, but at the end the array that was
created to hold these keys was not freed.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-16 20:00:08 +01:00
Christophe CURIS
2e7ca448ae util: fix misleading indentation in assemblePLMenuFunc (Coverity #50094)
As pointed by Coverity, the indentation for a block of code could lead to
misinterpretation on when it is executed. To make code safer, re-indented
the code properly and added some blank lines for clarity.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-16 20:00:08 +01:00