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

638 Commits

Author SHA1 Message Date
David Maciejak
e9b20b51e9 WPrefs: check if captured keyboard shortcut is not in use
Make sure the captured keyboard shortcut is not already in use
by another action, if it's the case an error popup is shown and
the key is not kept.
2023-02-25 13:31:42 +00:00
David Maciejak
fabd4252ab Allow exit panel to be bound to a key shortcut
While debugging the save/restore workspace state, I found quite
useful to be able to exit windowmaker using a key shortcut.
2023-02-20 15:00:55 +00:00
David Maciejak
d70b546f2e Fix wrong XKeycodeToKeysym index value
XKeycodeToKeysym was deprecated some time ago and wmaker code was patched to use the definition from XKBlib instead.
(https://repo.or.cz/wmaker-crm.git?a=commit;h=0382dd5dd7ecae2112a0c6366eaf9e6ab68ad354)

Before being deprecated,  XKeycodeToKeysym was prototyped at X11/Xlib.h as
KeySym XKeycodeToKeysym(display, keycode, index)

Now it's available in X11/XKBlib.h as
KeySym XkbKeycodeToKeysym(display, keycode, group, level)

Basically level now which is the 4th parameter is our old index variable (3rd parameter).

On systems which don't have xkb supported the value set for index is wrong.
As seen in old patch at https://repo.or.cz/wmaker-crm.git/blobdiff/139f912e618870cc7fd908099f203450547eb658..43c3526d2120712f72579398b73ef92283d9078b:/WPrefs.app/MouseSettings.c
we should pass the l value to old XKeycodeToKeysym function and not the 0 value which is used for the group in the new XkbKeycodeToKeysym definition.
2023-02-11 10:30:52 +00:00
Torrance, Douglas
7639fa1c15 Add "KeepDockOnPrimaryHead" checkbox to WPrefs experts panel 2023-01-15 00:18:34 +00:00
Torrance, Douglas
66b0ee3c4d Add WPrefs to XDG desktop menu
We include a desktop entry file for WPrefs so that it will be included
in XDG-compatible menus.  See the specifications at:

https://specifications.freedesktop.org/menu-spec/menu-spec-latest.html
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
2022-02-17 22:31:18 +00:00
Christophe CURIS
fb2a6d2e61 WPrefs: Use the constants added in config-paths.h for paths
Replace hard-coded directory names by the constants that have been
previously added to the common header.
2021-08-10 09:42:43 +01:00
John D Pell
bd38778bef Use wuserdatapath() everytime it is applicable
Replace calls to wusergnusteppath() which just append "/Library" by calls
to wuserdatapath().
Take opportunity to replace hardcoded "/WindowMaker" directories with
the existing PACKAGE_TARNAME macro (which comes from autotools).

The choice of 'TARNAME' is because it meant to be used in filename, thus
less likely to have problematic characters than PACKAGE_NAME (meant for
display purpose) and PACKAGE which is there for historical reason.
2021-08-10 09:42:43 +01:00
John D Pell
5c90ed9d2d WPrefs: Use wdefaultspathfordomain() to build path to the root menu file
For the Menu edition tab, when building the path to the file that contains
the menu data, rely on wdefaultspathfordomain instead of constructing the
path with many hard-coded names.
2021-08-10 09:42:43 +01:00
Christophe CURIS
ae78e88eef Repair compilation when Pango support is enabled
It seems there have been changes in the way Pango's header files are
installed in recent versions, probably to allow having multiple versions
together on a system.

Because one public header from WINGs has to include Pango's header, we must
include the search path provided by Pango into our WINGs search path that
are returned by pkg-config (the .pc file).

They are then also added to WindowMaker and WPrefs which use the header but
can't rely on the path from the .pc file which has not been installed yet.

Reported-by: Carlos R. Mafra <crmafra@gmail.com>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-29 23:55:10 +01:00
Doug Torrance
4221e30bd2 Convert WPrefs.app/po/README from iso-8859-1 to utf-8 2021-05-25 22:12:23 -04:00
Christophe CURIS
0e274dc979 WRaster: Fix incorrect use of macro USE_XSHM in installed header
The header "wraster.h" needs different behaviour depending on whether the
support for X Shared Memory extension was enabled or not; but the related
macro USE_XSHM is defined by WindowMaker's configure. After this header
have been installed, the macro is no more useable.

This patch makes the "wraster.h" a generated file, so it will be different
depending on USE_XSHM, but will not make use of the macro itself.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:50:43 +01:00
Christophe CURIS
8e47ca8e62 WPrefs: Add check for invalid OPEN_MENU/EXEC in PL-Menu to avoid potential crash
As reported by Coverity (CID #50047, #50048), if the proplist is incorrect
and has an OPEN_MENU or (SH)EXEC command without its arguments, we did
dereference a NULL pointer.
Now we simply return the NULL value, appropriate to have the caller of the
function issue a message.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS
29cf48b934 WPrefs: Provide fall-back colour in the case of colour name not found
As reported by Coverity (CID #331571), we did not check the return value of
the call to XParseColor. If the function is given a colour name that it
does not know, we would return an uninitialised colour.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS
7c50721747 WPrefs: Fix memory leak in Expert tab
As reported by Coverity (CID #331553), we leak the allocated string
returned by 'WMGetTextFieldText'

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS
4559cbbccc WPrefs: Fix memory leak in the Menu tab
As reported by Coverity (CID #331559), the call to 'wfindfile' replaces
the value for variable 'path' but we did not free its previous content.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS
fd56152202 WPrefs: fix memory leak and potential buffer overflow
Coverity pointed that the "text" returned by WMGetTextFieldText was never
freed (CID #331578, because WMSetTextFieldText does its own copy, it does
not take the pointer as-is).

By looking at the code, there is also a potential buffer overflow because
the buffer alloc'd for "value" is sized for the exact number of digits
before increase, but the +delta can make the number use more digits so we
may write past the end of original buffer.
We write to a stack-allocated one, so it does not cost anything and does
not participates to memory fragmentation.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS
fc63d72032 WINGs: Fix incorrect use of macro USE_PANGO in installed header
The header "WINGsP.h" needs different behaviour depending on whether the
support for Pango was enabled or not. But the related macro USE_PANGO is
defined by WindowMaker's configure, and after this header have been
installed the macro is no more valid.

This patch makes the "WINGsP.h" a generated file, so it will be different
depending on USE_PANGO, but will not make use of the macro itself.

As a side effect of being now generated, the include paths in the makefile
have been updated to include build-dir too, because for users doing an
out-of-tree build the generated file (that is used during compilation) is
placed in the build-dir.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Xander
9abe4165d1 Add icon sizes
The classic WindowMaker allows tile icon size up to 96x96 px. This patch rises this value
to 256x256 px. It also sets the max number of visible items in the corresponding pref list
to 29 (instead of 9), so the new values show up in the list. This patch makes it possible
to use dockapps that allow changing their size to bigger than 64x64 px, see
https://gitlab.com/xander1988/dockapps for more info.
2021-05-07 18:02:03 +01:00
Helge Kreutzmann
224cb403a7 Tippfehler in de.po von WPrefs (WindowMaker)
per Zufall habe ich einen Tippfehler gefunden
2020-12-07 16:53:16 +00:00
Alexander Komarov
7d423a3a0f Added Expert option: "Close rootmenu when mouse (left or right) is clicked outside focus.
Common WindowMaker's rootmenu behavior if press right mouse button open menu and close only with same button.
It's uncomfortably, it patch  allows close menu by left or right is clicked outside focus.
Changed func "static WMenu*configureMenu(WScreen *scr, WMPropList *definition)" to non-static forglobal use.
Added new  OPTION_WMAKER for this Expert-option. Changed event.c: for correct work should use initialization
func configureMenu afterwMenuDestroy (this is a feature of the event implementation XEvent).
2020-09-13 16:56:09 +01:00
Alexander Komarov
033d2d9a6f Changed Russian translation 2020-08-11 10:49:13 +01:00
Alexander Komarov
6e2075f3df Double click on titlebar maximize a window to fullscreen 2020-08-10 12:15:01 +01:00
XOR
5d2fd7bf7e WPrefs: Create Turkish translation 2020-06-28 17:54:15 +01:00
Doug Torrance
44bc9cc264 Fix various abs() issues.
The abs() function should take an int as argument, but there were
several instances in the code where it was taking an unsigned int or a
double.  In these case, we took one of the following approaches:

* If the argument was a double, use fabs() instead.
* If the argument was unsigned and was certainly going to be positive
  (i.e,. no subtraction), then drop abs() altogether.
* If the argument was unsigned as result of adding or subtracting signed
  and unsigned ints, then we cast all the unsigned ints to signed ints.
2020-04-18 19:49:26 +01:00
Doug Torrance
54a24ab6f7 Remove trailing whitespace.
Also, the script is a one-liner, stolen from [1]:

ack --print0 -l '[ \t]+$' | xargs -0 -n1 perl -pi -e 's/[ \t]+$//'

[1]
https://stackoverflow.com/questions/149057/how-to-remove-trailing-whitespace-of-all-files-recursively
2020-04-09 14:28:09 +01:00
Doug Torrance
a17d131da3 Remove apostrophes from instances of possessive "its".
I noticed one instance of this while looking at the code the other day,
and after a quick grep, realized it happened a *lot*!  One of the many
frustrating things about the English language is that we use apostrophes
to make pretty much everything possessive *except* the pronoun "it".
In that case, we use "its".  "It's" is reserved for the contraction
meaning "it is" or "it has".
2020-04-09 09:05:50 +01:00
David Maciejak
91f8e21668 WPrefs: fixed malformed TIFF file generating libtiff warnings
The original ergonomic.tiff file samples/pixel property was wrong which was generating the warning message from libtiff
"TIFFReadDirectory: Warning, Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.."
2020-03-28 01:02:56 +00:00
David Maciejak
5f18f60fd2 WPrefs: increased open submenu label size
Give more space for the open submenu label to be displayed properly
2020-03-28 01:02:41 +00:00
Rodolfo García Peñas (kix)
de09ac5dad WPrefs.c Removed format-overflow warning
This patch adds some characters to the mbuf buffer, to allow the buffer size and some extra characters.

WPrefs.c: In function ‘loadConfigurations’:
../src/wconfig.h:400:17: warning: ‘%s’ directive writing up to 1023 bytes into a region of size 1018 [-Wformat-overflow=]

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix)
3dce639aae Appearance.c Removed fallthrough warning
This patch adds some comments to remove the falthrough warning.

Appearance.c: In function ‘renderTexture’:
../WINGs/WINGs/WUtil.h:230:32: warning: this statement may fall through [-Wimplicit-fallthrough=]
 #define wwarning(fmt, args...) __wmessage( __func__, __FILE__, __LINE__, WMESSAGE_TYPE_WARNING, fmt, ## args)
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Appearance.c:675:4: note: in expansion of macro ‘wwarning’
    wwarning(_("unknown direction in '%s', falling back to diagonal"), type);
    ^~~~~~~~
Appearance.c:676:3: note: here
   case 'D':
   ^~~~

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Christophe CURIS
070f0ad8f4 WPrefs: Dead code removal
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2019-02-22 16:08:36 +00:00
Christophe CURIS
2913ac0f09 Do not allocate memory for a temporary buffer
This kind of things participates in memory fragmentation, so it is
generally a bad practice when an on-stack allocation is enough.
Took opportunity to reduce the buffer size, there's no point in
overallocating memory (the new size being still way too much).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2019-02-22 16:08:36 +00:00
Christophe CURIS
dae63b5e96 WPrefs: Prefer use of 'sizeof' instead of hard-coded values
Hard-coding a value is prone to errors when maintaining the code; using the
builtin C macro 'sizeof' is a much safer choice.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2019-02-22 16:08:36 +00:00
Tim Taenny
5a95631091 Added expert option for WrapAppiconsInDock property to WPrefs
In 2013 Daniel added the functionality to wrap icons, which are
attached to the dock, around the screen edges when the dock is
being moved vertically.
This patch adds an expert option to WPrefs.app for setting the
property which enables/disables this feature.

Remark: In my opinion, the default value for that property should
        be changed to NO, as this is also the default behavior in
        NeXTSTEP. It is handy to be able to move all these icons
        out of sight when working with maximized application
        windows.
2019-02-05 21:32:04 +00:00
Tim Taenny
d6c1ac3ecf Added icon feature option to WPrefs: Enforce icon margin
The current findBestIcon function usually selects an icon image
that almost completely fills up the (default) 64x64 pixels of an
icon. As Dan noted in the function, the icon images should use only
75% of the available space, which would result in room for the
miniwindow title and better overall aesthetics.

This feature option provides for enabling such an automatic "icon
shrinking" functionality.

Note: This commit only introduces the new option, not the actual
      image shrinking.
2019-01-31 17:22:49 +00:00
Tim Taenny
9b5eaa3d3e Use popup button for animation style instead of option group in WPrefs
To make some room for an additional icon option (yet to be committed)
the options group for selecting the iconification animation is
replaced by a popup button. This allows for adding at least two more
checkboxes in the options and makes adding new animation styles less
painful.
2019-01-31 17:22:49 +00:00
Gaspar Chilingarov
8b919b0d33 support moving window between heads using keyboard
Window Maker allows to perform practically all operations with windows
using only keyboard. One of the actions so far which required using
mouse was dragging window from one head (monitor) to another.

This patch introduces support for keyboard shortcuts. These shortcuts
move windows in circular fashion (if you have 3 and more monitors).

In case of 2 or 3 monitors arranged horizontally - window will just move
right/left.

In case of 3x3 setup - it is impossible to move window to central
monitor with keyboard.

- preserves window position and size (if display sizes are same)
- otherwise tries to fit window to smaller display
2018-12-16 10:13:50 +00:00
Alwin
6cfc71d40a Translations: Frisian language files for WPrefs and menus updated
Compacting two translations to fit the available space; two new strings.
The menus are now split like the English ones, using appearance.menu.fy
and background.menu.fy. A new comment was added to menu.fy.in.
2017-09-14 21:08:26 +02:00
Alwin
ccc676a2bf Translations: Dutch language files for WPrefs and menus updated
Compacting a translation to fit the available space; two new strings.
The menus are now split like the English ones, using appearance.menu.nl
and background.menu.nl. A new comment was added to menu.nl.in.
2017-09-14 21:08:26 +02:00
Doug Torrance
2dbd778ed4 WPrefs: Inform user which menu file is being edited. 2017-08-19 15:59:13 +01:00
Doug Torrance
f63635dd17 WPrefs: Save menu back to the file we read it from.
Previously, we saved any modifications back to WMRootMenu, regardless of
the file we read the menu from.
2017-08-19 15:59:13 +01:00
Doug Torrance
97702618de WPrefs: Display warning when attempting to modify a read-only menu file. 2017-08-19 15:59:13 +01:00
Doug Torrance
02cc702029 WPrefs: Edit proplist menus referenced by WMRootMenu.
Previously, WPrefs could only be used to edit the menu specified in
WMRootMenu.

In a recent commit, the ability to specify a menu in proplist format defined
in another file which is referenced by WMRootMenu was added.  However, if a
user attempted to edit such a menu in WPrefs, an error dialog appeared.

We add the ability for WPrefs to read such a menu.  After the user makes any
changes, the result is stored in WMRootMenu, and *not* the original file.
2017-08-19 11:14:38 +01:00
Doug Torrance
8fba9945e0 WPrefs: Properly read system fonts in font configuration panel.
Previously, only the user's WMGLOBAL file would be read to determine the
current WINGs fonts (System Font and Bold System Font) in the Font
Configuration panel.  It is quite possible that this information would
not be in the user's WMGLOBAL file, but instead in the system WMGLOBAL
file.

We instead use the WMDefaultSystemFont and WMBoldDefaultSystemFont
functions to get this information.
2017-03-20 18:06:12 +00:00
Doug Torrance
fa8121ee61 wmaker/WPrefs: Remove legacy support for deprecated apercus.
Replaced by minipreviews in December 2014.  Over two years have passed.
2017-03-12 00:12:18 +00:00
Alwin
d4a0b2f115 Translations: Frisian language file for WPrefs updated
A few new entries were translated.
2017-03-10 14:53:38 +00:00
Alwin
2411298ff6 Translations: Dutch language file for WPrefs updated
A few new entries were translated.
2017-03-10 14:53:38 +00:00
c9fbcda0b0 New option for moving mouse pointer along with half-maximized windows.
This option might be usable for using keyboard for moving windows
around. This option will enable moving mouse pointer for such windows.
2017-02-21 19:24:36 +00:00
9e7987713f New option for enabling alternative half-maximized window movement.
Added new option to Window Maker for enabling alternative way for
half-maximized windows movement. Option can be found on Expert section
in WPrefs app.
2017-02-21 19:24:35 +00:00
160f879cce Fixed wrong (re)stored dimensions for unmaximized window. 2017-02-13 20:01:53 +00:00