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

3746 Commits

Author SHA1 Message Date
Doug Torrance
86659be668 wmlib: Use X flags from configure
We use the AC_PATH_XTRA macro to find all the X library paths during
build, but we weren't actually using the variables it generated for
building wmlib.  Instead, we just hardcoded the linker flag "-lX11",
which may or may not actually work.
2020-04-09 14:54:06 +01:00
Doug Torrance
e314f10909 configure: Fix typo in libXmu check.
As the literal string "wm_cv_xext_xmu" will never be equal to "xno",
we always ran the code that was supposed to run when the variable
$wm_cv_xext_xmu was not equal to "no".  In particular, if libXmu
was not found, then we proceeded as if it had been found.
2020-04-09 14:54:06 +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 Michael
6320bb6219 configure: Allow changing default search paths
This changes the behavior of the --with-{inc,lib}s-from arguments
to replace the default paths instead of adding to them.  This is
required when cross-compiling in a sysroot, since the default paths
will include files from the host system which can have an
incompatible architecture.
2020-04-06 16:35:53 +01:00
Carlos R. Mafra
f9bc310fa6 Window Maker 0.95.9 wmaker-0.95.9 2020-04-04 11:02:28 +01:00
Carlos R. Mafra
58249c2b9b Update .gitignore file 2020-04-04 10:55:42 +01:00
David Maciejak
bb716a4ca1 util: renamed wmiv DEBUG constant name
To prevent compilation warning message saying DEBUG name is already defined
2020-03-28 10:13:11 +00: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
David Maciejak
a215869067 wrlib: Fixed warning msg using libpng
Call png_set_interlace_handling() to get rid of the warning message "libpng warning: Interlace handling should be turned on when using png_read_image"
2020-03-27 09:00:37 +00:00
David Maciejak
909deea70c bump copyright year in Info Panel
bump copyright year in Info Panel
2020-03-25 10:08:17 +00:00
David Maciejak
984a992d0e Fix typo
Renamed isPointNearBoder() function
2020-03-25 10:05:02 +00:00
nchilingaryan@aua.am
e82d86813e Update Armenian translation
I did some part of translatin back in 2008, now I fixed bugs and updated it
so that all the messages are translated.
2020-03-05 10:19:49 +00:00
Jeremy Sowden
d9bc96e497 strncpy's third argument should be the length of the dest buffer, not the source. 2019-08-06 11:04:05 +01:00
Jeremy Sowden
a7baed6cf7 Fixed expression checking whether flag is set. 2019-08-06 11:04:05 +01:00
Jeremy Sowden
a12f0d453a Fixed buffer size. 2019-08-06 11:04:05 +01:00
Jeremy Sowden
41193bdacd Fixed function-pointer compatibility. 2019-08-06 11:04:05 +01:00
Jeremy Sowden
a7f8e990db Added explicit fall-through comments to pacify GCC. 2019-08-06 11:04:05 +01:00
Jeremy Sowden
b59273f199 Added missing function declaration. 2019-08-06 11:04:05 +01:00
Haroldo
be922384ac slight increase in default switch panel icon size to improve border view 2019-07-28 23:05:28 +01:00
Haroldo
31f16b65a3 higher resolution images for switch panel 2019-07-28 20:21:14 +01:00
Haroldo
3665410377 make switchpanel configurable 2019-07-14 17:43:28 +01:00
Jeremy Sowden
4477ae4da4 Prefer TryExec to Exec when generating menu entries from XDG desktop files.
From the comments at the top of wmmenugen_parse_xdg.c:

  Since there is no passing of file name arguments or anything of the
  sort to applications from the menu, execname is determined as follows:

   - If `TryExec' is present, use that;
   - else use `Exec' with any switches stripped

However, Exec used to be preferred.  Changed code to prefer TryExec.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2019-06-20 22:06:36 +01:00
Jeremy Sowden
9330a021e5 Omit field-code in Exec fields when generating menu-entries from XDG desktop-files.
Exec fields in desktop-files may include field-codes which act as
place-holders for command-line arguments.  Previously the Exec arguments
were being passed through intact.  However, since Window Maker has no
support for expanding the field-codes, we now remove them and preserve
the remaining arguments.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2019-06-20 22:06:36 +01:00
Jeremy Sowden
41ab926090 Parse Exec fields when generating menu-entries from XDG desktop-files.
Exec fields in desktop-files are subject to escaping.  Unescape them.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2019-06-20 22:06:36 +01:00
Jeremy Sowden
b32ccee5cb Undo XDG string-escaping when generating menu-entries.
In XDG desktop files, string values are subject to escaping.  Undo this
when parsing them.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2019-06-20 22:06:36 +01:00
Jeremy Sowden
6734646265 Use pointers as parameters instead of pointer-to-pointers.
Some functions expected pointers-to-pointers where pointers would do.
Changed them to use pointers.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2019-06-20 22:06:36 +01:00
Rodolfo García Peñas (kix)
6a044fe5ae load_jpeg.c Return NULL
The image is NULL, we can return NULL here.

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)
6dd1498f7c load_jpeg.c Style
This patch is just coding style. Removes some empty lines,...

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)
090b761fde load_jpeg.c Removed dead code
This patch removes the code not used. Because the if block
check that buffer[0] is NULL, then, we don't need check it
again inside.

Image is not used yet, so is NULL. We can return NULL.

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)
49db946aa2 load_jpeg.c Clean code
This patch returns NULL, because the variable image is not used yet.

The patch also removes three lines:

- buffer[0] = NULL;       /* Initialize pointer to avoid spurious free in cleanup code */
  RErrorCode = RERR_BADIMAGEFILE;
  jpeg_destroy_decompress(&cinfo);
  fclose(file);
- if (buffer[0])
-    free(buffer[0]);

buffer is a local variable. The malloc is not used yet. So:

- We set the value to NULL, then check if is null to call free(). So the free()
  call is never used. We can remove the last too lines.
- We don't need set now to NULL, because the variable is empty (the
  initializated (or not) value is not used, and is destroyed as local variable
  when we returns, just one line later.

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)
a2cc89dd3d load_jpeg.c Removed goto
This patch removes the goto call. I copied the code after the bye: label and
I paste it in the goto-calls.

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)
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
Rodolfo García Peñas (kix)
00dffbe317 wmiv.c Removed indentation warning
This patch removes the indentation problem. The patch includes a long comment about the change.

wmiv.c: In function ‘main’:
wmiv.c:843:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
    if (e.xclient.data.l[0] == delWindow)
    ^~
wmiv.c:845:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
     break;
     ^~~~~

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)
7759d06851 wmgenmenu.c Removed format-truncation
This patch removes the format-truncation warning. The problem is because buf and comm are arrays with the same size (PATH_MAX). In the snprintf, comm is copied to buf, more some extra characters. The patch reduces the size for the array comm in the extra characters. Without the patch, the comm array is truncated. With the patch, the same characters are copied, without the warning.

wmgenmenu.c: In function ‘find_and_write’:
wmgenmenu.c:436:41: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
     snprintf(buf, sizeof(buf), "%s -e %s", terminal ? terminal : "xterm" , comm);
                                         ^
wmgenmenu.c:436:5: note: ‘snprintf’ output 5 or more bytes (assuming 4105) into a destination of size 4104
     snprintf(buf, sizeof(buf), "%s -e %s", terminal ? terminal : "xterm" , comm);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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)
bf644338e4 gradient.c Removed implicit-fallthrough warnings
This patch adds the comments to remove the warnings.

gradient.c: In function ‘renderGradientWidth’:
gradient.c:162:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
   *ptr++ = b;
   ~~~~~~~^~~
gradient.c:163:2: note: here
  case 2:
  ^~~~
gradient.c:166:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
   *ptr++ = b;
   ~~~~~~~^~~
gradient.c:167:2: note: here
  case 1:
  ^~~~

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)
95561fba08 wtextfield.c: Removed multiple warnings
This patch removes the implicit-fallthrough warnings for GCC7. Just add the FALLTHRU comment.
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix)
a0b223263e wtext.c Remove warnings
This patch removes the FALLTHRU warnings in wtext.c. Only includes the comments for GCC7.

wtext.c: In function ‘handleActionEvents’:
wtext.c:2508:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (event->xbutton.button == Button2) {
      ^
wtext.c:2547:2: note: here
  case ButtonRelease:
  ^~~~
wtext.c: In function ‘handleTextKeyPress’:
wtext.c:2307:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
   *buffer = '\n';
   ~~~~~~~~^~~~~~
wtext.c:2308:2: note: here
  default:
  ^~~~~~~

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)
2555413838 wruler.c Remove format-truncation warning
This patch removes the format-truncation error. The warning is because c has size of 3, but using "%d" is not possible to store the value.

wruler.c: In function ‘paintRuler.part.0’:
wruler.c:184:28: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 3 [-Wformat-truncation=]
    snprintf(c, sizeof(c), "%d", ++j);
                            ^~
wruler.c:184:27: note: directive argument in the range [1, 2147483647]
    snprintf(c, sizeof(c), "%d", ++j);
                           ^~~~
wruler.c:184:4: note: ‘snprintf’ output between 2 and 11 bytes into a destination of size 3
    snprintf(c, sizeof(c), "%d", ++j);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The value "j" is the result of "m < w". w is the result of rPtr->view->size.width - rPtr->margins.left;, and both variables are unsigned int. So the value for w is an unsigned int and m is related to i. m cannot be greater of unsigned int.

	i = j = m = 0;
	w = rPtr->view->size.width - rPtr->margins.left;
	while (m < w) {
		XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer,
			  rPtr->fgGC, rPtr->margins.left + m, 23, rPtr->margins.left + m, marks[i % 8] + 23);
		if (i != 0 && i % 8 == 0) {
			snprintf(c, sizeof(c), "%hu", ++j);
			WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg,
				     rPtr->font, rPtr->margins.left + 2 + m, 26, c, 2);
		}
		m = (++i) * 10;
	}

The printf modifier should be unsigned int.

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)
3e3f06a7be widgets.c Removes implicit-fallthrough warning
This patch removes this warning:

widgets.c: In function `renderPixmap':
widgets.c:385:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
     if (mask)
        ^
widgets.c:388:4: note: here
    case '.':
    ^~~~

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)
1f80c82091 wcolorpanel.c Removed hsbInit warnings
This patch removes these warnings in the hsbInit function.

wcolorpanel.c: In function ‘hsbInit’:
wcolorpanel.c:3456:16: warning: ‘%u’ directive writing between 1 and 5 bytes into a region of size 4 [-Wformat-overflow=]
  sprintf(tmp, "%d", value[0]);
                ^~
wcolorpanel.c:3456:15: note: directive argument in the range [0, 65535]
  sprintf(tmp, "%d", value[0]);
               ^~~~
wcolorpanel.c:3456:2: note: ‘sprintf’ output between 2 and 6 bytes into a destination of size 4
  sprintf(tmp, "%d", value[0]);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

The problem is that the hue variable in the RHSVColor struct. This variable is not an integer, is a shor variable, so using the printf using the "%d" modifier spects an integer. Using a "%hu" prints a unsigned short value.

typedef struct RHSVColor {
    unsigned short hue;	       /* 0-359 */
    unsigned char saturation;      /* 0-255 */
    unsigned char value;	       /* 0-255 */
} RHSVColor;
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix)
fb5f6c30c0 wcolorpanel.c: Remove warning in rgbIntToChar
This patch removes this warning. The default case should not be used.

wcolorpanel.c: In function ‘rgbIntToChar’:
wcolorpanel.c:2392:2: warning: ‘format’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  sprintf(tmp, format, value[1]);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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)
972d85610a wcolorpanel.c Avoid compiler warning
This patch removes this warning. The patch adds a switch case that never should happend.

wcolorpanel.c: In function ‘rgbInit’:
wcolorpanel.c:3403:2: warning: ‘format’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  sprintf(tmp, format, panel->color.rgb.green);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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)
f0f95165e4 WINGs/selection.c Removed compiler warning
This patch removes this warning:

selection.c:265:64: warning: cast between incompatible function types from ‘int (*)(void *)’ to ‘void (*)(void *)’ [-Wcast-function-type]
  wdata = WMCreateDataWithBytesNoCopy((void *) data, len * bpi, (WMFreeDataProc *) XFree);

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Tim Taenny
f895b906a4 Adjusted size of the Legal Information panel
With the changes to the layout, which were introduced in the
previous patch series, and the correction of the default font
size, the Legal Information panel was too small to display the
complete text.
It has been set to a sufficient size.
2019-06-19 18:06:53 +01:00
Tim Taenny
5ab9b7c6be Renamed the ScaleX/Y macros and their local variables
The names of the macros and the local variables that they use
have been changed to make them less "user-space" like.

    ScaleX -> WMScaleX
    ScaleY -> WMScaleY
    fw     -> wmScaleWidth
    fh     -> wmScaleHeight
2019-06-19 18:06:53 +01:00
Tim Taenny
1e490f8233 Adjusted scale factors in ScaleX and ScaleY macros
The scale factors in the macros were based on the assumption that
the default font size was 11. But the actual default font size is
12. This value is specified as DEFAULT_FONT_SIZE in
WINGS/configuration.c.
2019-06-19 18:06:53 +01:00
Tim Taenny
ba3df2599d Use fixed font size in original WMCreate*Panel functions
Instead of just assuming that the size of the system font has not
been changed by the user, the WMCreateAlertPanel,
WMCreateInputPanel and WMCreateGenericPanel functions now use a
fixed default font size of 12, so that changing the system font's
size in WPrefs.app does not break the fixed layouts of these panels.
("12" is specified as DEFAULT_FONT_SIZE in WINGS/configuration.c)
2019-06-19 18:06:53 +01:00