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

655 Commits

Author SHA1 Message Date
David Maciejak
ab45c6c6c2 Add central position feature for active window
This patch adds a new Central feature under the window menu
"Other maximization" entry.
Shortcut can be configured via WPrefs "Center active window" action.
When called the active window is centered on the screen head.
If the window height or width are bigger than the head size,
the window is resized to fit.
There are some transitions defined as below:
*from fullscreen to center
*from any corner to center
*from top half to center top half
*from bottom half to center bottom half
*from left half to center left half
*from right half to center right half

Undoing the action is done via the window menu "Unmaximize" entry
or the shortcut.
2023-03-31 09:11:38 +01:00
David Maciejak
ecef2b2890 WPrefs: Hot corner preferences
Add a new "Hot Corner Shortcut Preferences" section to WPrefs
to configure the Hot Corners feature.
2023-03-26 10:35:33 +01:00
David Maciejak
91e7f37074 WPrefs: fix keyboard shortcut sorting order
That patch is fixing some Actions entries that are not sorted properly.
One is using some upper/lower cases.
And the other one, is displaying numbers while alphabetic sorting is not
working properly on numbers. For example:
Shortcut for window 1
Shortcut for window 10
Shortcut for window 2
...
2023-03-21 15:20:19 +00:00
David Maciejak
23471b2e21 WPrefs: update maximization feature descriptions
Align the old maximization descriptions to the new visual indicator
names. The internal shortcut names had also been updated, meaning a
reconfiguration of the shortcuts in WPrefs is required.
2023-03-16 11:36:02 +00:00
David Maciejak
43edd37ee2 Update file headers year copyright
Update copyright year for Window Maker Team entries.
2023-03-12 09:44:10 +00:00
David Maciejak
d045ffcf7d Add a screenshot capture feature
This patch adds a feature to take screenshots directly from Window Maker.
Having the feature embeded direclty inside Window Maker allows us to take
advantage of how Window Maker is managing and handling Windows.
Three new actions can be bound to a key shortcut from WPrefs.
The screenshot files are saved in ~/GNUstep/Library/WindowMaker/Screenshots/
dir, with a "screenshot_%Y-%m-%d_at_%H:%M:%S" format followed by the
extension. Preferably as a PNG or JPG file if available.
Meaning, to work Window Maker via WRaster needs to support
at least one of those format.

"Capture the entire screen" is quite standard, it takes a screenshot
of the whole screen area (even in multiheads env).
"Capture a portion of the screen" requires the user to draw a rectangle which
will be captured.
Those two first are quite straightforward, just taking a live picture of
the screen.
The last one is "Capture a window" which works in best effort mode,
it catures the focused window. As Window Maker by default is not using
any compositor (like for example Xcompmgr) it can only dump the content
displayed on the screen.
If a window is minimized or out of the screen, there is high chance the
image will be split or some area greyed in case other windows overlapped it.
2023-03-07 17:30:59 +00:00
David Maciejak
dd6fe27858 WPrefs: convert workspacename.xpm X11 color name to hex
On window maker built without libxpm, a simple build-in xpm support is used.
That component does not support X11 color name thus when trying to load
that image we are getting a file corrupted error.
Colors manually converted using ref at
https://www.ehdp.com/methods/x11-colors/x11-colors-rgb-values-05.htm
2023-03-05 00:16:44 +00:00
David Maciejak
a383074c99 WPrefs: sort alphabetically the key shortcut actions and expert options
There are too many entries now in key shortcut actions and expert options,
better to sort them dynamically.
2023-03-03 14:15:19 +00:00
David Maciejak
d4ee17f0b5 Coverity: fix WPrefs workspace negative array index read 2023-03-03 14:15:19 +00:00
David Maciejak
59a686d22e Coverity: fix WPrefs appearance negative array index read 2023-03-02 17:04:48 +00:00
David Maciejak
26d46f6e16 Coverity: fix WPrefs menu negative array index read 2023-03-02 17:04:48 +00:00
David Maciejak
ceafbf0629 Coverity: fix WPrefs mousesettings menu negative array index read 2023-03-02 17:04:48 +00:00
David Maciejak
cf178d011b Coverity: fix WPrefs preference negative array index read 2023-03-02 17:04:48 +00:00
David Maciejak
682c2767c2 Coverity: fix WPrefs texturepanel negative array index read 2023-03-02 17:04:48 +00:00
David Maciejak
e9717ed719 Coverity: fix WPrefs appearance time of check time of use 2023-03-02 17:04:48 +00:00
David Maciejak
9e59d19507 Coverity: fix WPrefs editmenu uninitialized scalar variables 2023-03-02 17:04:48 +00:00
David Maciejak
bc56db0776 WPrefs: use W_KeycodeToKeysym instead of XkbKeycodeToKeysym
This patch replaces XKeycodeToKeysym and XkbKeycodeToKeysym
in WPrefs by our own function W_KeycodeToKeysym.
2023-02-27 23:05:27 +00:00
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