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.
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
...
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.
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.
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
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.
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.
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>
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>
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>
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>
As reported by Coverity (CID #331553), we leak the allocated string
returned by 'WMGetTextFieldText'
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
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>
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>
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>
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.
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).
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.
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".
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.."
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>
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>
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>
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>