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

1467 Commits

Author SHA1 Message Date
David Maciejak
f40095ac9e wmaker: add new button and wheel mouse actions
This patch is adding atomic mouse actions to mouse buttons to:
-focus on previous or next window
-move to previous or next workspace

and adding wheel action to
-switch between windows

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
David Maciejak
39f6130a28 wmaker: use defined wWindowSingleFocus() function
This patch is cleaning focuswindow() local function to call
wWindowSingleFocus() global function.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
David Maciejak
36b9f6cb23 wmaker: add next and previous window focus functions
This patch is adding a wWindowFocusPrev() and wWindowFocusNext() functions.
And copying switchmenu.c focusWindow() as wWindowSingleFocus().

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
David Maciejak
0399d70868 wmaker: merge reading menu duplicate code
This patch is adding a readMenu function to be called from
readMenuPipe and readMenuFile, saving about 20 lines of code.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:02 +01:00
David Maciejak
118beb2c60 wmaker: improve key shortcut labelling
This patch is improving the key shortcut labelling in the root menu.
It modifies the GetShortcutString function to save some cycles
as wXModifierFromKey is already doing all the string comparisons.
This patch introduces a new function called wXModifierToShortcutLabel
that is checking the return value from wXModifierFromKey.
Not sure why Control was set as a special key, as keyboards could
have 2 controls but also 2 shift keys.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:02 +01:00
David Maciejak
9c381862b3 wmaker: implement EWMH _NET_WORKAREA
This patch is adding the _NET_WORKAREA property
which according to EWMH spec MUST be implemented.
Some application like rdesktop or nautilus are using
it, that's maybe why you encountered some errors like these:

** (nautilus:6457): WARNING **: Can not get _NET_WORKAREA
** (nautilus:6457): WARNING **: Can not determine workarea, guessing at layout

For now, the property is only updated when a workarea is created or destroyed.
2014-08-29 12:43:50 +01:00
David Maciejak
fec8347d27 wmaker: make disable mouse actions a live set
This patch is allowing to enable or disable the 'disable mouse actions'
from the WPrefs app without requiring to restart the session.
2014-08-29 10:11:55 +01:00
David Maciejak
2406256d48 wmaker: add support for more mouse buttons
This patch is adding support for back/forward mouse buttons
and the left/right wheel tilt buttons.
2014-08-27 13:55:54 +01:00
David Maciejak
556b0d77a1 wmaker: update src/action.c coding style
This patch is updating the coding style based on checkpatch output
and as suggested by Rodolfo it also inverts the condition test
in getAnimationGeometry fct to return earlier when possible.
2014-08-25 10:42:29 +01:00
David Maciejak
9cb4388180 wmaker: fix control shortcut label in window menu
This patch is fixing the shortcut label used in window menu.
As now when a 'control' shortcut was used, the label displayed
was 'bug' cause GetShortcutString fct which is calling wXModifierFromKey
fct was waiting for a 'Control' static string not the default one
set to 'Ctrl' string.
2014-08-25 10:42:29 +01:00
David Maciejak
371818fe36 wmaker: fix deiconify window on double-click
This patch is fixing the RenderBadPicture X errors on deiconifying
window using double-click.

Background:

I also experienced this issue these days, after checking it was not
introduce with latest apercu feature I decided to dig into it.
As far as I saw in the archive it was first reported by Rodolfo in June 2012.

Each time a window is deiconify using double-click, the error below
is reported in the session error log:
wmaker(catchXError(startup.c:177)): warning: internal X error:
RenderBadPicture (invalid Picture parameter)
        Request code: 152
        Request minor code: 7
        Resource ID: 0x6000a4
        Error serial: 9269

So I decided to track when the issue is happening,
from src/action.c wDeiconifyWindow then in src/icon.c wIconDestroy
then in src/wcore.c wCoreDestroy.
At that stage, all the structures I checked are cleaned up properly
during the icon destroy process.

So I also checked when the issue is generated, I ended in
wrlib/xutil.c RCreateXImage (in the share memory extension code)

             XSync(context->dpy, False);
             oldErrorHandler = XSetErrorHandler(errorHandler);
             XShmAttach(context->dpy, &rximg->info);
             XSync(context->dpy, False);
             XSetErrorHandler(oldErrorHandler);

At this point I was quite lost, cause it means the error could
have been in the server error queue already.

Facts, seems the issue is appearing only on double-clicking the miniwindow,
but not when "Deminiaturize" is clicked from the right-click contextual menu.
I also checked the code from winmenu.c when the action MC_MINIATURIZE
is selected from execMenuCommand fct, but it was just calling
wDeiconifyWindow function. Hum.

So, after one full day of thought I tested to just change the focus before
double-clicking the miniwindow, and bingo it works.
That means when the icon is destroyed the X server still has a reference
on it that's generating the issue.
2014-08-25 10:38:12 +01:00
David Maciejak
adebdf41c6 wmaker: src/action.c merge duplicate code
This patch is merging some duplicate code related
to animation position.
2014-08-22 23:41:58 +01:00
David Maciejak
ef659ca1fb wmaker: fix src/dock.c code typo
This patch is renaming the colectIconsCallback name function.
2014-08-21 00:57:15 +01:00
David Maciejak
6b5e589d09 wmaker: update docked application balloon text
This patch is displaying the number of application instance
run directly in the balloon text (and I also run checkpatch.pl).
2014-08-21 00:49:59 +01:00
Carlos R. Mafra
5da2fcb7e3 apercu: Make preview size a configuration option
Since the resolution of the Retina display tends to make everything small,
the default apercu preview size (twice the icon size) couldn't be used to
distinguish the window contents without tiring too much my eyes.

Therefore, let's make the apercu size a configurable option. You can set
it through the ApercuSize variable with

$ wdwrite WindowMaker ApercuSize 4

in multiples of the icon size (in this case the apercu size will be four
times the icon size).

The default size remains 2 (twice the icon size).
2014-08-20 18:11:37 +01:00
David Maciejak
c6c7652e24 wmaker: add miniwindow apercu
This patch is adding miniwindow apercu when the mouse
is over the miniwindows.

To enable it you have to run WPref, in Miscellaneous Ergonomic
Preferences, check miniwindow apercus.
Then, you will be able to see a screenshot of the app when the mouse
is over the miniwindow.
2014-08-20 11:52:01 +01:00
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
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
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
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
Iain Patterson
bb9f91a355 Consistent terms for switch panel cycling.
The terms "switch panel" and "cycling" have been used in Window Maker
since time immemorial but have not always been applied consistently.
2014-06-15 19:45:20 +01:00
Christophe CURIS
6c3cd08dad wrlib: return NULL if XImage could not be taken, for consistency
To be consistent with RCreateXImage and because it should not be up to the
caller to handle this, when XGetImage returns a NULL pointer then the
function RGetXImage will also return NULL instead of an RXImage structure
with a NULL pointer.

This consistent behaviour helps fixing a memory leak in WMaker reported by
Coverity (#50125).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-15 19:45:20 +01:00
David Maciejak
5f1e25152c wmaker: darken labels from docked application settings
This patch darkens DnD labels when support is not compiled in.
2014-06-15 19:45:20 +01:00
David Maciejak
1bd9074464 WMaker: src/misc.c remove obsolete code
This patch is removing the call to get_dnd_selection function
which was removed long time ago.
2014-06-15 10:11:55 +01:00
Amadeusz Sławiński
dda7f48407 wmaker: alt-tab to shaded windows when "SwitchPanelImages = None" is set
Reported-by: Josip Deanovic <djosip+news@linuxpages.net>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2014-05-26 00:20:32 +01:00
Amadeusz Sławiński
e749c455c6 wmaker: raise shaded window when alt tabbing
Reported-by: Josip Deanovic <djosip+news@linuxpages.net>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2014-05-26 00:20:32 +01:00
Christophe CURIS
1265873fa3 WMaker: removed use of dangerous RETRY macro in GetCommandForPid for Linux (Coverity #50267)
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>
2014-05-20 21:29:57 +01:00
Christophe CURIS
1a64ca8275 WMaker: change conceptually imperfect code in drawerDestroy (Coverity #50265)
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>
2014-05-20 21:29:57 +01:00
Christophe CURIS
68e4ccca58 WMaker: removed check that is always true in wDefaultsInitDomain (Coverity #50243)
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>
2014-05-20 21:29:57 +01:00
Christophe CURIS
788a51c116 WMaker: fix memory leak in the window inspector when saving settings (Coverity #50175)
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>
2014-05-20 21:29:57 +01:00
Christophe CURIS
e750f9307e WMaker: fix memory leak in the window inspector when saving settings (Coverity #50174)
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>
2014-05-20 21:29:57 +01:00
Christophe CURIS
a75699faef WMaker: fix possible memory leak in the icon chooser dialog (Coverity #50173)
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>
2014-05-20 21:29:57 +01:00
Christophe CURIS
bec0272584 WMaker: fix dangerous code in file scanning for wAdvancedInputDialog (Coverity #50172)
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>
2014-05-20 21:29:57 +01:00
Christophe CURIS
32c8dc04ce WMaker: fix memory leak in windows saved state handling (Coverity #50171)
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>
2014-05-20 21:29:57 +01:00
Christophe CURIS
4501d4c078 WMaker: fix memory leak when respawning after crash (Coverity #50165)
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>
2014-05-20 21:29:57 +01:00
Christophe CURIS
659519f306 WMaker: fix memory leak in the crash handling dialog (Coverity #50163)
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>
2014-05-20 21:29:57 +01:00
Christophe CURIS
c2a357fe1b WMaker: fix memory leak in app icon changing (Coverity #50139)
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>
2014-05-20 21:29:57 +01:00