sync with OpenBSD -current

This commit is contained in:
purplerain 2025-01-10 01:40:29 +00:00
parent 4b49aefbb1
commit 1fd36b57f8
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
945 changed files with 81965 additions and 59988 deletions

View file

@ -1,3 +1,88 @@
commit 5244f3a61beb61702f6dcaca64aa99b63b78e3b9
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Tue Nov 12 16:51:40 2024 -0800
xcompmgr 1.1.10
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit ebc2a566d68bdfc86e94ae5e37d2ad2124095f5c
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Aug 3 11:37:48 2024 -0700
More variable scope reductions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/app/xcompmgr/-/merge_requests/6>
commit 1972797736a5aa25a69c5b0ba53a33592fe1640e
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Aug 3 11:22:16 2024 -0700
Add {} around for loops containing multiple lines of code
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/app/xcompmgr/-/merge_requests/6>
commit 7175619585083d6378229e5f86b900472c7d7c01
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Aug 3 11:11:42 2024 -0700
Use C99 struct initializers
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/app/xcompmgr/-/merge_requests/6>
commit 4c4bc9a67fbefb63e9dc1355a686622eac7a5da3
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Aug 3 10:23:12 2024 -0700
Convert sprintf calls to snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/app/xcompmgr/-/merge_requests/6>
commit fb596ae3eb7a4732319391c0274c29cc5499cb23
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Aug 3 09:38:53 2024 -0700
Use reallocarray() if it is available
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/app/xcompmgr/-/merge_requests/6>
commit e455e9eb8091fa7bbcfde9fbe2920ff053f1ee9c
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Aug 3 09:30:32 2024 -0700
Handle realloc() failure
Flagged by cppcheck:
xcompmgr.c:2290:8: error: Common realloc mistake: 'expose_rects' nulled
but not freed upon failure [memleakOnRealloc]
expose_rects = realloc (expose_rects,
^
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/app/xcompmgr/-/merge_requests/6>
commit 062ba6bd66ac4998047467490d608d15c0f6caae
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Aug 3 09:11:17 2024 -0700
find_fade: declare argument as const
Suggested by cppcheck:
xcompmgr.c:211:17: style: Parameter 'w' can be declared with const
[constParameter]
find_fade (win *w)
^
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/app/xcompmgr/-/merge_requests/6>
commit 052a0d39908a33e62f4d77b4d9e395f2f3583925
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Nov 12 11:55:23 2022 -0800

View file

@ -181,7 +181,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
@ -192,11 +191,9 @@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@

View file

@ -13,13 +13,13 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
[m4_warning([this file was generated for autoconf 2.69.
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
@ -107,7 +107,7 @@ dnl Check to see whether a particular set of modules exists. Similar to
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
dnl
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
dnl only at the first occurence in configure.ac, so if the first place
dnl only at the first occurrence in configure.ac, so if the first place
dnl it's called might be skipped (such as if it is within an "if", you
dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
@ -176,14 +176,14 @@ if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
@ -195,7 +195,7 @@ _PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
@ -205,10 +205,10 @@ _PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
$3
fi[]dnl
])dnl PKG_CHECK_MODULES
@ -295,6 +295,74 @@ AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR
dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
dnl [DESCRIPTION], [DEFAULT])
dnl ------------------------------------------
dnl
dnl Prepare a "--with-" configure option using the lowercase
dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
dnl PKG_CHECK_MODULES in a single macro.
AC_DEFUN([PKG_WITH_MODULES],
[
m4_pushdef([with_arg], m4_tolower([$1]))
m4_pushdef([description],
[m4_default([$5], [build with ]with_arg[ support])])
m4_pushdef([def_arg], [m4_default([$6], [auto])])
m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
m4_case(def_arg,
[yes],[m4_pushdef([with_without], [--without-]with_arg)],
[m4_pushdef([with_without],[--with-]with_arg)])
AC_ARG_WITH(with_arg,
AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
[AS_TR_SH([with_]with_arg)=def_arg])
AS_CASE([$AS_TR_SH([with_]with_arg)],
[yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
[auto],[PKG_CHECK_MODULES([$1],[$2],
[m4_n([def_action_if_found]) $3],
[m4_n([def_action_if_not_found]) $4])])
m4_popdef([with_arg])
m4_popdef([description])
m4_popdef([def_arg])
])dnl PKG_WITH_MODULES
dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [DESCRIPTION], [DEFAULT])
dnl -----------------------------------------------
dnl
dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
dnl check._[VARIABLE-PREFIX] is exported as make variable.
AC_DEFUN([PKG_HAVE_WITH_MODULES],
[
PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
AM_CONDITIONAL([HAVE_][$1],
[test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
])dnl PKG_HAVE_WITH_MODULES
dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [DESCRIPTION], [DEFAULT])
dnl ------------------------------------------------------
dnl
dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
dnl and preprocessor variable.
AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
[
PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
[AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
])dnl PKG_HAVE_DEFINE_WITH_MODULES
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
@ -1318,7 +1386,7 @@ AC_SUBST([am__untar])
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
dnl
dnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
dnl Copyright (c) 2005, 2023, Oracle and/or its affiliates.
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the "Software"),
@ -1355,7 +1423,7 @@ dnl DEALINGS IN THE SOFTWARE.
# See the "minimum version" comment for each macro you use to see what
# version you require.
m4_defun([XORG_MACROS_VERSION],[
m4_define([vers_have], [1.19.2])
m4_define([vers_have], [1.20.1])
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
m4_if(m4_cmp(maj_have, maj_needed), 0,,
@ -1376,7 +1444,7 @@ AM_MAINTAINER_MODE
# such as man pages and config files
AC_DEFUN([XORG_PROG_RAWCPP],[
AC_REQUIRE([AC_PROG_CPP])
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
AC_PATH_TOOL(RAWCPP, [cpp], [${CPP}],
[$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
# Check for flag to avoid builtin definitions - assumes unix is predefined,
@ -1402,10 +1470,10 @@ rm -f conftest.$ac_ext
AC_MSG_CHECKING([if $RAWCPP requires -traditional])
AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])])
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve "'` -eq 1 ; then
AC_MSG_RESULT([no])
else
if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve "'` -eq 1 ; then
TRADITIONALCPPFLAGS="-traditional"
RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
AC_MSG_RESULT([yes])
@ -1686,7 +1754,7 @@ AC_SUBST(MAKE_HTML)
# Documentation tools are not always available on all platforms and sometimes
# not at the appropriate level. This macro enables a module to test for the
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-xmlto option, it allows maximum flexibilty in making decisions
# the --with-xmlto option, it allows maximum flexibility in making decisions
# as whether or not to use the xmlto package. When DEFAULT is not specified,
# --with-xmlto assumes 'auto'.
#
@ -1900,7 +1968,7 @@ AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
# Documentation tools are not always available on all platforms and sometimes
# not at the appropriate level. This macro enables a module to test for the
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-asciidoc option, it allows maximum flexibilty in making decisions
# the --with-asciidoc option, it allows maximum flexibility in making decisions
# as whether or not to use the asciidoc package. When DEFAULT is not specified,
# --with-asciidoc assumes 'auto'.
#
@ -1970,7 +2038,7 @@ AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
# Documentation tools are not always available on all platforms and sometimes
# not at the appropriate level. This macro enables a module to test for the
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-doxygen option, it allows maximum flexibilty in making decisions
# the --with-doxygen option, it allows maximum flexibility in making decisions
# as whether or not to use the doxygen package. When DEFAULT is not specified,
# --with-doxygen assumes 'auto'.
#
@ -2054,7 +2122,7 @@ AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
# Documentation tools are not always available on all platforms and sometimes
# not at the appropriate level. This macro enables a module to test for the
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-groff option, it allows maximum flexibilty in making decisions
# the --with-groff option, it allows maximum flexibility in making decisions
# as whether or not to use the groff package. When DEFAULT is not specified,
# --with-groff assumes 'auto'.
#
@ -2162,7 +2230,7 @@ AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
# Documentation tools are not always available on all platforms and sometimes
# not at the appropriate level. This macro enables a module to test for the
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-fop option, it allows maximum flexibilty in making decisions
# the --with-fop option, it allows maximum flexibility in making decisions
# as whether or not to use the fop package. When DEFAULT is not specified,
# --with-fop assumes 'auto'.
#
@ -2256,7 +2324,7 @@ AC_SUBST([M4], [$ac_cv_path_M4])
# Documentation tools are not always available on all platforms and sometimes
# not at the appropriate level. This macro enables a module to test for the
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
# the --with-ps2pdf option, it allows maximum flexibility in making decisions
# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
# --with-ps2pdf assumes 'auto'.
#
@ -2311,7 +2379,7 @@ AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
# not at the appropriate level. This macro enables a builder to skip all
# documentation targets except traditional man pages.
# Combined with the specific tool checking macros XORG_WITH_*, it provides
# maximum flexibilty in controlling documentation building.
# maximum flexibility in controlling documentation building.
# Refer to:
# XORG_WITH_XMLTO --with-xmlto
# XORG_WITH_ASCIIDOC --with-asciidoc
@ -2344,7 +2412,7 @@ AC_MSG_RESULT([$build_docs])
#
# This macro enables a builder to skip all developer documentation.
# Combined with the specific tool checking macros XORG_WITH_*, it provides
# maximum flexibilty in controlling documentation building.
# maximum flexibility in controlling documentation building.
# Refer to:
# XORG_WITH_XMLTO --with-xmlto
# XORG_WITH_ASCIIDOC --with-asciidoc
@ -2377,7 +2445,7 @@ AC_MSG_RESULT([$build_devel_docs])
#
# This macro enables a builder to skip all functional specification targets.
# Combined with the specific tool checking macros XORG_WITH_*, it provides
# maximum flexibilty in controlling documentation building.
# maximum flexibility in controlling documentation building.
# Refer to:
# XORG_WITH_XMLTO --with-xmlto
# XORG_WITH_ASCIIDOC --with-asciidoc
@ -2852,7 +2920,11 @@ AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
AC_DEFUN([XORG_COMPILER_BRAND], [
AC_LANG_CASE(
[C], [
AC_REQUIRE([AC_PROG_CC_C99])
dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC
dnl and complains that AC_PROG_CC_C99 is obsolete
m4_version_prereq([2.70],
[AC_REQUIRE([AC_PROG_CC])],
[AC_REQUIRE([AC_PROG_CC_C99])])
],
[C++], [
AC_REQUIRE([AC_PROG_CXX])
@ -2868,7 +2940,7 @@ AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
# Minimum version: 1.16.0
#
# Test if the compiler works when passed the given flag as a command line argument.
# If it succeeds, the flag is appeneded to the given variable. If not, it tries the
# If it succeeds, the flag is appended to the given variable. If not, it tries the
# next flag in the list until there are no more options.
#
# Note that this does not guarantee that the compiler supports the flag as some
@ -2884,7 +2956,11 @@ AC_LANG_COMPILER_REQUIRE
AC_LANG_CASE(
[C], [
AC_REQUIRE([AC_PROG_CC_C99])
dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC
dnl and complains that AC_PROG_CC_C99 is obsolete
m4_version_prereq([2.70],
[AC_REQUIRE([AC_PROG_CC])],
[AC_REQUIRE([AC_PROG_CC_C99])])
define([PREFIX], [C])
define([CACHE_PREFIX], [cc])
define([COMPILER], [$CC])
@ -3025,7 +3101,7 @@ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
# Turn some warnings into errors, so we don't accidently get successful builds
# Turn some warnings into errors, so we don't accidentally get successful builds
# when there are problems that should be fixed.
if test "x$SELECTIVE_WERROR" = "xyes" ; then
@ -3134,23 +3210,35 @@ AC_SUBST([BASE_]PREFIX[FLAGS])
AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
]) # XORG_STRICT_OPTION
# XORG_DEFAULT_OPTIONS
# --------------------
# Minimum version: 1.3.0
# XORG_DEFAULT_NOCODE_OPTIONS
# ---------------------------
# Minimum version: 1.20.0
#
# Defines default options for X.Org modules.
# Defines default options for X.Org modules which don't compile code,
# such as fonts, bitmaps, cursors, and docs.
#
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
AC_DEFUN([XORG_DEFAULT_NOCODE_OPTIONS], [
AC_REQUIRE([AC_PROG_INSTALL])
XORG_COMPILER_FLAGS
XORG_CWARNFLAGS
XORG_STRICT_OPTION
XORG_RELEASE_VERSION
XORG_CHANGELOG
XORG_INSTALL
XORG_MANPAGE_SECTIONS
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
[AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
]) # XORG_DEFAULT_NOCODE_OPTIONS
# XORG_DEFAULT_OPTIONS
# --------------------
# Minimum version: 1.3.0
#
# Defines default options for X.Org modules which compile code.
#
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
AC_REQUIRE([AC_PROG_INSTALL])
XORG_COMPILER_FLAGS
XORG_CWARNFLAGS
XORG_STRICT_OPTION
XORG_DEFAULT_NOCODE_OPTIONS
]) # XORG_DEFAULT_OPTIONS
# XORG_INSTALL()

View file

@ -3,7 +3,7 @@
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# Copyright (C) 1999-2020 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify

View file

@ -3,12 +3,15 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `reallocarray' function. */
#undef HAVE_REALLOCARRAY
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
@ -57,7 +60,9 @@
/* Patch version of this package */
#undef PACKAGE_VERSION_PATCHLEVEL
/* Define to 1 if you have the ANSI C header files. */
/* Define to 1 if all of the C90 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#undef STDC_HEADERS
/* Version number of package */

6505
app/xcompmgr/configure vendored

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@
# Initialize Autoconf
AC_PREREQ(2.60)
AC_INIT([xcompmgr], [1.1.9],
AC_INIT([xcompmgr], [1.1.10],
[https://gitlab.freedesktop.org/xorg/app/xcompmgr/-/issues])
AC_CONFIG_SRCDIR([xcompmgr.c])
AC_CONFIG_HEADERS([config.h])
@ -17,6 +17,9 @@ m4_ifndef([XORG_MACROS_VERSION],
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
# Checks for library functions.
AC_CHECK_FUNCS([reallocarray])
PKG_CHECK_MODULES(XCOMPMGR,
[xcomposite xfixes xdamage xrender xext xproto >= 7.0.25])

View file

@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2011-11-20.07; # UTC
scriptversion=2020-11-14.01; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC
# This script is compatible with the BSD install script, but was written
# from scratch.
tab=' '
nl='
'
IFS=" "" $nl"
IFS=" $tab$nl"
# set DOITPROG to echo to test this script
# Set DOITPROG to "echo" to test this script.
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
@ -68,22 +64,16 @@ mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
# Create dirs (including intermediate dirs) using mode 755.
# This is like GNU 'install' as of coreutils 8.32 (2020).
mkdir_umask=22
backupsuffix=
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
@ -97,7 +87,7 @@ dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@ -114,18 +104,28 @@ Options:
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-C install only if different (preserve data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-p pass -p to $cpprog.
-s $stripprog installed files.
-S SUFFIX attempt to back up existing files, with suffix SUFFIX.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
By default, rm is invoked with -f; when overridden with RMPROG,
it's up to you to specify -f if you want it.
If -S is not specified, no backups are attempted.
Email bug reports to bug-automake@gnu.org.
Automake home page: https://www.gnu.org/software/automake/
"
while test $# -ne 0; do
@ -137,46 +137,62 @@ while test $# -ne 0; do
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
case $mode in
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
shift;;
-p) cpprog="$cpprog -p";;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-S) backupsuffix="$2"
shift;;
-T) no_target_directory=true;;
-t)
is_target_a_directory=always
dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
@ -207,6 +223,15 @@ if test $# -eq 0; then
exit 0
fi
if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
@ -223,16 +248,16 @@ if test -z "$dir_arg"; then
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
u_plus_rw=
else
u_plus_rw='% 200'
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
u_plus_rw=
else
u_plus_rw=,u+rw
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
@ -250,6 +275,10 @@ do
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
# Don't chown directories that already exist.
if test $dstdir_status = 0; then
chowncmd=""
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
@ -266,178 +295,148 @@ do
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
# If destination is a directory, append the input filename.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstbase=`basename "$src"`
case $dst in
*/) dst=$dst$dstbase;;
*) dst=$dst/$dstbase;;
esac
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
posix_mkdir=false
# The $RANDOM variable is not portable (e.g., dash). Use it
# here however when possible just to lower collision chance.
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
trap '
ret=$?
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
exit $ret
' 0
# Because "mkdir -p" follows existing symlinks and we likely work
# directly in world-writeable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test
# 'mkdir -p'.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
mkdir_mode=
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
trap '' 0;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set -f
set fnord $dstdir
shift
$posix_glob set +f
set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
@ -450,14 +449,25 @@ do
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
dsttmp=${dstdirslash}_inst.$$_
rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
(umask $cp_umask &&
{ test -z "$stripcmd" || {
# Create $dsttmp read-write so that cp doesn't create it read-only,
# which would cause strip to fail.
if test -z "$doit"; then
: >"$dsttmp" # No need to fork-exec 'touch'.
else
$doit touch "$dsttmp"
fi
}
} &&
$doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
@ -472,20 +482,24 @@ do
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# If $backupsuffix is set, and the file being installed
# already exists, attempt a backup. Don't worry if it fails,
# e.g., if mv doesn't support -f.
if test -n "$backupsuffix" && test -f "$dst"; then
$doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
fi
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
@ -493,24 +507,24 @@ do
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
@ -519,9 +533,9 @@ do
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

View file

@ -125,7 +125,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
@ -136,11 +135,9 @@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@

View file

@ -46,6 +46,10 @@
#include <X11/extensions/Xrender.h>
#include <X11/extensions/shape.h>
#ifndef HAVE_REALLOCARRAY
#define reallocarray(old, num, size) realloc(old, (num) * (size))
#endif
#if COMPOSITE_MAJOR > 0 || COMPOSITE_MINOR >= 2
#define HAS_NAME_WINDOW_PIXMAP 1
#endif
@ -208,11 +212,9 @@ get_time_in_milliseconds (void)
}
static fade *
find_fade (win *w)
find_fade (const win *w)
{
fade *f;
for (f = fades; f; f = f->next)
for (fade *f = fades; f; f = f->next)
{
if (f->w == w)
return f;
@ -223,9 +225,8 @@ find_fade (win *w)
static void
dequeue_fade (Display *dpy, fade *f)
{
fade **prev;
for (prev = &fades; *prev; prev = &(*prev)->next)
for (fade **prev = &fades; *prev; prev = &(*prev)->next)
{
if (*prev == f)
{
*prev = f->next;
@ -234,6 +235,7 @@ dequeue_fade (Display *dpy, fade *f)
free (f);
break;
}
}
}
static void
@ -264,9 +266,11 @@ set_fade (Display *dpy, win *w, double start, double finish, double step,
if (!f)
{
f = malloc (sizeof (fade));
f->next = NULL;
f->w = w;
f->cur = start;
*f = (fade) {
.next = NULL,
.w = w,
.cur = start
};
enqueue_fade (dpy, f);
}
else if(!override)
@ -391,27 +395,32 @@ make_gaussian_map (Display *dpy, double r)
conv *c;
int size = ((int) ceil ((r * 3)) + 1) & ~1;
int center = size / 2;
int x, y;
double t;
double g;
c = malloc (sizeof (conv) + size * size * sizeof (double));
c->size = size;
c->data = (double *) (c + 1);
*c = (conv) {
.size = size,
.data = (double *) (c + 1)
};
t = 0.0;
for (y = 0; y < size; y++)
for (x = 0; x < size; x++)
for (int y = 0; y < size; y++)
{
for (int x = 0; x < size; x++)
{
g = gaussian (r, (double) (x - center), (double) (y - center));
double g =
gaussian (r, (double) (x - center), (double) (y - center));
t += g;
c->data[y * size + x] = g;
}
}
/* printf ("gaussian total %f\n", t); */
for (y = 0; y < size; y++)
for (x = 0; x < size; x++)
for (int y = 0; y < size; y++)
{
for (int x = 0; x < size; x++)
{
c->data[y*size + x] /= t;
}
}
return c;
}
@ -435,7 +444,6 @@ make_gaussian_map (Display *dpy, double r)
static unsigned char
sum_gaussian (conv *map, double opacity, int x, int y, int width, int height)
{
int fx, fy;
double *g_line = map->data;
int g_size = map->size;
int center = g_size / 2;
@ -470,12 +478,12 @@ sum_gaussian (conv *map, double opacity, int x, int y, int width, int height)
g_line = g_line + fy_start * g_size + fx_start;
v = 0;
for (fy = fy_start; fy < fy_end; fy++)
for (int fy = fy_start; fy < fy_end; fy++)
{
double *g_data = g_line;
g_line += g_size;
for (fx = fx_start; fx < fx_end; fx++)
for (int fx = fx_start; fx < fx_end; fx++)
v += *g_data++;
}
if (v > 1)
@ -489,7 +497,6 @@ static void
presum_gaussian (conv *map)
{
int center = map->size/2;
int opacity, x, y;
Gsize = map->size;
@ -501,21 +508,23 @@ presum_gaussian (conv *map)
shadowCorner = malloc ((Gsize + 1) * (Gsize + 1) * 26);
shadowTop = malloc ((Gsize + 1) * 26);
for (x = 0; x <= Gsize; x++)
for (int x = 0; x <= Gsize; x++)
{
shadowTop[25 * (Gsize + 1) + x] = sum_gaussian (map, 1, x - center, center, Gsize * 2, Gsize * 2);
for(opacity = 0; opacity < 25; opacity++)
for (int opacity = 0; opacity < 25; opacity++)
shadowTop[opacity * (Gsize + 1) + x] = shadowTop[25 * (Gsize + 1) + x] * opacity / 25;
for(y = 0; y <= x; y++)
for (int y = 0; y <= x; y++)
{
shadowCorner[25 * (Gsize + 1) * (Gsize + 1) + y * (Gsize + 1) + x]
= sum_gaussian (map, 1, x - center, y - center, Gsize * 2, Gsize * 2);
shadowCorner[25 * (Gsize + 1) * (Gsize + 1) + x * (Gsize + 1) + y]
= shadowCorner[25 * (Gsize + 1) * (Gsize + 1) + y * (Gsize + 1) + x];
for(opacity = 0; opacity < 25; opacity++)
for (int opacity = 0; opacity < 25; opacity++)
{
shadowCorner[opacity * (Gsize + 1) * (Gsize + 1) + y * (Gsize + 1) + x]
= shadowCorner[opacity * (Gsize + 1) * (Gsize + 1) + x * (Gsize + 1) + y]
= shadowCorner[25 * (Gsize + 1) * (Gsize + 1) + y * (Gsize + 1) + x] * opacity / 25;
}
}
}
}
@ -530,7 +539,6 @@ make_shadow (Display *dpy, double opacity, int width, int height)
int swidth = width + gsize;
int sheight = height + gsize;
int center = gsize / 2;
int x, y;
unsigned char d;
int x_diff;
int opacity_int = (int)(opacity * 25);
@ -572,8 +580,9 @@ make_shadow (Display *dpy, double opacity, int width, int height)
if (xlimit > swidth / 2)
xlimit = (swidth + 1) / 2;
for (y = 0; y < ylimit; y++)
for (x = 0; x < xlimit; x++)
for (int y = 0; y < ylimit; y++)
{
for (int x = 0; x < xlimit; x++)
{
if (xlimit == Gsize && ylimit == Gsize)
d = shadowCorner[opacity_int * (Gsize + 1) * (Gsize + 1) + y * (Gsize + 1) + x];
@ -584,6 +593,7 @@ make_shadow (Display *dpy, double opacity, int width, int height)
data[(sheight - y - 1) * swidth + (swidth - x - 1)] = d;
data[y * swidth + (swidth - x - 1)] = d;
}
}
/*
* top/bottom
@ -591,7 +601,7 @@ make_shadow (Display *dpy, double opacity, int width, int height)
x_diff = swidth - (gsize * 2);
if (x_diff > 0 && ylimit > 0)
{
for (y = 0; y < ylimit; y++)
for (int y = 0; y < ylimit; y++)
{
if (ylimit == Gsize)
d = shadowTop[opacity_int * (Gsize + 1) + y];
@ -606,13 +616,13 @@ make_shadow (Display *dpy, double opacity, int width, int height)
* sides
*/
for (x = 0; x < xlimit; x++)
for (int x = 0; x < xlimit; x++)
{
if (xlimit == Gsize)
d = shadowTop[opacity_int * (Gsize + 1) + x];
else
d = sum_gaussian (gaussianMap, opacity, x - center, center, width, height);
for (y = gsize; y < sheight - gsize; y++)
for (int y = gsize; y < sheight - gsize; y++)
{
data[y * swidth + x] = d;
data[y * swidth + (swidth - x - 1)] = d;
@ -696,10 +706,12 @@ solid_picture (Display *dpy, Bool argb, double a, double r, double g, double b)
return None;
}
c.alpha = a * 0xffff;
c.red = r * 0xffff;
c.green = g * 0xffff;
c.blue = b * 0xffff;
c = (XRenderColor) {
.alpha = a * 0xffff,
.red = r * 0xffff,
.green = g * 0xffff,
.blue = b * 0xffff
};
XRenderFillRectangle (dpy, PictOpSrc, picture, &c, 0, 0, 1, 1);
XFreePixmap (dpy, pixmap);
return picture;
@ -729,8 +741,10 @@ set_ignore (Display *dpy, unsigned long sequence)
ignore *i = malloc (sizeof (ignore));
if (!i)
return;
i->sequence = sequence;
i->next = NULL;
*i = (ignore) {
.sequence = sequence,
.next = NULL
};
*ignore_tail = i;
ignore_tail = &i->next;
}
@ -745,11 +759,11 @@ should_ignore (Display *dpy, unsigned long sequence)
static win *
find_win (Display *dpy, Window id)
{
win *w;
for (w = list; w; w = w->next)
for (win *w = list; w; w = w->next)
{
if (w->id == id)
return w;
}
return NULL;
}
@ -771,10 +785,9 @@ root_tile (Display *dpy)
unsigned char *prop;
Bool fill;
XRenderPictureAttributes pa;
int p;
pixmap = None;
for (p = 0; backgroundProps[p]; p++)
for (int p = 0; backgroundProps[p]; p++)
{
if (XGetWindowProperty (dpy, root, XInternAtom (dpy, backgroundProps[p], False),
0, 4, False, AnyPropertyType,
@ -799,10 +812,12 @@ root_tile (Display *dpy)
CPRepeat, &pa);
if (fill)
{
XRenderColor c;
c.red = c.green = c.blue = 0x8080;
c.alpha = 0xffff;
XRenderColor c = {
.red = 0x8080,
.green = 0x8080,
.blue = 0x8080,
.alpha = 0xffff
};
XRenderFillRectangle (dpy, PictOpSrc, picture, &c,
0, 0, 1, 1);
}
@ -823,12 +838,13 @@ paint_root (Display *dpy)
static XserverRegion
win_extents (Display *dpy, win *w)
{
XRectangle r;
XRectangle r = {
.x = w->a.x,
.y = w->a.y,
.width = w->a.width + w->a.border_width * 2,
.height = w->a.height + w->a.border_width * 2
};
r.x = w->a.x;
r.y = w->a.y;
r.width = w->a.width + w->a.border_width * 2;
r.height = w->a.height + w->a.border_width * 2;
if (compMode != CompSimple && !(w->windowType == winDockAtom && excludeDockShadows))
{
if (compMode == CompServerShadows || w->mode != WINDOW_ARGB)
@ -857,10 +873,12 @@ win_extents (Display *dpy, win *w)
&w->shadow_width, &w->shadow_height);
}
}
sr.x = w->a.x + w->shadow_dx;
sr.y = w->a.y + w->shadow_dy;
sr.width = w->shadow_width;
sr.height = w->shadow_height;
sr = (XRectangle) {
.x = w->a.x + w->shadow_dx,
.y = w->a.y + w->shadow_dy,
.width = w->shadow_width,
.height = w->shadow_height
};
if (sr.x < r.x)
{
r.width = (r.x + r.width) - sr.x;
@ -909,11 +927,12 @@ paint_all (Display *dpy, XserverRegion region)
if (!region)
{
XRectangle r;
r.x = 0;
r.y = 0;
r.width = root_width;
r.height = root_height;
XRectangle r = {
.x = 0,
.y = 0,
.width = root_width,
.height = root_height
};
region = XFixesCreateRegion (dpy, &r, 1);
}
#if MONITOR_REPAINT
@ -1504,8 +1523,10 @@ restack_win (Display *dpy, win *w, Window new_above)
/* unhook */
for (prev = &list; *prev; prev = &(*prev)->next)
{
if ((*prev) == w)
break;
}
*prev = w->next;
/* rehook */
@ -1617,6 +1638,7 @@ finish_destroy_win (Display *dpy, Window id, Bool gone)
win **prev, *w;
for (prev = &list; (w = *prev); prev = &w->next)
{
if (w->id == id)
{
if (gone)
@ -1653,6 +1675,7 @@ finish_destroy_win (Display *dpy, Window id, Bool gone)
free (w);
break;
}
}
}
#if HAS_NAME_WINDOW_PIXMAP
@ -1769,7 +1792,7 @@ shape_kind(int kind)
case ShapeInput:
return "ShapeInput";
default:
sprintf (buf, "Shape %d", kind);
snprintf (buf, sizeof(buf), "Shape %d", kind);
return buf;
}
}
@ -1920,7 +1943,7 @@ ev_name (XEvent *ev)
{
return "Shape";
}
sprintf (buf, "Event %d", ev->type);
snprintf (buf, sizeof(buf), "Event %d", ev->type);
return buf;
}
}
@ -2287,21 +2310,32 @@ main (int argc, char **argv)
{
if (expose_rects)
{
expose_rects = realloc (expose_rects,
(size_expose + more) *
sizeof (XRectangle));
size_expose += more;
XRectangle *old = expose_rects;
expose_rects = reallocarray (old,
(size_expose + more),
sizeof (XRectangle));
if (expose_rects == NULL) {
expose_rects = old;
expose_root (dpy, root, expose_rects, n_expose);
n_expose = 0;
} else {
size_expose += more;
}
}
else
{
expose_rects = malloc (more * sizeof (XRectangle));
expose_rects = reallocarray (NULL, more,
sizeof (XRectangle));
size_expose = more;
}
}
expose_rects[n_expose].x = ev.xexpose.x;
expose_rects[n_expose].y = ev.xexpose.y;
expose_rects[n_expose].width = ev.xexpose.width;
expose_rects[n_expose].height = ev.xexpose.height;
expose_rects[n_expose] = (XRectangle) {
.x = ev.xexpose.x,
.y = ev.xexpose.y,
.width = ev.xexpose.width,
.height = ev.xexpose.height
};
n_expose++;
if (ev.xexpose.count == 0)
{