Compare commits

...

11 Commits

Author SHA1 Message Date
BitHeaven 5084ce40e6 little update 2023-04-28 16:01:52 +05:00
BitHeaven 3588c404ff
Update event.c 2022-08-13 12:39:35 +05:00
Jon Burga e3c19cd7d1
Merge pull request #69 from mwglen/next
Update picom-trans
2022-03-19 09:48:55 +01:00
Matt Glen 88ae3cb38a
Update picom-trans 2022-02-13 11:33:10 -05:00
Jon Burga a8445684fe
Merge pull request #8 from koraynilay/next
Updated PKGBUILD
2020-11-28 18:03:12 +01:00
Jon Burga 53848e01e9
Merge pull request #9 from proro485/next
Fixed some default settings present in picom.sample.conf
2020-11-28 18:01:08 +01:00
Rohit Singh Bisht d08c9b8c49
Update picom.sample.conf 2020-10-01 13:27:28 +05:30
Rohit Singh Bisht 86fb826da4
Update picom.sample.conf 2020-10-01 13:23:40 +05:30
koraynilay d890a3b8b3 Updated PKGBUILD 2020-09-30 21:34:55 +02:00
jon 3ecf9e2444 removing microsecond accuracy for now 2020-09-30 21:32:30 +02:00
koraynilay 99a76be6bb Updated PKGBUILD 2020-09-30 21:31:33 +02:00
7 changed files with 375 additions and 186 deletions

View File

@ -1,9 +1,8 @@
# Maintainer: koraynilay <koray.fra@gmail.com> # Maintainer: koraynilay <koray.fra@gmail.com>
# This PKGBUILD is adapted from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=picom-tryone-git
_gitfolder="picom" _gitfolder="picom"
pkgname=picom-jonaburg-git pkgname=picom-jonaburg-git
pkgver=0.1 pkgver=0.1
pkgrel=1 pkgrel=4
pkgdesc="jonaburg's picom fork with tryone144's dual_kawase blur and ibhagwan's rounded corners, an X compositor (compton's fork)" pkgdesc="jonaburg's picom fork with tryone144's dual_kawase blur and ibhagwan's rounded corners, an X compositor (compton's fork)"
arch=(i686 x86_64) arch=(i686 x86_64)
url="https://github.com/jonaburg/picom" url="https://github.com/jonaburg/picom"
@ -25,6 +24,7 @@ build() {
} }
package() { package() {
# this is adapted from tryone144's fork PKGBUILD
cd "${srcdir}/${_gitfolder}" cd "${srcdir}/${_gitfolder}"
DESTDIR="$pkgdir/" ninja -C build install DESTDIR="$pkgdir/" ninja -C build install

View File

@ -1,4 +1,4 @@
picom picom (fixed)
======= =======
*new!* : You'll now also find tryone's dual_kawase blur for the new backend, as well as rounded corners from sdhand if they are so desired, merged from ibhagwan. *new!* : You'll now also find tryone's dual_kawase blur for the new backend, as well as rounded corners from sdhand if they are so desired, merged from ibhagwan.

View File

@ -1,9 +1,15 @@
#!/bin/sh #!/bin/sh
# SPDX-License-Identifier: MIT
# #
# picom-trans # picom-trans
# transset in a bash script # Copyright (c) 2021, Subhaditya Nath
# Copyright (c) 2011-2012, Christopher Jeffrey # Based on previous works of Christopher Jeffrey
#
#
# Conforming to POSIX-1.2007
# https://pubs.opengroup.org/onlinepubs/9699919799
# #
# Usage: # Usage:
@ -21,192 +27,381 @@
# $ picom-trans -c +5 # $ picom-trans -c +5
# Delete current window's opacity # Delete current window's opacity
# $ picom-trans -c --delete # $ picom-trans -c --delete
# Toggle current window's opacity between 90 and unset
# $ picom-trans -c --toggle 90
# Reset all windows # Reset all windows
# $ picom-trans --reset # $ picom-trans --reset
case "$0" in
*compton-trans*) echo "Warning: compton has been renamed, please use picom-trans instead" >& 2;; # Save $0 now to print correct value while printing from functions.
# Printing errormsgs from functions using "$0" prints the function name
# instead of the executable name.
EXE_NAME="$0"
# Instead of printing the full path to this file (e.g. /usr/bin/picom-trans)
# only print the base name (i.e. picom-trans)
EXE_NAME="$(basename "$EXE_NAME")"
print_usage()
{ #{{
echo "Usage: $EXE_NAME [options] [+|-]opacity"
echo ""
echo "Options:"
echo " -h, --help Print this help message."
echo " -o, --opacity OPACITY Specify the new opacity value in range 0-100 for the window. If"
echo " prefixed with + or -, increment or decrement from the current"
echo " opacity of the target window."
echo ""
echo "Actions:"
echo " -g, --get Print current opacity of the target window."
echo " -d, --delete Delete opacity of the target window."
echo " -t, --toggle Toggle the target window's opacity, i.e. set if not already set"
echo " and delete else."
echo " -r, --reset Reset opacity for all windows."
echo ""
echo "Window Selection:"
echo " -s, --select Select target window with mouse cursor. (DEFAULT)"
echo " -c, --current Select the currently active window as target."
echo " -n, --name WINDOW_NAME Specify and try to match a window name."
echo " -w, --window WINDOW_ID Specify the window id of the target window."
} #}}
parse_args()
{ #{{
i=1 # because we start from "$1", not from "$0"
while [ $i -le $# ]
do
#### [START] Convert GNU longopts to POSIX equivalents ####
if [ "$1" = "--${1##--}" ] # check if $1 is a longopt
then
# Catch invalid options
case "$1" in
(--opacity=|--name=|--window=)
echo "$EXE_NAME: option ${1%=} needs a value" >&2
exit 1;;
(--opacity|--name|--window)
test $i -eq $# \
&& echo "$EXE_NAME: option $1 needs a value" >&2 \
&& exit 1;;
esac esac
# "command" is a shell built-in, faster than "which" # Separate "--ARG=VAL" into "--ARG" "VAL"
if test -z "$(command -v xprop)" -o -z "$(command -v xwininfo)"; then case "$1" in
echo 'The command xwininfo or xprop is not available. They might reside in a package named xwininfo, xprop, x11-utils, xorg-xprop, or xorg-xwininfo.' >& 2 (--opacity=*|--name=*|--window=*)
ARG="$(echo "$1" | sed -E 's/(--[^=]+)=.*$/\1/')"
VAL="${1##${ARG}=}"
shift && set -- "$ARG" "$VAL" "$@"
esac
# Turn into short form
case "$1" in
(--help|--opacity|--get|--delete|--toggle|--reset|--select|--current|--name|--window)
ARG=${1#-} # remove one '-' from prefix
ARG="$(echo "$ARG" | cut -c -2)" # get first two characters
shift && set -- "$ARG" "$@"
esac
# If the argument still starts with --, it is an invalid argument
case "$1" in
(--*)
echo "$EXE_NAME: illegal option $1" >&2
exit 1 exit 1
esac
fi fi
#### [END] Convert GNU longopts to POSIX equivalents ####
# Variables
active=
wprefix=
window=
opacity=
cur=
action=
treeout=
wid=
topmost=
lineno=
option=
v=
# Workaround: replace '-5' with '~5' so as not to confuse getopts. #### [START] Prepend '-o' to standalone opacity values ####
for v in "$@"; do # Iterate over every argument and check if it is an opacity without the -o
shift && set -- "$@" "$(echo "$v" | sed 's/^-\([0-9]\+%\?\)$/~\1/')" # option in the previous argument. If so, then prepend the -o option.
# e.g. Turn this -
# picom-trans -c +10 -s
# into this -
# picom-trans -c -o +10 -s
#
# NOTE: Don't touch arguments that are preceded by -o, -w, or -n (i.e. the
# options that take a value.)
# e.g. This -
# picom-trans -w 75 -o 90
# should NOT be turned into this -
# picom-trans -w -o 75 -o 90
# We ensure this by checking the "$#"th (i.e. the last) argument. If
# argument is an option that needs a value, we don't do anything to $1.
#
# NOTE: we are using printf because most echo implementations aren't
# POSIX-compliant. For example, according to POSIX.1-2017, echo doesn't
# support any options, so,
# $ echo "-n"
# should output -
# -n
# But it doesn't. It instead interprets the "-n" as the option -n, which,
# in most implementations, means that the trailing newline should not be
# printed.
if echo "$1" | grep -qE '^[+-]?[[:digit:]]+%?$' && \
! eval "printf '%s' \"\${$#}\"" | grep -q '^-[hdtrgsc]*[own]$'
# NOTE: eval "printf '%s' \"\${$#}\"" means 'print the last argument'
# NOTE: The letters inside the first square brackets (ie. hdtrgsc) are
# the same as those in the getopts argument, minus those that are
# followed by a ':'
# NOTE: The letters inside the second square brackets (ie. own) are
# the same as those in the getopts argument, minus those that are
# NOT followed by a ':'
then
set -- "$@" "-o"
i=$(( i + 1 ))
fi
#### [END] Prepend '-o' to standalone opacity values ####
# Prepare for next iteration
ARG="$1"
shift && set -- "$@" "$ARG"
i=$(( i + 1 ))
done done
# This takes into account the fact that getopts stops on
# any argument it doesn't recognize or errors on. This # NOTE: DO NOT ATTEMPT TO USE "$OPTIND" INSIDE THE getopts LOOP
# allows for things like `picom-trans -5` as well # - https://github.com/yshui/picom/pull/634#discussion_r654571535
# as `picom-trans -c +5 -s` (contrived example). # - https://www.mail-archive.com/austin-group-l%40opengroup.org/msg04112.html
while test $# -gt 0; do
# Reset option index
OPTIND=1 OPTIND=1
while getopts 'ho:dtrgsn:w:c' OPTION
# Read options do
while getopts 'scrdgn:w:o:-:' option "$@"; do case "$OPTION" in
if test "$option" = '-'; then (h) print_usage; exit 0;;
case "$OPTARG" in (o) target_opacity="$OPTARG";;
select | current | reset | delete | get) (d) action=delete;;
v='' (t) action=toggle;;
;; (r) action=reset;;
name | window | opacity) (g) action=get;;
eval v=\$$OPTIND (s) winidtype=; winid=;;
OPTIND=$((OPTIND + 1)) (n) winidtype=-name; winid="$OPTARG";;
;; (w) winidtype=-id; winid="$OPTARG";;
name=* | window=* | opacity=*) (c) winidtype=-id; winid="$(get_focused_window_id)";;
v=$(echo "$OPTARG" | sed 's/^[^=]\+=//') (\?) exit 1
;;
*)
echo "$0: illegal option $OPTARG" >& 2
exit 1
;;
esac
option=$(echo "$OPTARG" | cut -c 1)
OPTARG=$v
fi
case "$option" in
s) wprefix=''; window='' ;;
c)
active=$(xprop -root -notype _NET_ACTIVE_WINDOW \
| grep -Eo '0x[[:xdigit:]]+' | head -n 1)
wprefix='-id'; window=$active
;;
r) action='reset' ;;
d) action='delete' ;;
g) action='get' ;;
n) wprefix='-name'; window=$OPTARG ;;
w) wprefix='-id'; window=$OPTARG ;;
o) opacity=$OPTARG ;;
\?) exit 1 ;;
esac esac
done done
} #}}
# Read positional arguments
shift $((OPTIND - 1))
test -n "$1" && opacity=$1 && shift
done
# clean up opacity. xargs == a poor man's trim. get_target_window_id()
opacity=$(echo "$opacity" | xargs | sed 's/%//g' | sed 's/^~\([0-9]\+\)$/-\1/') { #{{
# Validate opacity value # Get the output of xwininfo
if test -z "$action" && ! echo "$opacity" | grep -q '^[+-]\?[0-9]\+$'; then if test -z "$winidtype"
echo "Invalid opacity specified: $opacity." then xwininfo_output="$(xwininfo -children -frame)"
elif test "$winidtype" = "-name"
then xwininfo_output="$(xwininfo -children -name "$winid")"
elif test "$winidtype" = "-id"
then
# First, check if supplied window id is valid
if ! echo "$winid" | grep -Eiq '^[[:space:]]*(0x[[:xdigit:]]+|[[:digit:]]+)[[:space:]]*$'
then
echo "Bad window ID" >&2
exit 1 exit 1
fi fi
xwininfo_output="$(xwininfo -children -id "$winid")"
# Reset opacity for all windows
if test x"$action" = x'reset'; then
xwininfo -root -tree \
| sed -n 's/^ \(0x[[:xdigit:]]*\).*/\1/p' \
| while IFS=$(printf '\n') read wid; do
xprop -id "$wid" -remove _NET_WM_WINDOW_OPACITY
done
exit 0
fi fi
# Get ID of the target window # Extract window id from xwininfo output
if test -z "$wprefix"; then winid="$(echo "$xwininfo_output" | sed -n 's/^xwininfo:.*: \(0x[[:xdigit:]]*\).*$/\1/p')"
treeout=$(xwininfo -children -frame) if test -z "$winid"
else then
test "$wprefix" = '-id' \ echo "Failed to find window" >&2
&& ! echo "$window" | grep -Eiq '^[[:space:]]*(0x[[:xdigit:]]+|[[:digit:]]+)[[:space:]]*$' \
&& echo 'Bad window ID.' && exit 1
treeout=$(xwininfo -children $wprefix "$window")
fi
wid=$(echo "$treeout" | sed -n 's/^xwininfo:.*: \(0x[[:xdigit:]]*\).*$/\1/p')
if test -z "$wid"; then
echo 'Failed to find window.'
exit 1 exit 1
fi fi
# Make sure it's not root window # Make sure it's not root window
if echo "$treeout" | fgrep -q 'Parent window id: 0x0'; then if echo "$xwininfo_output" | grep -Fq "Parent window id: 0x0"
echo 'Cannot set opacity on root window.' then
echo "Cannot set opacity on root window" >&2
exit 1 exit 1
fi fi
# If it's already the topmost window # If it's not the topmost window, get the topmost window
if echo "$treeout" | grep -q 'Parent window id: 0x[[:xdigit:]]* (the root window)'; then if ! echo "$xwininfo_output" | grep -q 'Parent window id: 0x[[:xdigit:]]* (the root window)'
topmost=$wid then
else window_tree="$(xwininfo -root -tree)"
# Get the whole window tree if test -z "$window_tree"
treeout=$(xwininfo -root -tree) then
echo "Failed to get root window tree" >&2
if test -z "$treeout"; then
echo 'Failed to get root window tree.'
exit 1 exit 1
fi fi
# Find the line number of the target window in the window tree # Find the highest ancestor of the target window
lineno=$(echo -n "$treeout" | grep -nw "$wid" | head -n1 | cut -d ':' -f 1) winid="$(echo "$window_tree" \
| sed -n "/^\s*$winid/q;s/^ \(0x[[:xdigit:]]*\).*/\1/p" \
if test -z "$lineno"; then | tail -n 1)"
echo 'Failed to find window in window tree.' if test -z "$winid"
then
echo "Failed to find window in window tree" >&2
exit 1
fi
fi
if test -z "$winid"
then
echo "Failed to find the highest parent window below root of the selected window" >&2
exit 1 exit 1
fi fi
# Find the highest ancestor of the target window below echo "$winid"
topmost=$(echo -n "$treeout" \ } #}}
| head -n $((lineno + 1)) \
| sed -n 's/^ \(0x[[:xdigit:]]*\).*/\1/p' \
| tail -n 1)
fi
if test -z "$topmost"; then get_focused_window_id()
echo 'Failed to find the highest parent window below root of the' \ { #{{
'selected window.' id="$(xprop -root -notype -f _NET_ACTIVE_WINDOW 32x '$0' _NET_ACTIVE_WINDOW)"
exit 1 echo "${id#_NET_ACTIVE_WINDOW}"
fi } #}}
# Remove the opacity property. get_current_opacity()
if test x"$action" = x'delete'; then { #{{
xprop -id "$topmost" -remove _NET_WM_WINDOW_OPACITY # Gets current opacity in the range 0-100
exit 0 # Doesn't output anything if opacity isn't set
fi cur="$(xprop -id "$winid" -notype -f _NET_WM_WINDOW_OPACITY 32c '$0' _NET_WM_WINDOW_OPACITY)"
cur="${cur#_NET_WM_WINDOW_OPACITY}"
# Get current opacity. cur="${cur%:*}"
cur=$(xprop -id "$topmost" -notype _NET_WM_WINDOW_OPACITY \ test -n "$cur" &&
| sed 's/^.*\b\([0-9]\+\).*$\|^.*$/\1/')
test -z "$cur" && cur=0xffffffff
cur=$(( cur * 100 / 0xffffffff )) cur=$(( cur * 100 / 0xffffffff ))
echo "$cur"
} #}}
# Output current opacity.
if test x"$action" = x'get'; then get_opacity()
{ #{{
cur="$(get_current_opacity)"
test -z "$cur" && cur=100 # Unset opacity means fully opaque
echo "$cur" echo "$cur"
exit 0 exit 0
} #}}
delete_opacity()
{ #{{
xprop -id "$winid" -remove _NET_WM_WINDOW_OPACITY
exit 0
} #}}
reset_opacity() # Reset opacity of all windows
{ #{{
for winid in $(xwininfo -root -tree | sed -n 's/^ \(0x[[:xdigit:]]*\).*/\1/p')
do xprop -id "$winid" -remove _NET_WM_WINDOW_OPACITY 2>/dev/null
done
exit 0
} #}}
set_opacity()
{ #{{
if ! echo "$target_opacity" | grep -qE '^[+-]?[[:digit:]]+%?$'
then
if test -z "$target_opacity"
then echo "No opacity specified" >&2
else echo "Invalid opacity specified: $target_opacity" >&2
fi
exit 1
fi fi
# Calculate the desired opacity # strip trailing '%' sign, if any
if echo "$opacity" | grep -q '^[+-]'; then target_opacity="${target_opacity%%%}"
opacity=$((cur + opacity))
if echo "$target_opacity" | grep -q '^[+-]'
then
current_opacity="$(get_current_opacity)"
test -z "$current_opacity" && current_opacity=100
target_opacity=$(( current_opacity + target_opacity ))
fi fi
test $opacity -lt 0 && opacity=0 test $target_opacity -lt 0 && target_opacity=0
test $opacity -gt 100 && opacity=100 test $target_opacity -gt 100 && target_opacity=100
# Set opacity target_opacity=$(( target_opacity * 0xffffffff / 100 ))
opacity=$((opacity * 0xffffffff / 100)) xprop -id "$winid" -f _NET_WM_WINDOW_OPACITY 32c \
xprop -id "$topmost" -f _NET_WM_WINDOW_OPACITY 32c \ -set _NET_WM_WINDOW_OPACITY "$target_opacity"
-set _NET_WM_WINDOW_OPACITY "$opacity"
exit $?
} #}}
toggle_opacity()
{ #{{
# If opacity is currently set, unset it.
# If opacity is currently unset, set opacity to the supplied value. If no
# value is supplied, we default to 100%.
if test -z "$(get_current_opacity)"
then
test -n "$target_opacity" || target_opacity=100
set_opacity
else
delete_opacity
fi
} #}}
# Warn about rename of compton to picom
case "$0" in
*compton-trans*) echo "Warning: compton has been renamed, please use picom-trans instead" >&2;;
esac
# Check if both xwininfo and xprop are available
if ! command -v xprop >/dev/null || ! command -v xwininfo >/dev/null
then
echo "The command xwininfo or xprop is not available. They might reside in a package named xwininfo, xprop, x11-utils, xorg-xprop, or xorg-xwininfo" >&2
exit 1
fi
# No arguments given. Show help.
if test $# -eq 0
then
print_usage >&2
exit 1
fi
# Variables
# action is set to 'set' by default
action=set
winid=
winidtype=
target_opacity=
# If there's only one argument, and it's a valid opacity
# then take it as target_opacity. Else, parse all arguments.
if test $# -eq 1 && echo "$1" | grep -qE '^[+-]?[[:digit:]]+%?$'
then
target_opacity=$1
shift
else
parse_args "$@"
fi
# reset_opacity doesn't need $winid
case $action in
(reset) reset_opacity;;
esac
# Any other action needs $winid
#
# NOTE: Do NOT change the order of winid= and winidtype= below
# the output of get_target_window_id depends on $winidtype
#
# NOTE: If get_target_window_id returns with a non-zero $?
# that must mean that some error occured. So, exit with that same $?
#
winid=$(get_target_window_id) || exit $?
winidtype=-id
case $action in
(set) set_opacity;;
(get) get_opacity;;
(delete) delete_opacity;;
(toggle) toggle_opacity;;
esac
# We should never reach this part of the file
echo "This sentence shouldn't have been printed. Please file a bug report." >&2
exit 128
# vim:ft=sh:ts=4:sts=4:sw=2:et:fdm=marker:fmr=#{{,#}}:nowrap

View File

@ -15,7 +15,7 @@ size-transition = true
# Corners # # Corners #
################################# #################################
# requires: https://github.com/sdhand/compton or https://github.com/jonaburg/picom # requires: https://github.com/sdhand/compton or https://github.com/jonaburg/picom
corner-radius = 25.0; corner-radius = 10.0;
rounded-corners-exclude = [ rounded-corners-exclude = [
#"window_type = 'normal'", #"window_type = 'normal'",
"class_g = 'awesome'", "class_g = 'awesome'",
@ -167,6 +167,12 @@ frame-opacity = 0.7;
# Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0) # Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0)
# menu-opacity = 1.0 # menu-opacity = 1.0
# menu-opacity is depreciated use dropdown-menu and popup-menu instead.
#If using these 2 below change their values in line 510 & 511 aswell
popup_menu = { opacity = 0.8; }
dropdown_menu = { opacity = 0.8; }
# Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows. # Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows.
# inactive-opacity-override = true # inactive-opacity-override = true
@ -404,7 +410,9 @@ detect-client-leader = true
# The opposing option is use-damage # The opposing option is use-damage
# #
# no-use-damage = false # no-use-damage = false
use-damage = true #use-damage = true (Causing Weird Black semi opaque rectangles when terminal is opened)
#Changing use-damage to false fixes the problem
use-damage = false
# Use X Sync fence to sync clients' draw calls, to make sure all draw # Use X Sync fence to sync clients' draw calls, to make sure all draw
# calls are finished before picom starts drawing. Needed on nvidia-drivers # calls are finished before picom starts drawing. Needed on nvidia-drivers

View File

@ -538,8 +538,3 @@ static inline void wintype_arr_enable(bool arr[]) {
* Get current system clock in milliseconds. * Get current system clock in milliseconds.
*/ */
int64_t get_time_ms(void); int64_t get_time_ms(void);
/**
* Get current system clock in microseconds * 40.
*/
int64_t get_time_40us(void);

View File

@ -257,7 +257,7 @@ static void configure_win(session_t *ps, xcb_configure_notify_event_t *ce) {
float fakeT = float fakeT =
(t - oldMoveDx * (float)ps->o.transition_length); (t - oldMoveDx * (float)ps->o.transition_length);
/* printf("X: %f,%f\n", fakeT, t); */ /* printf("X: %f,%f\n", fakeT, t); */
mw->moveTimeX = isnanf(fakeT) ? t : fakeT; mw->moveTimeX = fakeT != fakeT ? t : fakeT;
} else { } else {
mw->moveTimeX = t; mw->moveTimeX = t;
} }
@ -268,7 +268,7 @@ static void configure_win(session_t *ps, xcb_configure_notify_event_t *ce) {
float fakeT = float fakeT =
(t - oldMoveDy * (float)ps->o.transition_length); (t - oldMoveDy * (float)ps->o.transition_length);
/* printf("Y: %f,%f\n", fakeT, t); */ /* printf("Y: %f,%f\n", fakeT, t); */
mw->moveTimeY = isnanf(fakeT) ? t : fakeT; mw->moveTimeY = fakeT != fakeT ? t : fakeT;
} else { } else {
mw->moveTimeY = t; mw->moveTimeY = t;
} }
@ -279,7 +279,7 @@ static void configure_win(session_t *ps, xcb_configure_notify_event_t *ce) {
float fakeT = float fakeT =
(t - oldMoveDw * (float)ps->o.transition_length); (t - oldMoveDw * (float)ps->o.transition_length);
/* printf("Y: %f,%f\n", fakeT, t); */ /* printf("Y: %f,%f\n", fakeT, t); */
mw->moveTimeW = isnanf(fakeT) ? t : fakeT; mw->moveTimeW = fakeT != fakeT ? t : fakeT;
} else { } else {
mw->moveTimeW = t; mw->moveTimeW = t;
} }
@ -290,7 +290,7 @@ static void configure_win(session_t *ps, xcb_configure_notify_event_t *ce) {
float fakeT = float fakeT =
(t - oldMoveDh * (float)ps->o.transition_length); (t - oldMoveDh * (float)ps->o.transition_length);
/* printf("Y: %f,%f\n", fakeT, t); */ /* printf("Y: %f,%f\n", fakeT, t); */
mw->moveTimeH = isnanf(fakeT) ? t : fakeT; mw->moveTimeH = fakeT != fakeT ? t : fakeT;
} else { } else {
mw->moveTimeH = t; mw->moveTimeH = t;
} }

View File

@ -127,16 +127,7 @@ int64_t get_time_ms(void) {
struct timespec tp; struct timespec tp;
clock_gettime(CLOCK_MONOTONIC, &tp); clock_gettime(CLOCK_MONOTONIC, &tp);
return (int64_t)tp.tv_sec * 1000 + (int64_t)tp.tv_nsec / 1000000; return (int64_t)tp.tv_sec * 1000 + (int64_t)tp.tv_nsec / 1000000;
} // return (int64_t)tp.tv_sec * 100 + (int64_t)tp.tv_nsec / 250000;
/**
* Get current system clock in microseconds * 40.
*/
int64_t get_time_40us(void) {
struct timespec tp;
clock_gettime(CLOCK_MONOTONIC, &tp);
// return (int64_t)tp.tv_sec * 1000 + (int64_t)tp.tv_nsec / 1000000;
return (int64_t)tp.tv_sec * 100 + (int64_t)tp.tv_nsec / 250000;
} }
// XXX Move to x.c // XXX Move to x.c
@ -434,7 +425,7 @@ static struct managed_win *paint_preprocess(session_t *ps, bool *fade_running) {
// Fading step calculation // Fading step calculation
long steps = 0L; long steps = 0L;
auto now = get_time_40us(); auto now = get_time_ms();
if (ps->fade_time) { if (ps->fade_time) {
assert(now >= ps->fade_time); assert(now >= ps->fade_time);
steps = (now - ps->fade_time) / ps->o.fade_delta; steps = (now - ps->fade_time) / ps->o.fade_delta;