diff -Nru xsnow-3.5.3/aclocal.m4 xsnow-3.6.0/aclocal.m4 --- xsnow-3.5.3/aclocal.m4 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/aclocal.m4 2022-12-03 13:02:36.000000000 +0000 @@ -20,7 +20,7 @@ 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 . @@ -108,7 +108,7 @@ 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], @@ -168,6 +168,7 @@ _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) +_PKG_CONFIG([$1][_VERSION], [modversion], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. @@ -177,14 +178,14 @@ 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 @@ -196,7 +197,7 @@ ]) 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. @@ -206,10 +207,11 @@ To get pkg-config, see .])[]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 + $1[]_VERSION=$pkg_cv_[]$1[]_VERSION AC_MSG_RESULT([yes]) - $3 + $3 fi[]dnl ])dnl PKG_CHECK_MODULES @@ -296,6 +298,74 @@ 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-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation diff -Nru xsnow-3.5.3/bootdate xsnow-3.6.0/bootdate --- xsnow-3.5.3/bootdate 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/bootdate 2022-12-03 13:02:36.000000000 +0000 @@ -1 +1 @@ -1664192863 +1670072556 diff -Nru xsnow-3.5.3/ChangeLog xsnow-3.6.0/ChangeLog --- xsnow-3.5.3/ChangeLog 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/ChangeLog 2022-12-03 13:02:36.000000000 +0000 @@ -1,3 +1,19 @@ +version 3.6.0 + 01: implement xinerama-awareness + implement -outline + introduce usage of libxdo, make it g++ compliant, fix some non-fatal + issues + fallensnow.c: fix bug that causes crash when snowing on a window + less than 10 pixels width + birds.c: fix bug that caused a hang when using -doublebuffer 0 + docs.c: update window manager/desktop issues + main.c: print info when snow window changes size (thanks to Gim Kami) + configure.ac: chack for availability of gsl_interp_steffen, + gsl_interp_akima, gsl_interp_cspline and gsl_interp_linear + (Thanks to Joachim Ruebenschuss) + utils.c: somewhat nicer print-out of version + + version 3.5.3 01: main.c: drawit(): do now draw the first second or so to hide unstable configurations of scenery, stars, etc. diff -Nru xsnow-3.5.3/config.h.in xsnow-3.6.0/config.h.in --- xsnow-3.5.3/config.h.in 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/config.h.in 2022-12-03 13:02:36.000000000 +0000 @@ -18,6 +18,18 @@ /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY +/* Define to 1 if you have the `gsl_interp_akima' function. */ +#undef HAVE_GSL_INTERP_AKIMA + +/* Define to 1 if you have the `gsl_interp_cspline' function. */ +#undef HAVE_GSL_INTERP_CSPLINE + +/* Define to 1 if you have the `gsl_interp_linear' function. */ +#undef HAVE_GSL_INTERP_LINEAR + +/* Define to 1 if you have the `gsl_interp_steffen' function. */ +#undef HAVE_GSL_INTERP_STEFFEN + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H @@ -90,6 +102,9 @@ /* Define to 1 if you have the `XdbeAllocateBackBufferName' function. */ #undef HAVE_XDBEALLOCATEBACKBUFFERNAME +/* Define to 1 if you have the `XineramaQueryScreens' function. */ +#undef HAVE_XINERAMAQUERYSCREENS + /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL diff -Nru xsnow-3.5.3/configure xsnow-3.6.0/configure --- xsnow-3.5.3/configure 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/configure 2022-12-03 13:02:36.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for xsnow 3.5.3. +# Generated by GNU Autoconf 2.71 for xsnow 3.6.0. # # Report bugs to . # @@ -611,8 +611,8 @@ # Identity of this package. PACKAGE_NAME='xsnow' PACKAGE_TARNAME='xsnow' -PACKAGE_VERSION='3.5.3' -PACKAGE_STRING='xsnow 3.5.3' +PACKAGE_VERSION='3.6.0' +PACKAGE_STRING='xsnow 3.6.0' PACKAGE_BUGREPORT='wvermin@gmail.com' PACKAGE_URL='' @@ -680,6 +680,7 @@ PKG_CONFIG CPP XMKMF +RANLIB am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE @@ -1353,7 +1354,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xsnow 3.5.3 to adapt to many kinds of systems. +\`configure' configures xsnow 3.6.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1428,7 +1429,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xsnow 3.5.3:";; + short | recursive ) echo "Configuration of xsnow 3.6.0:";; esac cat <<\_ACEOF @@ -1540,7 +1541,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xsnow configure 3.5.3 +xsnow configure 3.6.0 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1925,7 +1926,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xsnow $as_me 3.5.3, which was +It was created by xsnow $as_me 3.6.0, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3413,7 +3414,7 @@ # Define the identity of the package. PACKAGE='xsnow' - VERSION='3.5.3' + VERSION='3.6.0' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -5096,6 +5097,108 @@ +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + LIBS="-lm" # Checks for header files. @@ -5738,6 +5841,23 @@ else pkg_failed=untried fi +if test -n "$GTK_VERSION"; then + pkg_cv_GTK_VERSION="$GTK_VERSION" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-3.0 gmodule-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtk+-3.0 gmodule-2.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTK_VERSION=`$PKG_CONFIG --modversion "gtk+-3.0 gmodule-2.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi @@ -5751,14 +5871,14 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-3.0 gmodule-2.0" 2>&1` + GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-3.0 gmodule-2.0" 2>&1` else - GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-3.0 gmodule-2.0" 2>&1` + GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-3.0 gmodule-2.0" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$GTK_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$GTK_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (gtk+-3.0 gmodule-2.0) were not met: + as_fn_error $? "Package requirements (gtk+-3.0 gmodule-2.0) were not met: $GTK_PKG_ERRORS @@ -5771,7 +5891,7 @@ elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "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 @@ -5784,27 +5904,28 @@ To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else - GTK_CFLAGS=$pkg_cv_GTK_CFLAGS - GTK_LIBS=$pkg_cv_GTK_LIBS + GTK_CFLAGS=$pkg_cv_GTK_CFLAGS + GTK_LIBS=$pkg_cv_GTK_LIBS + GTK_VERSION=$pkg_cv_GTK_VERSION { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for x11 xpm xt xext xproto" >&5 -printf %s "checking for x11 xpm xt xext xproto... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for x11 xpm xt xext xproto xinerama xtst xkbcommon" >&5 +printf %s "checking for x11 xpm xt xext xproto xinerama xtst xkbcommon... " >&6; } if test -n "$X11_CFLAGS"; then pkg_cv_X11_CFLAGS="$X11_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xpm xt xext xproto\""; } >&5 - ($PKG_CONFIG --exists --print-errors "x11 xpm xt xext xproto") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xpm xt xext xproto xinerama xtst xkbcommon\""; } >&5 + ($PKG_CONFIG --exists --print-errors "x11 xpm xt xext xproto xinerama xtst xkbcommon") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_X11_CFLAGS=`$PKG_CONFIG --cflags "x11 xpm xt xext xproto" 2>/dev/null` + pkg_cv_X11_CFLAGS=`$PKG_CONFIG --cflags "x11 xpm xt xext xproto xinerama xtst xkbcommon" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -5816,12 +5937,29 @@ pkg_cv_X11_LIBS="$X11_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xpm xt xext xproto\""; } >&5 - ($PKG_CONFIG --exists --print-errors "x11 xpm xt xext xproto") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xpm xt xext xproto xinerama xtst xkbcommon\""; } >&5 + ($PKG_CONFIG --exists --print-errors "x11 xpm xt xext xproto xinerama xtst xkbcommon") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_X11_LIBS=`$PKG_CONFIG --libs "x11 xpm xt xext xproto xinerama xtst xkbcommon" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$X11_VERSION"; then + pkg_cv_X11_VERSION="$X11_VERSION" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xpm xt xext xproto xinerama xtst xkbcommon\""; } >&5 + ($PKG_CONFIG --exists --print-errors "x11 xpm xt xext xproto xinerama xtst xkbcommon") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_X11_LIBS=`$PKG_CONFIG --libs "x11 xpm xt xext xproto" 2>/dev/null` + pkg_cv_X11_VERSION=`$PKG_CONFIG --modversion "x11 xpm xt xext xproto xinerama xtst xkbcommon" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -5842,14 +5980,14 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - X11_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11 xpm xt xext xproto" 2>&1` + X11_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11 xpm xt xext xproto xinerama xtst xkbcommon" 2>&1` else - X11_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11 xpm xt xext xproto" 2>&1` + X11_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11 xpm xt xext xproto xinerama xtst xkbcommon" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$X11_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$X11_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (x11 xpm xt xext xproto) were not met: + as_fn_error $? "Package requirements (x11 xpm xt xext xproto xinerama xtst xkbcommon) were not met: $X11_PKG_ERRORS @@ -5862,7 +6000,7 @@ elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "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 @@ -5875,8 +6013,9 @@ To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else - X11_CFLAGS=$pkg_cv_X11_CFLAGS - X11_LIBS=$pkg_cv_X11_LIBS + X11_CFLAGS=$pkg_cv_X11_CFLAGS + X11_LIBS=$pkg_cv_X11_LIBS + X11_VERSION=$pkg_cv_X11_VERSION { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -5920,6 +6059,23 @@ else pkg_failed=untried fi +if test -n "$GSL_VERSION"; then + pkg_cv_GSL_VERSION="$GSL_VERSION" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gsl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gsl") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GSL_VERSION=`$PKG_CONFIG --modversion "gsl" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi @@ -5933,14 +6089,14 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gsl" 2>&1` + GSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gsl" 2>&1` else - GSL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gsl" 2>&1` + GSL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gsl" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$GSL_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$GSL_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (gsl) were not met: + as_fn_error $? "Package requirements (gsl) were not met: $GSL_PKG_ERRORS @@ -5953,7 +6109,7 @@ elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "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 @@ -5966,8 +6122,9 @@ To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else - GSL_CFLAGS=$pkg_cv_GSL_CFLAGS - GSL_LIBS=$pkg_cv_GSL_LIBS + GSL_CFLAGS=$pkg_cv_GSL_CFLAGS + GSL_LIBS=$pkg_cv_GSL_LIBS + GSL_VERSION=$pkg_cv_GSL_VERSION { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -7149,7 +7306,7 @@ fi -LIBS="$X11_LIBS" +LIBS="$X11_LIBS $GSL_LIBS" # check for availability of double buffering ac_fn_c_check_func "$LINENO" "XdbeAllocateBackBufferName" "ac_cv_func_XdbeAllocateBackBufferName" if test "x$ac_cv_func_XdbeAllocateBackBufferName" = xyes @@ -7158,6 +7315,14 @@ fi +#check for availability of xinerama +ac_fn_c_check_func "$LINENO" "XineramaQueryScreens" "ac_cv_func_XineramaQueryScreens" +if test "x$ac_cv_func_XineramaQueryScreens" = xyes +then : + printf "%s\n" "#define HAVE_XINERAMAQUERYSCREENS 1" >>confdefs.h + +fi + # Checks for typedefs, structures, and compiler characteristics. ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" @@ -7358,6 +7523,31 @@ fi +ac_fn_c_check_func "$LINENO" "gsl_interp_steffen" "ac_cv_func_gsl_interp_steffen" +if test "x$ac_cv_func_gsl_interp_steffen" = xyes +then : + printf "%s\n" "#define HAVE_GSL_INTERP_STEFFEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "gsl_interp_akima" "ac_cv_func_gsl_interp_akima" +if test "x$ac_cv_func_gsl_interp_akima" = xyes +then : + printf "%s\n" "#define HAVE_GSL_INTERP_AKIMA 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "gsl_interp_cspline" "ac_cv_func_gsl_interp_cspline" +if test "x$ac_cv_func_gsl_interp_cspline" = xyes +then : + printf "%s\n" "#define HAVE_GSL_INTERP_CSPLINE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "gsl_interp_linear" "ac_cv_func_gsl_interp_linear" +if test "x$ac_cv_func_gsl_interp_linear" = xyes +then : + printf "%s\n" "#define HAVE_GSL_INTERP_LINEAR 1" >>confdefs.h + +fi + ac_config_files="$ac_config_files Makefile src/Makefile src/Pixmaps/Makefile data/Makefile" @@ -7892,7 +8082,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xsnow $as_me 3.5.3, which was +This file was extended by xsnow $as_me 3.6.0, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7960,7 +8150,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -xsnow config.status 3.5.3 +xsnow config.status 3.6.0 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff -Nru xsnow-3.5.3/configure.ac xsnow-3.6.0/configure.ac --- xsnow-3.5.3/configure.ac 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/configure.ac 2022-12-03 13:02:36.000000000 +0000 @@ -23,7 +23,7 @@ #-# AC_PREREQ([2.69]) -AC_INIT([xsnow],[3.5.3],[wvermin@gmail.com]) +AC_INIT([xsnow],[3.6.0],[wvermin@gmail.com]) AC_CONFIG_SRCDIR([src/xsnow.h]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE @@ -107,6 +107,7 @@ AC_PROG_CC([cc gcc]) AC_PROG_CXX([c++ g++]) AC_PROG_INSTALL +AC_PROG_RANLIB LIBS="-lm" # Checks for header files. @@ -122,16 +123,18 @@ AC_LANG_POP([C++]) PKG_CHECK_MODULES(GTK, [gtk+-3.0 gmodule-2.0]) -PKG_CHECK_MODULES(X11, [x11 xpm xt xext xproto]) +PKG_CHECK_MODULES(X11, [x11 xpm xt xext xproto xinerama xtst xkbcommon]) PKG_CHECK_MODULES(GSL, [gsl]) m4_include([m4/ax_pthread.m4]) AX_PTHREAD() AC_CHECK_FUNCS([backtrace]) -LIBS="$X11_LIBS" +LIBS="$X11_LIBS $GSL_LIBS" # check for availability of double buffering AC_CHECK_FUNCS([XdbeAllocateBackBufferName]) +#check for availability of xinerama +AC_CHECK_FUNCS([XineramaQueryScreens]) # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T @@ -146,6 +149,7 @@ #AC_FUNC_ALLOCA AC_CHECK_FUNCS([alarm gettimeofday sqrt strchr strdup strstr strtol]) +AC_CHECK_FUNCS([gsl_interp_steffen gsl_interp_akima gsl_interp_cspline gsl_interp_linear]) AC_CONFIG_FILES([Makefile src/Makefile src/Pixmaps/Makefile data/Makefile]) AC_OUTPUT diff -Nru xsnow-3.5.3/data/Makefile.in xsnow-3.6.0/data/Makefile.in --- xsnow-3.5.3/data/Makefile.in 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/data/Makefile.in 2022-12-03 13:02:36.000000000 +0000 @@ -209,6 +209,7 @@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ diff -Nru xsnow-3.5.3/debian/changelog xsnow-3.6.0/debian/changelog --- xsnow-3.5.3/debian/changelog 2022-10-01 14:12:19.000000000 +0000 +++ xsnow-3.6.0/debian/changelog 2022-12-05 12:58:48.000000000 +0000 @@ -1,3 +1,9 @@ +xsnow (1:3.6.0-1) unstable; urgency=low + + * New upstream release + + -- Willem Vermin Mon, 05 Dec 2022 12:58:48 +0000 + xsnow (1:3.5.3-1) unstable; urgency=low * New upstream release diff -Nru xsnow-3.5.3/dependencies xsnow-3.6.0/dependencies --- xsnow-3.5.3/dependencies 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/dependencies 2022-12-03 13:02:36.000000000 +0000 @@ -5,6 +5,8 @@ libxpm-dev libxt-dev libxext-dev +libxinerama-dev +libxtst-dev libgtk-3-dev libgsl-dev pkg-config @@ -14,8 +16,11 @@ # Suse libX11-devel +libXpm-devel libXt-devel libXext-devel +libXinerama-devel +libXtst-devel libgtk-3-0 gsl-devel pkg-config diff -Nru xsnow-3.5.3/Makefile.in xsnow-3.6.0/Makefile.in --- xsnow-3.5.3/Makefile.in 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/Makefile.in 2022-12-03 13:02:36.000000000 +0000 @@ -261,6 +261,7 @@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ diff -Nru xsnow-3.5.3/simplemake.sh xsnow-3.6.0/simplemake.sh --- xsnow-3.5.3/simplemake.sh 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/simplemake.sh 2022-12-03 13:02:36.000000000 +0000 @@ -53,9 +53,9 @@ # -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 # if you have pkg-config working for these: x11 xpm xt xproto -FLAGS="$FLAGS `pkg-config --cflags --libs x11 xpm xt xproto xext`" +FLAGS="$FLAGS `pkg-config --cflags --libs x11 xpm xt xext xproto xinerama xtst xkbcommon`" # NOTE: on my system, pkg-config expands to: -# -lXpm -lXt -lX11 -lXext +# -lXpm -lXt -lX11 -lXext -lXinerama -lXtst -lxkbcommon FLAGS="$FLAGS `pkg-config --cflags --libs gsl`" # NOTE: on my system, pkg-config expands to: diff -Nru xsnow-3.5.3/src/aurora.c xsnow-3.6.0/src/aurora.c --- xsnow-3.5.3/src/aurora.c 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/aurora.c 2022-12-03 13:02:36.000000000 +0000 @@ -45,7 +45,6 @@ (Flags.BirdsOnly || !WorkspaceActive()) static void *do_aurora(void *); -//static void *do_aurora_real(void *); static void aurora_setparms(AuroraMap *a); static void aurora_changeparms(AuroraMap *a); static void aurora_computeparms(AuroraMap *a); @@ -237,7 +236,7 @@ { lock_comp(); - P("thread %ld\n",thread); + P("%d do_aurora\n",global.counter++); lock_init(); AuroraMap *a = (AuroraMap *) d; int j; @@ -390,7 +389,7 @@ cairo_restore(aurora_cr); //free(p); - P("do_aurora xy %d %d %d %d\n",a.x1,a.x2,a.y1,a.y2); + P("%d do_aurora surface %d %d\n",global.counter++,a->width,a->base); // make available just created surface as aurora_surface // and create a new aurora_surface1 lock_copy(); @@ -439,6 +438,7 @@ else // AuroraRight assumed a->x = global.SnowWinWidth - a->width; // - f; + P("a-> a->width %d %d %d\n",a->w,a->width,a->x); //a->y = Flags.AuroraBase *global.SnowWinHeight*0.01; a->y = 0; @@ -520,7 +520,7 @@ if(1) { - // rotation angle + // rotation angle, including some not used methods if(0) { if (a->theta > -8 && a->theta < 8) @@ -784,77 +784,6 @@ a->za[i] *= alpha; } - if(0) - { - // add fuzz when aurora turns direction, not creating extra points - // take care not to add fuzz when this change of direction ('fold') - // is soon followed by another one in the opposite direction - // Not using this implementation any more. - - int f = turnfuzz * global.SnowWinWidth; - int d0 = a->z[1].x - a->z[0].x; - i = 0; - while(1) - { - i++; - if (i >= a->nz-1) - break; - // derivative is z[i].x - z[i-1].x - int d = a->z[i].x - a->z[i-1].x; - if (d0 != d) - { - int jmax = i + f; - if (jmax > a->nz-1) jmax = a->nz-1; - int jmin = i - f; - if (jmin < 1) jmin = 1; - P("d: %d %d %d\n",i,d,a->z[i].x); - int j; - int cut = 0; - for (j = i; jz[j+1].x - a->z[j].x; - P("dd: %d %d %d %d n%d\n",j,d0,d,dd,d!=dd); - if(d != dd) - { - cut = j; - break; - } - } - if(cut) - { - // do not paint parts of aurora that are between to folds - // close to each other - int j; - for (j=i; jza[j] = 0; - P("cut0 %d\n",i); - i = cut; - P("cut1 %d\n",i); - continue; - } - - if(1) - { - int j; - for (j = i; j < jmax; j++) - { - P("jmax: %d %d %d %d %f\n",i,j,a->z[j].x - a->z[j-1].x,d,(double)(j - i)/(jmax - i)); - a->za[j] *= (double)(j - i)/(jmax - i); - } - } - if(1) - { - int j; - for (j = i; j>jmin; j--) - { - P("jmin: %d %d %d %d %f\n",i,j,a->z[j].x - a->z[j+1].x,d,(double)(i - j)/(i - jmin)); - a->za[j] *= (double)(i - j)/(i - jmin); - } - } - } - d0 = d; - } - } if(1) { // add fuzz on turning points, second method @@ -1041,7 +970,7 @@ struct pq *pp = p; pp->x = -1.234; // Compiler warns that possibly pp->x will not be initialized ... pp->y = -1.234; // Same for this one. - // so we give them values here, which will be overwritten later on. + // so we give them values here, which will be overwritten later on. for (i=0; iwin.id == 0 || (!fsnow->win.hidden && - (fsnow->win.ws == global.CWorkSpace || fsnow->win.sticky))) + //(fsnow->win.ws == global.CWorkSpace || fsnow->win.sticky))) + (IsVisibleFallen(fsnow) || fsnow->win.sticky))) UpdateFallenSnowWithWind(fsnow,fsnow->w/4,fsnow->h/4); fsnow = fsnow->next; } diff -Nru xsnow-3.5.3/src/buttons.h xsnow-3.6.0/src/buttons.h --- xsnow-3.5.3/src/buttons.h 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/buttons.h 2022-12-03 13:02:36.000000000 +0000 @@ -61,6 +61,7 @@ BUTTON(togglecode ,xsnow_scenery ,Overlap ,1 ) \ BUTTON(togglecode ,xsnow_celestials ,NoWind ,-1 ) /*i*/ \ BUTTON(togglecode ,xsnow_settings ,BlackBackground ,1 ) \ + BUTTON(togglecode ,xsnow_settings ,Outline ,1 ) \ #define ALL_SCALES \ diff -Nru xsnow-3.5.3/src/clientwin.c xsnow-3.6.0/src/clientwin.c --- xsnow-3.5.3/src/clientwin.c 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/clientwin.c 2022-12-03 13:02:36.000000000 +0000 @@ -165,7 +165,7 @@ if (prop_ret && type_ret == XA_WINDOW && format_ret == 32) { *num = num_ret; - return ((unsigned long *) prop_ret); + return ((unsigned long *) (void*)prop_ret); } if (prop_ret) XFree(prop_ret); diff -Nru xsnow-3.5.3/src/docs.c xsnow-3.6.0/src/docs.c --- xsnow-3.5.3/src/docs.c 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/docs.c 2022-12-03 13:02:36.000000000 +0000 @@ -105,8 +105,13 @@ manout("-selfrep" ,"put tar ball on stdout, so you can do:"); manout("." ,"xsnow -selfrep > xsnow.tar.gz"); #endif - manout("-display name" ,"Drop the snowflakes on the given display."); + manout("-display " ,"Drop the snowflakes on the given display."); manout(" " ,"Make sure the display is nearby, so you can hear them enjoy..."); + manout("-screen " ,"If you have multiple monitors: snow in monitor n."); + manout("." ,"-1: use all monitors (default: %d)",F(Screen)); + manout("." ,"Note: for this to work, Xinerama has to be functional."); + manout("-outline " ,"1: draw outline around snow window. 0: no outline."); + manout("." ,"Default: %d.",F(Outline)); manout("-vintage" ,"Run xsnow in vintage settings."); manout("-defaults" ,"Do not read config file (see FILES)."); manout("-noconfig" ,"Do not read or write config file (see FILES)."); @@ -298,7 +303,6 @@ manout("-viewingdistance " ,"Viewing distance ( 0..95 default: %d).",F(ViewingDistance)); manout("-birdsscale " ,"Scalefactor used painting the birds (default: %d).",F(BirdsScale)); - if(doman) { printf(".PP\n"); printf(".SS \"FILES\n"); @@ -353,43 +357,50 @@ manout(" ","However, with some window managers (FVWM for example), the xsnow-window"); manout(" ","is transparent, but not click-through."); manout(" ","Flags to be tried in this case include: -root, -doublebuffer, -xwininfo, -id."); - manout("."," "); manout(".","Here follow some window managers with their issues:"); manout("."," "); + manout("Tiling window managers","Here you need to float windows with class=Xsnow."); manout("AWESOME","Without compositor: no issues."); - manout(" ","With compositor: no click-through xsnow window"); + manout(".","With compositor: no click-through xsnow window,"); + manout(" ","and issues with multi-monitor setup."); manout("BSPWM","No issues if you add to your bspwmrc (the bspwm configuration file):"); manout("."," bspc rule -a Xsnow state=floating border=off"); manout("CINNAMON","No issues."); manout("DWM","No issues, except the \"Below Windows\" setting in the \"settings\" panel."); - manout("ENLIGHTENMENT","No issuses."); + manout("ENLIGHTENMENT","With one monitor: no issuses."); + manout(".","With more montors: probems with showing in 'all monitors'"); manout("FLUXBOX","Without compositor: no issues."); - manout(" ","With compositor: no click-through xsnow window"); + manout(".","With compositor: no click-through xsnow window"); manout("FVWM","Without compositor: no issues."); - manout(" ","With compositor: no click-through xsnow window"); - manout("GNOME","No issues."); + manout(".","With compositor: no click-through xsnow window"); + manout("GNOME on Xorg","No issues."); + manout("GNOME on Wayland","Most windows don't catch snow."); manout("HERBSTLUFTWM","No issues."); - manout("I3","Without compositor: no issues, using the next line in \"config\":"); + manout("I3","Without compositor: windows don't catch snow, use the next line in \"config\":"); manout("."," for_window [class=\"Xsnow\"] floating enable;border none"); manout(".","With compositor: unworkable."); manout("JVM","No issues."); manout("LXDE","With compositor: no issues."); - manout(" ","Without compositor: use: xsnow -xwininfo"); + manout(".","Without compositor: works with one monitor."); + manout(".","Maybe you need to run with the flag -xwininfo"); manout("LXQT","Without compositor: unworkable."); - manout(" ","With compositor: no click-through xsnow window."); + manout(" ","With compositor: no issues."); manout("MATE","No issues."); manout("OPENBOX","No issues."); manout("PLASMA (KDE)","No issues."); - manout("SPECTREWM","Without compositor: no snow on windows, use the next line in \"spetrewm.conf\":"); + manout("SPECTRWM","Various issues. In any case you need in spectrwm.conf:"); manout("."," quirk[Xsnow] = FLOAT"); - manout(".","With compositor: no satisfactorily results."); manout("TWM","Without compositor: no issues."); - manout(" ","With compositor: no click-through xsnow window"); + manout(".","With compositor: no click-through xsnow window and"); + manout(".","you need to tweak settings->lift snow on windows."); manout("WINDOW MAKER","Without compositor: no issues."); manout(" ","With compositor: no click-through xsnow window"); manout("XFCE","No issues when compositing is on, unworkable when compositing is off."); manout(".","See settings -> Window Manager Tweaks -> Compositor"); - manout("XMONAD","No issues if you add to your xmonad.hs in the ManageHook section:"); + manout("XMONAD","No issues if you add to your xmonad.hs:"); + manout("."," import XMonad.Hooks.EwmhDesktops"); + manout("."," xmonad $ ewmh $ defaultConfig"); + manout("."," in the ManageHook section:"); manout("."," className = ? \"Xsnow\" --> doFloat"); diff -Nru xsnow-3.5.3/src/doit.h xsnow-3.6.0/src/doit.h --- xsnow-3.5.3/src/doit.h 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/doit.h 2022-12-03 13:02:36.000000000 +0000 @@ -53,6 +53,7 @@ // following flags are written to the config file and // are part of the ui +// Note: Screen should not be included in the command line parameters at restart #define DOIT \ DOIT_I(Aurora ,1 ,0 ) \ DOIT_I(AuroraBase ,50 ,50 ) \ @@ -68,6 +69,7 @@ DOIT_I(BlowSnow ,1 ,0 ) \ DOIT_I(CpuLoad ,100 ,100 ) \ DOIT_I(Transparency ,0 ,0 ) \ + DOIT_I(Screen ,-1 ,-1 ) \ DOIT_I(Scale ,100 ,100 ) \ DOIT_I(DesiredNumberOfTrees ,10 ,6 ) \ DOIT_I(FlakeCountMax ,300 ,300 ) \ @@ -104,6 +106,7 @@ DOIT_I(SnowSpeedFactor ,100 ,100 ) \ DOIT_I(Stars ,1 ,0 ) \ DOIT_I(ThemeXsnow ,1 ,1 ) \ + DOIT_I(Outline ,0 ,0 ) \ DOIT_I(TreeFill ,30 ,30 ) \ DOIT_I(VintageFlakes ,0 ,1 ) /* internal flag */\ DOIT_I(WhirlFactor ,100 ,100 ) \ diff -Nru xsnow-3.5.3/src/fallensnow.c xsnow-3.6.0/src/fallensnow.c --- xsnow-3.5.3/src/fallensnow.c 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/fallensnow.c 2022-12-03 13:02:36.000000000 +0000 @@ -308,6 +308,8 @@ void PushFallenSnow(FallenSnow **first, WinInfo *win, int x, int y, int w, int h) { // threads: locking by caller + if(w<3) return; // too narrow windows results in complications with regard to + // computing splines etc. FallenSnow *p = (FallenSnow *)malloc(sizeof(FallenSnow)); p->win = *win; p->x = x; @@ -324,15 +326,6 @@ //p->surface1 = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,w,h); p->surface1 = cairo_surface_create_similar (p->surface, CAIRO_CONTENT_COLOR_ALPHA, w, h); - if(0) - { - cairo_t *cr = cairo_create(p->surface); - cairo_set_source_rgba(cr,1,0,0,0.0); - cairo_rectangle(cr,0,0,w,h); // todo: surface is already clear? - cairo_fill(cr); - cairo_destroy(cr); - } - int l = 0,i; for (i=0; iw; i++) sumact += fallen->acth[i]; - printf("id:%#10lx ws:%4d x:%6d y:%6d w:%6d sty:%2d hid:%2d sum:%8d\n", fallen->win.id, fallen->win.ws, + printf("id:%#10lx ws:%4ld x:%6d y:%6d w:%6d sty:%2d hid:%2d sum:%8d\n", fallen->win.id, fallen->win.ws, fallen->x, fallen->y, fallen->w, fallen->win.sticky, fallen->win.hidden, sumact); fallen = fallen->next; } @@ -675,7 +668,7 @@ free(av); } - if(0) + if(0) // for debugging { // draw max height of fallensnow (using f->desh) cairo_save(cr); @@ -699,38 +692,39 @@ { // threads: locking done by caller if(fsnow->win.id == 0 || (!fsnow->win.hidden && - (fsnow->win.ws == global.CWorkSpace || fsnow->win.sticky))) - { - // do not interfere with Santa - if(!Flags.NoSanta) + //(fsnow->win.ws == global.CWorkSpace || fsnow->win.sticky))) + (IsVisibleFallen(fsnow) || fsnow->win.sticky))) { - int in = XRectInRegion(global.SantaPlowRegion, fsnow->x, fsnow->y - fsnow->h, - fsnow->w, fsnow->h); - if (in == RectangleIn || in == RectanglePart) + // do not interfere with Santa + if(!Flags.NoSanta) { - // determine front of Santa in fsnow - int xfront = global.SantaX+global.SantaWidth - fsnow->x; - // determine back of Santa in fsnow, Santa can move backwards in strong wind - int xback = xfront - global.SantaWidth; - // clearing determines the amount of generated ploughing snow - const int clearing = 10; - float vy = -1.5*global.ActualSantaSpeed; - if(vy > 0) vy = -vy; - if (vy < -100.0) - vy = -100; - if (global.ActualSantaSpeed > 0) - GenerateFlakesFromFallen(fsnow,xfront,clearing,vy); - CleanFallenArea(fsnow,xback-clearing,global.SantaWidth+2*clearing); - int i; - for (i=0; iw; i++) - if (i < xfront+clearing && i>=xback-clearing) - fsnow->acth[i] = 0; - XFlush(global.display); + int in = XRectInRegion(global.SantaPlowRegion, fsnow->x, fsnow->y - fsnow->h, + fsnow->w, fsnow->h); + if (in == RectangleIn || in == RectanglePart) + { + // determine front of Santa in fsnow + int xfront = global.SantaX+global.SantaWidth - fsnow->x; + // determine back of Santa in fsnow, Santa can move backwards in strong wind + int xback = xfront - global.SantaWidth; + // clearing determines the amount of generated ploughing snow + const int clearing = 10; + float vy = -1.5*global.ActualSantaSpeed; + if(vy > 0) vy = -vy; + if (vy < -100.0) + vy = -100; + if (global.ActualSantaSpeed > 0) + GenerateFlakesFromFallen(fsnow,xfront,clearing,vy); + CleanFallenArea(fsnow,xback-clearing,global.SantaWidth+2*clearing); + int i; + for (i=0; iw; i++) + if (i < xfront+clearing && i>=xback-clearing) + fsnow->acth[i] = 0; + XFlush(global.display); + } } + CreateSurfaceFromFallen(fsnow); + // drawing is handled in fallensnow_draw } - CreateSurfaceFromFallen(fsnow); - // drawing is handled in fallensnow_draw - } } void GenerateFlakesFromFallen(FallenSnow *fsnow, int x, int w, float vy) @@ -754,7 +748,6 @@ ilast = fsnow->w; P("ifirst ilast: %d %d %d %d\n",ifirst,ilast,w,w (global.SnowWinHeight-SNOWFREE)) { + if (global.MaxScrSnowDepth > (int)(global.SnowWinHeight-SNOWFREE)) { printf("** Maximum snow depth set to %d\n", global.SnowWinHeight-SNOWFREE); global.MaxScrSnowDepth = global.SnowWinHeight-SNOWFREE; } @@ -939,10 +932,33 @@ return 0; if (!fsnow->win.sticky) { - if (fsnow->win.ws != global.CWorkSpace) + //if (fsnow->win.ws != global.CWorkSpace) + if (!IsVisibleFallen(fsnow)) return 0; } return !Flags.NoKeepSWin; } +int IsVisibleFallen(FallenSnow *fsnow) +{ + if (!fsnow) + { + P("fsnow: %p\n",(void*)fsnow); + return 0; + } + long ws = fsnow->win.ws; + + int i; + for (i=0; iwin.id,ws); + return 1; + } + } + P("desktop not visible %ld %ld\n",fsnow->win.id,ws); + return 0; +} diff -Nru xsnow-3.5.3/src/fallensnow.h xsnow-3.6.0/src/fallensnow.h --- xsnow-3.5.3/src/fallensnow.h 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/fallensnow.h 2022-12-03 13:02:36.000000000 +0000 @@ -58,6 +58,7 @@ extern int unlock_fallen(void); extern int lock_fallen_n(int n, int *c); extern void fallen_sem_init(void); +extern int IsVisibleFallen(FallenSnow *fsnow); // insert a node at the start of the list diff -Nru xsnow-3.5.3/src/flags.c xsnow-3.6.0/src/flags.c --- xsnow-3.5.3/src/flags.c 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/flags.c 2022-12-03 13:02:36.000000000 +0000 @@ -232,6 +232,8 @@ handle_ia(-ignoretop ,IgnoreTop ); handle_ia(-ignorebottom ,IgnoreBottom ); handle_ia(-transparency ,Transparency ); + handle_im(-screen ,Screen ); + handle_ia(-outline ,Outline ); handle_is(-display ,DisplayName ); diff -Nru xsnow-3.5.3/src/main.c xsnow-3.6.0/src/main.c --- xsnow-3.5.3/src/main.c 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/main.c 2022-12-03 13:02:36.000000000 +0000 @@ -48,9 +48,11 @@ #endif #include #include +#include #include #include #include +#include #include #include #include @@ -85,6 +87,7 @@ #include "loadmeasure.h" #include "selfrep.h" #include "safe_malloc.h" +#include "xdo.h" #include "vroot.h" @@ -119,10 +122,11 @@ static int DoRestart = 0; static guint draw_all_id = 0; static guint drawit_id = 0; -static int Xorig; -static int Yorig; static GtkWidget *TransA = NULL; static char *SnowWinName = NULL; +static int wantx = 0; +static int wanty = 0; +static int IsSticky = 0; /* Colo(u)rs */ static const char *BlackColor = "black"; @@ -137,13 +141,15 @@ static void restart_do_draw_all(void); static void set_below_above(void); static void DoAllWorkspaces(void); -static void X11WindowById(Window *xwin, char **xwinname); +static void X11WindowById(Window *xwin); static int HandleX11Cairo(void); static int StartWindow(void); static void SetWindowScale(void); -static void movewindow(void); static void GetDesktopSession(void); - +static void rectangle_draw(cairo_t *cr); +static int X11cairo = 0; +static int PrevW = 0; +static int PrevH = 0; // callbacks static int do_displaychanged(void *); @@ -254,7 +260,7 @@ P("srand %d\n",(int)(fmod(wallcl()*1.0e6,1.0e8))); srand48((int)(fmod(wallcl()*1.0e6,1.0e8))); - memset((void *)&global,0,sizeof(global)); + memset(&global,0,sizeof(global)); XInitThreads(); @@ -272,9 +278,15 @@ global.FluffCount = 0; global.SnowWin = 0; + global.WindowOffsetX = 0; + global.WindowOffsetY = 0; global.DesktopSession = NULL; global.CWorkSpace = 0; + global.ChosenWorkSpace = 0; + global.NVisWorkSpaces = 1; + global.VisWorkSpaces[0] = 0; global.WindowsChanged = 0; + global.ForceRestart = 0; global.FsnowFirst = NULL; global.MaxScrSnowDepth = 0; @@ -288,7 +300,6 @@ global.Wind = 0; global.Direction = 0; - //global.WindMax = 100.0; global.WindMax = 500.0; global.NewWind = 100.0; @@ -298,14 +309,6 @@ global.SantaPlowRegion = 0; int i; - // make a copy of all flags, before gtk_init() maybe removes some. - // we need this at a restart of the program. - - Argv = (char**) malloc((argc+1)*sizeof(char**)); - for (i=0; idebug = 0; + XSynchronize(global.display,dosync); XSetErrorHandler(XsnowErrors); int screen = DefaultScreen(global.display); + global.Screen = screen; global.Black = BlackPixel(global.display, screen); global.White = WhitePixel(global.display, screen); @@ -490,6 +524,7 @@ ClearScreen(); // without this, no snow, scenery etc. in KDE; this seems to be a vintage comment + if(!Flags.NoMenu && !global.XscreensaverMode) { ui(); @@ -527,6 +562,9 @@ fflush(stdout); + DoAllWorkspaces(); // to set global.ChosenWorkSpace + + P("Entering main loop\n"); // main loop gtk_main(); @@ -539,7 +577,11 @@ if (DoRestart) { sleep(0); - printf("Xsnow restarting: %s\n",Argv[0]); + printf("Xsnow restarting: "); + int k = 0; + while (Argv[k]) + printf("%s ",Argv[k++]); + printf("\n"); fflush(NULL); execvp(Argv[0],Argv); } @@ -569,7 +611,7 @@ } } -void X11WindowById(Window *xwin, char **xwinname) +void X11WindowById(Window *xwin) { *xwin = 0; // user supplied window id: @@ -582,8 +624,10 @@ { // user ask to point to a window printf("Click on a window ...\n"); - *xwin = XWinInfo(xwinname); - if (*xwin == 0) + fflush(stdout); + int rc; + rc = xdo_select_window_with_click(global.xdo,xwin); + if (rc == XDO_ERROR) { fprintf(stderr,"XWinInfo failed\n"); exit(1); @@ -626,7 +670,7 @@ int StartWindow() { - int X11cairo = 0; + P("Entering StartWindow...\n"); global.Trans = 0; global.xxposures = 0; @@ -638,7 +682,7 @@ global.Rootwindow = DefaultRootWindow(global.display); Window xwin; // see if user chooses window - X11WindowById(&xwin, NULL); + X11WindowById(&xwin); if (xwin) { P("StartWindow xwin%#lx\n",xwin); @@ -669,13 +713,16 @@ GdkWindow *gdkwin; (void)gdkwin; - int rc = make_trans_window(gtkwin, - 1, // full screen + int rc = make_trans_window(global.display, gtkwin, + Flags.Screen, // full screen or xinerama Flags.AllWorkspaces, // sticky Flags.BelowAll, // below 1, // dock NULL, // gdk_window - &xwin // x11_window + &xwin, // x11_window + &wantx, // make_trans_window tries to place the window here, + // but, depending on window manager that does not always succeed + &wanty ); if (rc) { @@ -690,6 +737,7 @@ set_below_above(); global.SnowWin = xwin; printf("Using transparent window\n"); + P("wantx, wanty: %d %d\n",wantx,wanty); if(!strncasecmp(global.DesktopSession,"fvwm",4) || !strncasecmp(global.DesktopSession,"lxqt",4)) { @@ -724,6 +772,9 @@ xwin = global.Rootwindow; } global.SnowWin = xwin; + int winw,winh; + if (Flags.Screen >=0 && global.Desktop) + xinerama(global.display,Flags.Screen,&wantx,&wanty,&winw,&winh); } } @@ -731,6 +782,14 @@ { HandleX11Cairo(); drawit_id = add_to_mainloop1(PRIORITY_HIGH, time_draw_all, do_drawit, CairoDC); + global.WindowOffsetX = 0; + global.WindowOffsetY = 0; + } + else + { + // see also windows.c + global.WindowOffsetX = wantx; + global.WindowOffsetY = wanty; } global.IsDouble = global.Trans || global.UseDouble; // just to be sure ... @@ -741,28 +800,43 @@ else SnowWinName = strdup("no name"); XFree(x.value); + + if(!X11cairo) + { + xdo_move_window(global.xdo,global.SnowWin,wantx,wanty); + P("wantx wanty: %d %d\n",wantx,wanty); + } + xdo_wait_for_window_map_state(global.xdo,global.SnowWin,IsViewable); InitDisplayDimensions(); + + global.SnowWinX = wantx; + global.SnowWinY = wanty; + printf("Snowing in %#lx: %s %d+%d %dx%d\n",global.SnowWin,SnowWinName,global.SnowWinX,global.SnowWinY,global.SnowWinWidth,global.SnowWinHeight); - fflush(stdout); + PrevW = global.SnowWinWidth; + PrevH = global.SnowWinHeight; - Xorig = global.SnowWinX; - Yorig = global.SnowWinY; + P("woffx: %d %d\n",global.WindowOffsetX,global.WindowOffsetY); - movewindow(); + fflush(stdout); SetWindowScale(); if (global.XscreensaverMode && !Flags.BlackBackground) SetBackground(); + /* + * to remove titlebar in mwm. Alas, this results in no visuals at all in xfce. + XSetWindowAttributes attr; + attr.override_redirect = True; + XChangeWindowAttributes(global.display,global.SnowWin,CWOverrideRedirect,&attr); + */ return TRUE; } int HandleX11Cairo() { - XWindowAttributes attr; - XGetWindowAttributes(global.display,global.SnowWin,&attr); - int w = attr.width; - int h = attr.height; + unsigned int w,h; + xdo_get_window_size(global.xdo, global.SnowWin, &w, &h); Visual *visual = DefaultVisual(global.display,DefaultScreen(global.display)); int rcv; P("double: %d\n",Flags.UseDouble); @@ -796,6 +870,7 @@ else printf(" on your request.\n"); printf("NOTE: expect some flicker.\n"); + fflush(stdout); rcv = FALSE; } @@ -804,6 +879,24 @@ CairoDC = cairo_create(CairoSurface); cairo_xlib_surface_set_size(CairoSurface,w,h); + global.SnowWinWidth = w; + global.SnowWinHeight = h; + if (Flags.Screen >= 0 && global.Desktop) + { + int winx, winy, winw, winh; + int rc = xinerama(global.display,Flags.Screen,&winx, &winy, &winw, &winh); + //if (rc && winx==0 && winy==0) + if(rc) + { + global.SnowWinX = winx; + global.SnowWinY = winy; + global.SnowWinWidth = winw; + global.SnowWinHeight = winh; + } + cairo_rectangle(CairoDC,global.SnowWinX,global.SnowWinY,global.SnowWinWidth,global.SnowWinHeight); + P("clipsnow %d %d %d %d\n",global.SnowWinX,global.SnowWinY,global.SnowWinWidth,global.SnowWinHeight); + cairo_clip(CairoDC); + } return rcv; } @@ -812,20 +905,37 @@ if(Flags.AllWorkspaces) { P("stick\n"); - if (global.Trans) - { - gtk_window_stick(GTK_WINDOW(TransA)); - } + set_sticky(1); } else { P("unstick\n"); - if (global.Trans) + set_sticky(0); + if (Flags.Screen >=0) + global.ChosenWorkSpace = global.VisWorkSpaces[Flags.Screen]; + else + global.ChosenWorkSpace = global.VisWorkSpaces[0]; + } + ui_set_sticky(Flags.AllWorkspaces); +} + +int set_sticky(int s) +{ + int r = IsSticky; + if (global.Trans) + { + if(s) + { + IsSticky = 1; + gtk_window_stick(GTK_WINDOW(TransA)); + } + else { + IsSticky = 0; gtk_window_unstick(GTK_WINDOW(TransA)); } } - ui_set_sticky(Flags.AllWorkspaces); + return r; } // here we are handling the buttons in ui @@ -878,15 +988,6 @@ } -void movewindow() -{ - if(!global.Desktop) - return; - XMoveWindow(global.display,global.SnowWin,0,0); - //InitDisplayDimensions(); - P("movewindow: Orig: %d %d %d %d\n",Xorig,Yorig,global.SnowWinWidth,global.SnowWinHeight); -} - int do_displaychanged(void *d) { // if we are snowing in the desktop, we check if the size has changed, @@ -901,22 +1002,30 @@ if (!global.Desktop) return TRUE; + + if (global.ForceRestart) + { + DoRestart = 1; + Flags.Done = 1; + I("Restart due to change of screen settings...\n"); + } + else { unsigned int w,h; Display* display = XOpenDisplay(Flags.DisplayName); Screen* screen = DefaultScreenOfDisplay(display); w = WidthOfScreen(screen); h = HeightOfScreen(screen); - P("width height: %d %d\n",w,h); + P("width height: %d %d %d %d\n",w,h,global.Wroot,global.Hroot); if(global.Wroot != w || global.Hroot != h) { DoRestart = 1; Flags.Done = 1; - printf("Restart due to change of display settings...\n"); + I("Restart due to change of display settings...\n"); } XCloseDisplay(display); - return TRUE; } + return TRUE; } int do_event(void *d) @@ -965,6 +1074,7 @@ void RestartDisplay() { P("Restartdisplay: %d W: %d H: %d\n",global.counter++,global.SnowWinWidth,global.SnowWinHeight); + fflush(stdout); InitFallenSnow(); init_stars(); EraseTrees(); @@ -1020,18 +1130,29 @@ (void)d; if (Flags.Done) return FALSE; - return TRUE; + int xret,yret; + unsigned int wret,hret; + xdo_get_window_location(global.xdo, global.SnowWin,&xret,&yret,NULL); + xdo_get_window_size(global.xdo, global.SnowWin, &wret, &hret); + P("%d wxh %d %d %d %d %d %d %d %d \n",global.counter++,global.SnowWinX,global.SnowWinY,global.SnowWinWidth,global.SnowWinHeight,xret,yret,wret,hret); + P("WorkspaceActive, chosen: %d %ld\n",WorkspaceActive(),global.ChosenWorkSpace); + P("vis:"); + int i; + for (i=0; i $@ endif -EXTRA_DIST = gen_snow_includes.sh gen_ui_xml.sh tocc.sh toascii.sh +EXTRA_DIST = gen_snow_includes.sh gen_ui_xml.sh tocc.sh toascii.sh xdo-copyright ui_xml.h: ui.xml $(top_srcdir)/src/gen_ui_xml.sh @echo "Creating $@ from $<" diff -Nru xsnow-3.5.3/src/Makefile.in xsnow-3.6.0/src/Makefile.in --- xsnow-3.5.3/src/Makefile.in 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/Makefile.in 2022-12-03 13:02:36.000000000 +0000 @@ -15,6 +15,7 @@ @SET_MAKE@ + VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -105,6 +106,17 @@ am__installdirs = "$(DESTDIR)$(gamesdir)" "$(DESTDIR)$(man6dir)" \ "$(DESTDIR)$(appicondir)" PROGRAMS = $(games_PROGRAMS) +LIBRARIES = $(noinst_LIBRARIES) +AR = ar +ARFLAGS = cru +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libxdo_a_AR = $(AR) $(ARFLAGS) +libxdo_a_LIBADD = +am_libxdo_a_OBJECTS = libxdo_a-xdo.$(OBJEXT) +libxdo_a_OBJECTS = $(am_libxdo_a_OBJECTS) am_xsnow_OBJECTS = xsnow-clocks.$(OBJEXT) xsnow-ixpm.$(OBJEXT) \ xsnow-main.$(OBJEXT) xsnow-fallensnow.$(OBJEXT) \ xsnow-wmctrl.$(OBJEXT) xsnow-docs.$(OBJEXT) \ @@ -126,7 +138,7 @@ xsnow_OBJECTS = $(am_xsnow_OBJECTS) $(nodist_xsnow_OBJECTS) am__DEPENDENCIES_1 = xsnow_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) libxdo.a AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -142,19 +154,20 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/xsnow-Santa.Po \ - ./$(DEPDIR)/xsnow-aurora.Po ./$(DEPDIR)/xsnow-birds.Po \ - ./$(DEPDIR)/xsnow-blowoff.Po ./$(DEPDIR)/xsnow-clientwin.Po \ - ./$(DEPDIR)/xsnow-clocks.Po ./$(DEPDIR)/xsnow-csvpos.Po \ - ./$(DEPDIR)/xsnow-docs.Po ./$(DEPDIR)/xsnow-dsimple.Po \ - ./$(DEPDIR)/xsnow-fallensnow.Po ./$(DEPDIR)/xsnow-flags.Po \ - ./$(DEPDIR)/xsnow-hashtable.Po ./$(DEPDIR)/xsnow-ixpm.Po \ - ./$(DEPDIR)/xsnow-kdtree.Po ./$(DEPDIR)/xsnow-loadmeasure.Po \ - ./$(DEPDIR)/xsnow-main.Po ./$(DEPDIR)/xsnow-mainstub.Po \ - ./$(DEPDIR)/xsnow-meteor.Po ./$(DEPDIR)/xsnow-moon.Po \ - ./$(DEPDIR)/xsnow-pixmaps.Po ./$(DEPDIR)/xsnow-safe_malloc.Po \ - ./$(DEPDIR)/xsnow-scenery.Po ./$(DEPDIR)/xsnow-selfrep.Po \ - ./$(DEPDIR)/xsnow-snow.Po ./$(DEPDIR)/xsnow-spline_interpol.Po \ +am__depfiles_remade = ./$(DEPDIR)/libxdo_a-xdo.Po \ + ./$(DEPDIR)/xsnow-Santa.Po ./$(DEPDIR)/xsnow-aurora.Po \ + ./$(DEPDIR)/xsnow-birds.Po ./$(DEPDIR)/xsnow-blowoff.Po \ + ./$(DEPDIR)/xsnow-clientwin.Po ./$(DEPDIR)/xsnow-clocks.Po \ + ./$(DEPDIR)/xsnow-csvpos.Po ./$(DEPDIR)/xsnow-docs.Po \ + ./$(DEPDIR)/xsnow-dsimple.Po ./$(DEPDIR)/xsnow-fallensnow.Po \ + ./$(DEPDIR)/xsnow-flags.Po ./$(DEPDIR)/xsnow-hashtable.Po \ + ./$(DEPDIR)/xsnow-ixpm.Po ./$(DEPDIR)/xsnow-kdtree.Po \ + ./$(DEPDIR)/xsnow-loadmeasure.Po ./$(DEPDIR)/xsnow-main.Po \ + ./$(DEPDIR)/xsnow-mainstub.Po ./$(DEPDIR)/xsnow-meteor.Po \ + ./$(DEPDIR)/xsnow-moon.Po ./$(DEPDIR)/xsnow-pixmaps.Po \ + ./$(DEPDIR)/xsnow-safe_malloc.Po ./$(DEPDIR)/xsnow-scenery.Po \ + ./$(DEPDIR)/xsnow-selfrep.Po ./$(DEPDIR)/xsnow-snow.Po \ + ./$(DEPDIR)/xsnow-spline_interpol.Po \ ./$(DEPDIR)/xsnow-stars.Po ./$(DEPDIR)/xsnow-transwindow.Po \ ./$(DEPDIR)/xsnow-treesnow.Po ./$(DEPDIR)/xsnow-ui.Po \ ./$(DEPDIR)/xsnow-utils.Po ./$(DEPDIR)/xsnow-wind.Po \ @@ -189,8 +202,8 @@ am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = -SOURCES = $(xsnow_SOURCES) $(nodist_xsnow_SOURCES) -DIST_SOURCES = $(xsnow_SOURCES) +SOURCES = $(libxdo_a_SOURCES) $(xsnow_SOURCES) $(nodist_xsnow_SOURCES) +DIST_SOURCES = $(libxdo_a_SOURCES) $(xsnow_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -525,6 +538,7 @@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -612,7 +626,10 @@ gamesdir = $(exec_prefix)/games xsnow_CPPFLAGS = $(GTK_CFLAGS) $(X11_CFLAGS) $(GSL_CFLAGS) \ $(am__append_1) -xsnow_LDADD = $(GTK_LIBS) $(X11_LIBS) $(GSL_LIBS) +xsnow_LDADD = $(GTK_LIBS) $(X11_LIBS) $(GSL_LIBS) libxdo.a +libxdo_a_CPPFLAGS = $(X11_CFLAGS) +noinst_LIBRARIES = libxdo.a +libxdo_a_SOURCES = xdo.c xdo.h xdo_util.h xdo_version.h xsnow_SOURCES = clocks.c ixpm.c main.c fallensnow.c wmctrl.c docs.c \ clocks.h ixpm.h docs.h fallensnow.h pixmaps.h \ pixmaps.c version.h wmctrl.h xsnow.h windows.c windows.h\ @@ -635,12 +652,12 @@ selfrep.c selfrep.h \ aurora.c aurora.h \ spline_interpol.c spline_interpol.h \ - safe_malloc.c safe_malloc.h + safe_malloc.c safe_malloc.h nodist_xsnow_SOURCES = ui_xml.h snow_includes.h BUILT_SOURCES = ui_xml.h snow_includes.h tarfile.inc tarfile = $(top_builddir)/xsnow-$(VERSION).tar.gz -EXTRA_DIST = gen_snow_includes.sh gen_ui_xml.sh tocc.sh toascii.sh +EXTRA_DIST = gen_snow_includes.sh gen_ui_xml.sh tocc.sh toascii.sh xdo-copyright TESTS = test1.sh appicondir = $(datadir)/pixmaps appicon_DATA = Pixmaps/xsnow.svg @@ -725,6 +742,14 @@ clean-gamesPROGRAMS: -test -z "$(games_PROGRAMS)" || rm -f $(games_PROGRAMS) +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +libxdo.a: $(libxdo_a_OBJECTS) $(libxdo_a_DEPENDENCIES) $(EXTRA_libxdo_a_DEPENDENCIES) + $(AM_V_at)-rm -f libxdo.a + $(AM_V_AR)$(libxdo_a_AR) libxdo.a $(libxdo_a_OBJECTS) $(libxdo_a_LIBADD) + $(AM_V_at)$(RANLIB) libxdo.a + xsnow$(EXEEXT): $(xsnow_OBJECTS) $(xsnow_DEPENDENCIES) $(EXTRA_xsnow_DEPENDENCIES) @rm -f xsnow$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(xsnow_OBJECTS) $(xsnow_LDADD) $(LIBS) @@ -735,6 +760,7 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxdo_a-xdo.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsnow-Santa.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsnow-aurora.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsnow-birds.Po@am__quote@ # am--include-marker @@ -789,6 +815,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +libxdo_a-xdo.o: xdo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxdo_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libxdo_a-xdo.o -MD -MP -MF $(DEPDIR)/libxdo_a-xdo.Tpo -c -o libxdo_a-xdo.o `test -f 'xdo.c' || echo '$(srcdir)/'`xdo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxdo_a-xdo.Tpo $(DEPDIR)/libxdo_a-xdo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xdo.c' object='libxdo_a-xdo.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxdo_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxdo_a-xdo.o `test -f 'xdo.c' || echo '$(srcdir)/'`xdo.c + +libxdo_a-xdo.obj: xdo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxdo_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libxdo_a-xdo.obj -MD -MP -MF $(DEPDIR)/libxdo_a-xdo.Tpo -c -o libxdo_a-xdo.obj `if test -f 'xdo.c'; then $(CYGPATH_W) 'xdo.c'; else $(CYGPATH_W) '$(srcdir)/xdo.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxdo_a-xdo.Tpo $(DEPDIR)/libxdo_a-xdo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xdo.c' object='libxdo_a-xdo.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxdo_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxdo_a-xdo.obj `if test -f 'xdo.c'; then $(CYGPATH_W) 'xdo.c'; else $(CYGPATH_W) '$(srcdir)/xdo.c'; fi` + xsnow-clocks.o: clocks.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xsnow_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xsnow-clocks.o -MD -MP -MF $(DEPDIR)/xsnow-clocks.Tpo -c -o xsnow-clocks.o `test -f 'clocks.c' || echo '$(srcdir)/'`clocks.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xsnow-clocks.Tpo $(DEPDIR)/xsnow-clocks.Po @@ -1650,7 +1690,7 @@ $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive -all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) +all-am: Makefile $(PROGRAMS) $(LIBRARIES) $(MANS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(gamesdir)" "$(DESTDIR)$(man6dir)" "$(DESTDIR)$(appicondir)"; do \ @@ -1695,10 +1735,12 @@ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive -clean-am: clean-gamesPROGRAMS clean-generic mostlyclean-am +clean-am: clean-gamesPROGRAMS clean-generic clean-noinstLIBRARIES \ + mostlyclean-am distclean: distclean-recursive - -rm -f ./$(DEPDIR)/xsnow-Santa.Po + -rm -f ./$(DEPDIR)/libxdo_a-xdo.Po + -rm -f ./$(DEPDIR)/xsnow-Santa.Po -rm -f ./$(DEPDIR)/xsnow-aurora.Po -rm -f ./$(DEPDIR)/xsnow-birds.Po -rm -f ./$(DEPDIR)/xsnow-blowoff.Po @@ -1776,7 +1818,8 @@ installcheck-am: maintainer-clean: maintainer-clean-recursive - -rm -f ./$(DEPDIR)/xsnow-Santa.Po + -rm -f ./$(DEPDIR)/libxdo_a-xdo.Po + -rm -f ./$(DEPDIR)/xsnow-Santa.Po -rm -f ./$(DEPDIR)/xsnow-aurora.Po -rm -f ./$(DEPDIR)/xsnow-birds.Po -rm -f ./$(DEPDIR)/xsnow-blowoff.Po @@ -1834,20 +1877,20 @@ .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-TESTS check-am clean \ - clean-gamesPROGRAMS clean-generic cscopelist-am ctags ctags-am \ - distclean distclean-compile distclean-generic distclean-tags \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-appiconDATA install-data install-data-am \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-gamesPROGRAMS install-html install-html-am \ - install-info install-info-am install-man install-man6 \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ - ps ps-am recheck tags tags-am uninstall uninstall-am \ - uninstall-appiconDATA uninstall-gamesPROGRAMS uninstall-man \ - uninstall-man6 + clean-gamesPROGRAMS clean-generic clean-noinstLIBRARIES \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-appiconDATA \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-gamesPROGRAMS \ + install-html install-html-am install-info install-info-am \ + install-man install-man6 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am recheck tags tags-am \ + uninstall uninstall-am uninstall-appiconDATA \ + uninstall-gamesPROGRAMS uninstall-man uninstall-man6 .PRECIOUS: Makefile diff -Nru xsnow-3.5.3/src/moon.c xsnow-3.6.0/src/moon.c --- xsnow-3.5.3/src/moon.c 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/moon.c 2022-12-03 13:02:36.000000000 +0000 @@ -68,7 +68,7 @@ int moon_draw(cairo_t *cr) { LEAVE_IF_INACTIVE; - P("moon_draw %d %d %d\n",counter++,(int)global.moonX,(int)global.moonY); + P("moon_draw %d %d %d\n",global.counter++,(int)global.moonX,(int)global.moonY); cairo_set_source_surface (cr, moon_surface, global.moonX, global.moonY); my_cairo_paint_with_alpha(cr,ALPHA); OldmoonX = global.moonX; @@ -186,6 +186,7 @@ ydirection = 1; } + P("Moon pos: %d %d\n",(int)global.moonX,(int)global.moonY); return TRUE; } diff -Nru xsnow-3.5.3/src/Pixmaps/Makefile.in xsnow-3.6.0/src/Pixmaps/Makefile.in --- xsnow-3.5.3/src/Pixmaps/Makefile.in 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/Pixmaps/Makefile.in 2022-12-03 13:02:36.000000000 +0000 @@ -179,6 +179,7 @@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ diff -Nru xsnow-3.5.3/src/snow.c xsnow-3.6.0/src/snow.c --- xsnow-3.5.3/src/snow.c 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/snow.c 2022-12-03 13:02:36.000000000 +0000 @@ -50,7 +50,6 @@ #define add_flake_to_mainloop(f) add_to_mainloop1(PRIORITY_HIGH,time_snowflakes,(GSourceFunc)do_UpdateSnowFlake,f) -//static cairo_surface_t **snow_surfaces; static float FlakesPerSecond; static int KillFlakes = 0; // 1: signal to flakes to kill themselves, and do not generate flakes static float SnowSpeedFactor; @@ -98,7 +97,6 @@ for (i=0; iwin.hidden) - if(fsnow->win.id == 0 ||(fsnow->win.ws == global.CWorkSpace || fsnow->win.sticky)) + //if(fsnow->win.id == 0 ||(fsnow->win.ws == global.CWorkSpace || fsnow->win.sticky)) + if(fsnow->win.id == 0 ||(IsVisibleFallen(fsnow) || fsnow->win.sticky)) { if (nx >= fsnow->x && nx <= fsnow->x + fsnow->w && ny < fsnow->y+2) diff -Nru xsnow-3.5.3/src/spline_interpol.c xsnow-3.6.0/src/spline_interpol.c --- xsnow-3.5.3/src/spline_interpol.c 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/spline_interpol.c 2022-12-03 13:02:36.000000000 +0000 @@ -18,10 +18,12 @@ #-# along with this program. If not, see . #-# * */ +#define GSL_INTERP_MESSAGE #include #include #include #include "spline_interpol.h" +#include "debug.h" void spline_interpol(const double *px, int np, const double *py, const double *x, int nx, double *y) { diff -Nru xsnow-3.5.3/src/spline_interpol.h xsnow-3.6.0/src/spline_interpol.h --- xsnow-3.5.3/src/spline_interpol.h 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/spline_interpol.h 2022-12-03 13:02:36.000000000 +0000 @@ -19,11 +19,33 @@ #-# * */ #pragma once +#include "config.h" +#ifdef HAVE_GSL_INTERP_STEFFEN // steffen's method prevent overshoots: #define SPLINE_INTERP gsl_interp_steffen + +#elif HAVE_GSL_INTERP_AKIMA +// akima's method tries to prevent overshoots: +#ifdef GSL_INTERP_MESSAGE +#pragma message "Using interpolation with Akima's method" +#endif +#define SPLINE_INTERP gsl_interp_akima + +#elif HAVE_GSL_INTERP_CSPLINE // classic spline with overshoots: -//#define SPLINE_INTERP gsl_interp_cspline +#ifdef GSL_INTERP_MESSAGE +#pragma message "Using interpolation with classic spline" +#endif +#define SPLINE_INTERP gsl_interp_cspline + +#else +// linear interpolation: +#ifdef GSL_INTERP_MESSAGE +#pragma message "Using linear interpolation" +#endif +#define SPLINE_INTERP gsl_interp_linear +#endif void spline_interpol(const double *p, int np, const double *py, const double *x, int nx, double *y); diff -Nru xsnow-3.5.3/src/stars.c xsnow-3.6.0/src/stars.c --- xsnow-3.5.3/src/stars.c 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/stars.c 2022-12-03 13:02:36.000000000 +0000 @@ -126,6 +126,7 @@ cairo_set_source_surface (cr, surfaces[color], x, y); my_cairo_paint_with_alpha(cr,ALPHA); } + cairo_restore(cr); } diff -Nru xsnow-3.5.3/src/transwindow.c xsnow-3.6.0/src/transwindow.c --- xsnow-3.5.3/src/transwindow.c 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/transwindow.c 2022-12-03 13:02:36.000000000 +0000 @@ -17,12 +17,14 @@ #-# You should have received a copy of the GNU General Public License #-# along with this program. If not, see . #-# - */ +*/ #include #include #include #include +#include #include "transwindow.h" +#include "windows.h" #include "debug.h" @@ -31,7 +33,7 @@ /* * creates transparent window using gtk3/cairo. * transwindow: (input) GtkWidget to create transparent window in - * fullscreen: (input) full-screen or not full screen + * xscreen: (input) <0: full-screen else xinerama screen number * sticky: (input) visible on all workspaces or not * below: (input) 1: below all other windows 2: above all other windows 0: no action * dock: (input) make it a 'dock' window: no decoration and not interfering with xsnow, xpenguins @@ -43,9 +45,10 @@ * gdk_window: (output) GdkWindow created * x11_window: (output) Window X11 window created */ -int make_trans_window(GtkWidget *transwindow, int fullscreen, int sticky, int below, int dock, - GdkWindow **gdk_window, Window *x11_window) +int make_trans_window(Display *display, GtkWidget *transwindow, int xscreen, int sticky, int below, int dock, + GdkWindow **gdk_window, Window *x11_window, int *wantx, int *wanty) { + P("Entering make_trans_window...\n"); if(gdk_window) *gdk_window = NULL; if(x11_window) @@ -97,20 +100,32 @@ // Ensure the widget (the window, actually) can take RGBA gtk_widget_set_visual(transwindow, gdk_screen_get_rgba_visual(screen)); + int winx, winy; // desired position of window + int winw, winh; // desired size of window + int wantxin = (xscreen >=0); // set full screen if so desired: - if(fullscreen) + P("xscreen: %d\n",xscreen); + if(xscreen < 0) { P("fullscreen\n"); XWindowAttributes attr; - Display *display = XOpenDisplay(NULL); XGetWindowAttributes(display,DefaultRootWindow(display),&attr); P("width, height %d %d\n",attr.width,attr.height); gtk_widget_set_size_request(GTK_WIDGET(transwindow),attr.width,attr.height); - XCloseDisplay(display); + winx = 0; + winy = 0; + winw = attr.width; + winh = attr.height; } else { - P("NOT fullsscreen\n"); + P("NOT fullscreen, but xineramascreen %d\n",xscreen); + wantxin = xinerama(display,xscreen,&winx,&winy,&winw,&winh); + if(wantxin) + { + gtk_widget_set_size_request(GTK_WIDGET(transwindow),winw,winh); + P("winx ... %d %d %d %d\n",winx,winy,winw,winh); + } } gtk_widget_show_all(transwindow); @@ -120,21 +135,34 @@ if(dock) gdk_window_set_type_hint(gdkwin,GDK_WINDOW_TYPE_HINT_DOCK); - gdk_window_hide(gdkwin); - if(fullscreen) - gdk_window_move(gdkwin,0,0); + //gdk_window_hide(gdkwin); + gdk_window_show(gdkwin); if (x11_window) + { *x11_window = gdk_x11_window_get_xid(gdkwin); + P("resize %p: %d %d\n",(void*)*x11_window,winw,winh); + XResizeWindow(display,*x11_window,winw,winh); // necessary in xmonad, don't know why, + XFlush(display); // in combination with this one + } if (gdk_window) *gdk_window = gdkwin; + *wantx = winx; + *wanty = winy; usleep(200000); // seems sometimes to be necessary with nvidia // just to be sure all settings are communicated with the server gtk_widget_hide(transwindow); gtk_widget_show_all(transwindow); + if(xscreen < 0) + gtk_window_move(GTK_WINDOW(transwindow),0,0); + else if (wantxin) + { + P("Calling gtk_window_move %d %d\n",winx,winy); + gtk_window_move(GTK_WINDOW(transwindow),winx,winy); + } // set some things, but note that this has to be repeated in the gkt_main loop. @@ -146,6 +174,7 @@ return TRUE; } + // for some reason, in some environments the 'below' and 'stick' properties // disappear. It works again, if we express our wishes after starting gtk_main // and the best place is in the draw event. diff -Nru xsnow-3.5.3/src/transwindow.h xsnow-3.6.0/src/transwindow.h --- xsnow-3.5.3/src/transwindow.h 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/transwindow.h 2022-12-03 13:02:36.000000000 +0000 @@ -23,7 +23,8 @@ #include #include -extern int make_trans_window(GtkWidget *Transwindow, int Fullscreen, int sticky, int below, int dock, - GdkWindow **gdk_window, Window *x11_window); +extern int make_trans_window(Display *display, GtkWidget *Transwindow, int Xscreen, + int sticky, int below, int dock, + GdkWindow **gdk_window, Window *x11_window, int *wantx, int *wanty); extern void setbelow(GtkWindow *w); extern void setabove(GtkWindow *w); diff -Nru xsnow-3.5.3/src/ui.c xsnow-3.6.0/src/ui.c --- xsnow-3.5.3/src/ui.c 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/ui.c 2022-12-03 13:02:36.000000000 +0000 @@ -140,6 +140,7 @@ #include #include #include +#include #include "birds.h" #include "clocks.h" @@ -188,6 +189,9 @@ static GtkContainer *birdsgrid; static GtkContainer *moonbox; static GtkImage *preview; +static int Nscreens; +static int HaveXinerama; + #define nsbuffer 512 static char sbuffer[nsbuffer]; @@ -205,6 +209,7 @@ static void set_default_tab(int tab, int vintage); static void set_belowall_default(); static void handle_theme(void); +static void handle_screen(void); static void update_preview_cb (GtkFileChooser *file_chooser, gpointer data); static void my_gtk_label_set_text(GtkLabel *label, const gchar *str); @@ -220,6 +225,8 @@ void ui_ui() { UIDO (ThemeXsnow, handle_theme();); + UIDO (Screen, handle_screen();); + UIDO (Outline, ClearScreen();); } void handle_theme() @@ -236,6 +243,12 @@ } } +void handle_screen() +{ + P("handle_screen:%d\n",Flags.Screen); + if (HaveXinerama && Nscreens > 1) + global.ForceRestart = 1; +} MODULE_EXPORT void button_iconify() @@ -672,6 +685,16 @@ remove_from_mainloop(&bct_id); } + +MODULE_EXPORT void combo_screen(GtkComboBoxText *combo, gpointer data) +{ + (void)data; + int num = gtk_combo_box_get_active(GTK_COMBO_BOX(combo)); + P("combo_screen:%d\n",num); + Flags.Screen = num-1; +} + + static void init_general_buttons() { g_signal_connect(Button.BelowAll, "toggled", G_CALLBACK (button_below), NULL); @@ -683,7 +706,6 @@ } - void show_bct_countdown() { sprintf(sbuffer,"Click to\nconfirm %d",bct_countdown); @@ -715,7 +737,6 @@ } - MODULE_EXPORT void button_quit() { @@ -845,6 +866,7 @@ set_belowall_default(); free(Flags.BackgroundFile); Flags.BackgroundFile = strdup(background); + Flags.Screen = VINTAGE(Screen); break; } } @@ -876,6 +898,7 @@ set_belowall_default(); free(Flags.BackgroundFile); Flags.BackgroundFile = strdup(background); + Flags.Screen = DEFAULT(Screen); break; } } @@ -1034,6 +1057,49 @@ g_signal_connect (GTK_FILE_CHOOSER(Button.BackgroundFile), "update-preview", G_CALLBACK (update_preview_cb), preview); + + XineramaScreenInfo *xininfo = XineramaQueryScreens(global.display,&Nscreens); + if (xininfo == NULL) + { + P("No xinerama...\n"); + HaveXinerama = 0; + } + else + { + HaveXinerama = 1; + } + + GtkComboBoxText *ScreenButton; + ScreenButton = GTK_COMBO_BOX_TEXT(gtk_builder_get_object(builder,"id-Screen")); + + if (Nscreens < 2) + { + gtk_widget_set_sensitive(GTK_WIDGET(ScreenButton),FALSE); + Flags.Screen = -1; + } + if (Flags.Screen < -1) + Flags.Screen = -1; + if (Flags.Screen >= Nscreens) + Flags.Screen = Nscreens - 1; + + gtk_combo_box_text_remove_all(ScreenButton); + gtk_combo_box_text_append_text(ScreenButton,"all monitors"); + + char *s = NULL; + int p = 0; + int i; + for (i=0; i window.popup * { background: #E2FDEC; }" // does not work, somebody? ".xsnow radiobutton:active, .xsnow button:active { background: #0DAB44; }" // color of buttons while being activated ".xsnow radiobutton:checked, .xsnow button:checked { background: #6AF69B; }" // color of checked buttons ".xsnow headerbar { background: #B3F4CA; }" // color of headerbar diff -Nru xsnow-3.5.3/src/ui.xml xsnow-3.6.0/src/ui.xml --- xsnow-3.5.3/src/ui.xml 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/ui.xml 2022-12-03 13:02:36.000000000 +0000 @@ -952,8 +952,8 @@ True False - If the system is too busy, all panels get this color. -You could adapt some things in "snow", "birds" or "settings". + If the system is too busy, all panels get this color, in which case +you could adapt some things in "snow", "birds" or "settings", "celestials" center 0.5 0.5 @@ -3830,6 +3830,9 @@ 0 False left + 3 @@ -3862,6 +3865,9 @@ 0 False left + 5 @@ -5519,6 +5525,48 @@ 4 + + + + + + True + False + If you have more than one monitor, choose where you want snow falling. Choose 'all monitors' if you want snow in all monitors. +NOTE: when changing monitor, xsnow will restart. +Flag: -screen + 1 + + all monitors + monitor 1 + + + + False + True + 6 + + + + + Draw +outline + True + True + True + To draw an outline around the snow window. +Flag: -outline 1/0 + False + center + center + 6 + + + False + True + 7 + + 0 diff -Nru xsnow-3.5.3/src/utils.c xsnow-3.6.0/src/utils.c --- xsnow-3.5.3/src/utils.c 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/utils.c 2022-12-03 13:02:36.000000000 +0000 @@ -218,8 +218,17 @@ void PrintVersion() { - printf("%s\n%s\n", - PACKAGE_STRING, VERSIONBY); + int l = 4 + strlen(PACKAGE_STRING); + int i; + printf(" "); + for (i=0; i #include #include +#include #include //#include #include "debug.h" @@ -36,6 +37,7 @@ #include "transwindow.h" #include "dsimple.h" #include "safe_malloc.h" +#include "xdo.h" #include "vroot.h" static int do_sendevent(void *); @@ -44,6 +46,7 @@ static WinInfo *Windows = NULL; static int NWindows; static int do_wupdate(void *); +static void DetermineVisualWorkspaces(void); void windows_ui() { @@ -64,7 +67,10 @@ void windows_init() { if (global.Desktop) + { + DetermineVisualWorkspaces(); add_to_mainloop(PRIORITY_DEFAULT, time_wupdate, do_wupdate); + } if (!global.IsDouble) add_to_mainloop(PRIORITY_DEFAULT, time_sendevent, do_sendevent); } @@ -74,7 +80,15 @@ P("global.Trans etc %d %d %d %d\n",Flags.AllWorkspaces,global.Trans,global.CWorkSpace == TransWorkSpace, Flags.AllWorkspaces || !global.Trans || global.CWorkSpace == TransWorkSpace); // ah, so difficult ... - return Flags.AllWorkspaces || !global.Trans || global.CWorkSpace == TransWorkSpace; + if (Flags.AllWorkspaces) + return 1; + int i; + for (i=0; i=0) + { global.CWorkSpace = r; + if (r != PrevWorkSpace) + { + P("workspace changed from %ld to %ld\n",PrevWorkSpace,r); + PrevWorkSpace = r; + DetermineVisualWorkspaces(); + } + } else { I("Cannot get current workspace\n"); @@ -142,7 +165,6 @@ goto end; } - P("Update windows\n"); if(Windows) free(Windows); @@ -166,8 +188,16 @@ goto end; } - //P("%d:\n",counter++);printwindows(display,Windows,NWindows); - //P("%d:\n",counter++);PrintFallenSnow(global.FsnowFirst); + int i; + for (i=0; ix += global.WindowOffsetX-global.SnowWinX; + w->y += global.WindowOffsetY-global.SnowWinY; + } + + // Take care of the situation that the transparent window changes from workspace, // which can happen if in a dynamic number of workspaces environment // a workspace is emptied. @@ -187,7 +217,7 @@ { TransWorkSpace = winfo->ws; } - P("TransWorkSpace %#lx %#lx %#lx %#lx\n",TransWorkSpace,winfo->ws,global.SnowWin,GetCurrentWorkspace()); + P("TransWorkSpace %ld %#lx %#lx %ld\n",TransWorkSpace,winfo->ws,global.SnowWin,GetCurrentWorkspace()); } P("do_wupdate: %d %p\n",global.Trans,(void *)winfo); @@ -207,6 +237,126 @@ (void)dummy; } +void DetermineVisualWorkspaces() +{ + P("%d Entering DetermineVisualWorkspaces\n",global.counter++); + static Window ProbeWindow = 0; + static XClassHint class_hints; + static XSetWindowAttributes attr; + static long valuemask; + static long hints[5] = {2 , 0, 0, 0, 0}; + static Atom motif_hints; + static XSizeHints wmsize; + + if (!global.Desktop) + { + global.NVisWorkSpaces = 1; + global.VisWorkSpaces[0] = global.CWorkSpace; + return; + } + + if (ProbeWindow) + { + XDestroyWindow(global.display, ProbeWindow); + } + else + { + P("Creating attrs for ProbeWindow\n"); + attr.background_pixel = WhitePixel(global.display, global.Screen); + attr.border_pixel = WhitePixel(global.display, global.Screen); + attr.event_mask = ButtonPressMask; + valuemask = CWBackPixel | CWBorderPixel | CWEventMask; + class_hints.res_name = (char *)"xsnow"; + class_hints.res_class = (char *)"Xsnow"; + motif_hints = XInternAtom(global.display, "_MOTIF_WM_HINTS", False); + wmsize.flags = USPosition | USSize; + } + + int number; + XineramaScreenInfo *info = XineramaQueryScreens(global.display,&number); + if (number == 1 || info == NULL) + { + global.NVisWorkSpaces = 1; + global.VisWorkSpaces[0] = global.CWorkSpace; + return; + } + + + // This is for bspwm and possibly other tiling window magagers. + // + // Determine which workspaces are visible: place a window (ProbeWindow) + // in each xinerama screen, and ask in which workspace the window + // is located. + + //int prevsticky = set_sticky(1); + + ProbeWindow = XCreateWindow (global.display, global.Rootwindow, + 1,1,1,1,10, + DefaultDepth(global.display, global.Screen), InputOutput, + DefaultVisual(global.display, global.Screen),valuemask,&attr); + XSetClassHint(global.display,ProbeWindow,&class_hints); + + // to prevent the user to determine the intial position (in twm for example) + XSetWMNormalHints(global.display, ProbeWindow, &wmsize); + + XChangeProperty(global.display, ProbeWindow, motif_hints, motif_hints, + 32, PropModeReplace, (unsigned char *)&hints, 5); + xdo_map_window(global.xdo,ProbeWindow); + + global.NVisWorkSpaces = number; + int i; + int prev = -SOMENUMBER; + for (i=0; i= 0) + { + global.WindowOffsetX = 0; + global.WindowOffsetY = 0; + } + prev = desktop; + } + } + xdo_unmap_window(global.xdo,ProbeWindow); +} + +int IsVisibleWindow(Window wid) // not used +{ + long desktop; + xdo_get_desktop_for_window(global.xdo,wid,&desktop); // todo replace with existsing window list + int i; + for (i=0; iw > 0.8*global.SnowWinWidth && w->ya < Flags.IgnoreTop) // too wide&too close to top || ( w->w > 0.8*global.SnowWinWidth - && global.SnowWinHeight - w->ya < Flags.IgnoreBottom) // too wide&too close to bottom + && (int)global.SnowWinHeight - w->ya < Flags.IgnoreBottom) // too wide&too close to bottom ) { GenerateFlakesFromFallen(fsnow,0,fsnow->w,-10.0); @@ -324,7 +474,6 @@ P("CleanFallenArea\n"); fsnow->x = w->x + Flags.OffsetX; fsnow->y = w->y + Flags.OffsetY; - //DrawFallen(fsnow); XFlush(global.display); } } @@ -444,20 +593,6 @@ &x, &y, &w, &h, &b, &depth); P("geom: %d %d %d %d\n",x,y,w,h); printf("Force snow on root: window: %#lx, depth: %d\n",*xwin,depth); - if(0) // Trying to couple the virtual root window to gtk/cairo. No success ... - { - GdkWindow *gdkwin; - GdkDisplay *gdkdisplay; - gdkdisplay = gdk_display_get_default(); - P("display: %p gdkdisplay: %p\n",(void*)global.display,(void*)gdkdisplay); - gdkwin = gdk_x11_window_foreign_new_for_display(gdkdisplay,*xwin); - *gtkwin = gtk_window_new(GTK_WINDOW_TOPLEVEL); - //gtk_window_set_screen(GTK_WINDOW(*gtkwin),gdk_window_get_screen(gdkwin)); - gtk_widget_set_window(*gtkwin,gdkwin); - gtk_widget_show_all(*gtkwin); - gdk_window_show(gdkwin); - *IsDesktop = 1; - } } else { @@ -479,17 +614,18 @@ *gtkwin = gtk_window_new (GTK_WINDOW_TOPLEVEL); - int rc = make_trans_window(*gtkwin, - 1, // full screen + int wantx, wanty; + int rc = make_trans_window(global.display,*gtkwin, + -1, // full screen Flags.AllWorkspaces, // sticky Flags.BelowAll, // below 1, // dock NULL, // gdk_window - xwin // x11_window + xwin, // x11_window + &wantx, + &wanty ); gtk_window_set_title(GTK_WINDOW(*gtkwin), transname); - //int rc = create_transparent_window(Flags.AllWorkspaces, Flags.BelowAll, - // xwin, transname, *gtkwin, w, h); if (!rc) { @@ -589,6 +725,7 @@ Window XWinInfo(char **name) + // not used { Window win = Select_Window(global.display,1); if(name) @@ -604,18 +741,79 @@ return win; } +// gets location and size of xinerama screen xscreen, -1: full screen +// returns the number of xinerama screens +int xinerama(Display *display, int xscreen, int *x, int *y, int *w, int *h) +{ + int number; + XineramaScreenInfo *info = XineramaQueryScreens(display,&number); + if (info == NULL) + { + I("No xinerama...\n"); + return FALSE; + } + else + { + int scr = xscreen; + if(scr > number-1) + scr = number-1; + + int i; + for (i=0; i *w) + *w = info[i].width; + if (info[i].height > *h) + *h = info[i].height; + } + } + else + { + + *x = info[scr].x_org; + *y = info[scr].y_org; + *w = info[scr].width; + *h = info[scr].height; + } + P("Xinerama window: %d+%d %dx%d\n",*x,*y,*w,*h); + + XFree(info); + } + return number; +} + void InitDisplayDimensions() { - unsigned int wroot,hroot,broot,droot; - int xroot,yroot; - Window root; - XGetGeometry(global.display,global.Rootwindow,&root, - &xroot, &yroot, &wroot, &hroot, &broot, &droot); - global.Xroot = xroot; - global.Yroot = yroot; - global.Wroot = wroot; - global.Hroot = hroot; - P("InitDisplayDimensions: %p %d %d %d %d %d %d\n",(void*)global.Rootwindow,xroot,yroot,wroot,hroot,broot,droot); + unsigned int w,h; + int x,y; + xdo_get_window_location(global.xdo, global.Rootwindow, &x, &y,NULL); + xdo_get_window_size (global.xdo, global.Rootwindow, &w, &h); + + P("InitDisplayDimensions root: %p %d %d %d %d\n",(void*)global.Rootwindow,x,y,w,h); + + global.Xroot = x; + global.Yroot = y; + global.Wroot = w; + global.Hroot = h; + DisplayDimensions(); } @@ -624,10 +822,13 @@ P("Displaydimensions\n"); Lock_fallen(); unsigned int w,h,b,d; - int x,y,xr,yr; - Window root,child_return; + int x,y; + Window root; + + xdo_wait_for_window_map_state(global.xdo,global.SnowWin,IsViewable); + + int rc = XGetGeometry(global.display,global.SnowWin,&root, &x, &y, &w, &h, &b, &d); - int rc = XGetGeometry(global.display,global.SnowWin,&root, &x, &y, &w, &h, &b, &d); if (rc == 0) { P("Oeps\n"); @@ -637,20 +838,9 @@ return; } - XTranslateCoordinates(global.display, global.SnowWin, global.Rootwindow, 0, 0, &xr, &yr, &child_return); - P("DisplayDimensions: %#lx %#lx x:%d y:%d xr:%d yr:%d w:%d h:%d b:%d d:%d tr:%d\n",global.SnowWin,global.Rootwindow,x,y,xr,yr,w,h,b,d,global.Trans); - global.SnowWinX = xr;// - x; - global.SnowWinY = yr;// - y; - if(global.Trans) - { - global.SnowWinWidth = global.Wroot - global.SnowWinX; - global.SnowWinHeight = global.Hroot - global.SnowWinY + Flags.OffsetS; - } - else - { - global.SnowWinWidth = w; - global.SnowWinHeight = h + Flags.OffsetS; - } + global.SnowWinWidth = w; + global.SnowWinHeight = h; + P("DisplayDimensions: SnowWinX: %d Y:%d W:%d H:%d\n",global.SnowWinX,global.SnowWinY,global.SnowWinWidth,global.SnowWinHeight); global.SnowWinBorderWidth = b; diff -Nru xsnow-3.5.3/src/windows.h xsnow-3.6.0/src/windows.h --- xsnow-3.5.3/src/windows.h 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/windows.h 2022-12-03 13:02:36.000000000 +0000 @@ -26,9 +26,9 @@ extern void windows_ui(void); extern void windows_draw(void); extern void windows_init(void); -extern int WorkspaceActive(void); // defined in main.c +extern int WorkspaceActive(void); extern int DetermineWindow(Window *xtrans, char **xtransname, GtkWidget **gtrans,const char *transname, int *IsDesktop); -extern void InitDisplayDimensions(void); +extern void InitDisplayDimensions(); extern void DestroyWindow(Window w); extern void setabove(GtkWindow *w); extern void DisplayDimensions(void); @@ -37,5 +37,5 @@ extern void UpdateFallenSnowRegionsWithLock(void); extern void UpdateWindows(void); extern void SetBackground(void); - - +extern int xinerama(Display *display, int xscreen, int *x, int *y, int *w, int *h); +extern int IsVisibleWindow(Window wid); diff -Nru xsnow-3.5.3/src/wmctrl.c xsnow-3.6.0/src/wmctrl.c --- xsnow-3.5.3/src/wmctrl.c 2022-09-26 11:47:43.000000000 +0000 +++ xsnow-3.6.0/src/wmctrl.c 2022-12-03 13:02:36.000000000 +0000 @@ -83,13 +83,13 @@ return; } -int GetCurrentWorkspace() +long int GetCurrentWorkspace() { Atom type; int format; unsigned long nitems,b; unsigned char *properties; - int r; + long int r; Display *getdisplay; static Atom atom_net_desktop_viewport; @@ -122,7 +122,7 @@ { // we have the x-y coordinates of the workspace, we hussle this // into one long number: - r = ((long *)properties)[0]+(((long *)properties)[1]<<16); + r = ((long *)(void*)properties)[0]+(((long *)(void*)properties)[1]<<16); } if(properties) XFree(properties); } @@ -155,7 +155,7 @@ // more or less ;-) } else - r = *(long *)properties; // see man XGetWindowProperty + r = *(long *)(void*)properties; // see man XGetWindowProperty if(properties) XFree(properties); } P("wmctrl: nitems: %ld ws: %d\n",nitems,r); @@ -271,7 +271,7 @@ AnyPropertyType, &type, &format, &nitems, &b, &properties); if(format == 32 && nitems >=1) { - if(*(long*) properties == 1) + if(*(long*) (void*)properties == 1) globalhidden = 1; P("hidden3 hidden:%d\n",globalhidden); } @@ -322,7 +322,7 @@ } if(properties) { - w->ws = *(long*) properties; + w->ws = *(long*) (void*)properties; if(properties) XFree(properties); } else @@ -339,7 +339,7 @@ for(i=0; (unsigned long)iid); @@ -367,7 +367,7 @@ for(i=0; (unsigned long)iid, counter++); @@ -403,7 +403,7 @@ for (i=0; i