! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
sometimes xfconf-query toggle/toggling boolean values doesn't work
Status:
RESOLVED: FIXED
Product:
Xfconf
Component:
Xfconf-query

Comments

Description QDeKIFHFSzq4Uyvj7U 2019-09-15 13:21:19 CEST
Running this repeatedly:

$ xfconf-query -c xfwm4 -p /general/use_compositing; xfconf-query -c xfwm4 -p /general/use_compositing -T; xfconf-query -c xfwm4 -p /general/use_compositing

you can see that sometimes you can get the same value(ie. unchanged) three times in a row!

ie.
false
false

^ three times in a row.

Also happens for 'true'.

Usually you get either:
true
false

or:
false
true

that should always happen, but it doesn't.

I took a look at the code but can't find anything obviously wrong or different between the normal and failing case.
Comment 1 QDeKIFHFSzq4Uyvj7U 2019-09-15 14:52:04 CEST
Note that manually toggling always works, eg.

#!/bin/bash

set -e
while true; do
#xfconf-query -c xfwm4 -p /general/use_compositing; xfconf-query -c xfwm4 -p /general/use_compositing -T; xfconf-query -c xfwm4 -p /general/use_compositing
before=$(xfconf-query -c xfwm4 -p /general/use_compositing)
#xfconf-query -c xfwm4 -p /general/use_compositing -T
if test "$before" == "true"; then
  wanted="false"
elif test "$before" == "false"; then
  wanted="true"
else
  echo "Fail '$before'"
  exit 1
fi
xfconf-query -c xfwm4 -p /general/use_compositing -s "$wanted"
after=$(xfconf-query -c xfwm4 -p /general/use_compositing)
if test "$before" == "$after"; then
  echo "Failed to set to '$wanted', it's still '$after'"
  exit 1
fi
sleep 0.2
done


this never fails.
Comment 2 QDeKIFHFSzq4Uyvj7U 2019-09-15 14:56:52 CEST
According to:
$ xfconf-query --monitor -c xfwm4

it shows that no 'set' is happening when:
$ xfconf-query -c xfwm4 -p /general/use_compositing; xfconf-query -c xfwm4 -p /general/use_compositing -T; xfconf-query -c xfwm4 -p /general/use_compositing

shows:
true
true

or:
false
false
Comment 3 QDeKIFHFSzq4Uyvj7U 2019-09-15 16:06:48 CEST
ah found it, looks like it was just missing an `xfconf_shutdown ();` on success....
curious that I didn't see that until now! heh
Comment 4 QDeKIFHFSzq4Uyvj7U 2019-09-15 16:09:42 CEST
Created attachment 9026 
fix
Comment 5 QDeKIFHFSzq4Uyvj7U 2019-09-18 09:27:29 CEST
added to CC the author from git blame (2011) commit(s) :D
Comment 6 QDeKIFHFSzq4Uyvj7U 2019-09-18 09:38:24 CEST
also adding to CC the author from 2017 (git blame) commit :)
Comment 7 Theo Linkspfeifer editbugs 2020-03-21 14:24:43 CET
The shutdown call may be missing here too:
https://git.xfce.org/xfce/xfconf/tree/xfconf-query/main.c#n414
Comment 8 Skunnyk editbugs 2020-04-24 12:21:18 CEST
I can reproduce the issue too
Comment 9 Git Bot editbugs 2020-04-24 12:32:46 CEST
Romain Bouvier referenced this bugreport in commit 3a419d5c16afcaadcb618df6f3cf4ad1cc3e0064

Bug #15960: Add some missing xfconf_shutdown() in xfconf-query

https://git.xfce.org/xfce/xfconf/commit?id=3a419d5c16afcaadcb618df6f3cf4ad1cc3e0064
Comment 10 Skunnyk editbugs 2020-04-24 12:34:26 CEST
Fixed in master, thank you ! Please confirm before closing the issue
Comment 11 inactive 2020-05-05 13:18:54 CEST
Confirmed working, thanks!
Comment 12 Git Bot editbugs 2020-05-06 14:56:30 CEST
Romain Bouvier referenced this bugreport in commit 10eaaf8cfd94241bbb50c724a7c8d5a9900f146a

Bug #15960: Add some missing xfconf_shutdown() in xfconf-query

https://gitlab.xfce.org/xfce/xfconf/commit/10eaaf8cfd94241bbb50c724a7c8d5a9900f146a

Bug #15960

Reported by:
QDeKIFHFSzq4Uyvj7U
Reported on: 2019-09-15
Last modified on: 2020-05-09

People

Assignee:
Skunnyk
CC List:
5 users

Version

Version:
4.14.1

Attachments

fix (605 bytes, patch)
2019-09-15 16:09 CEST , QDeKIFHFSzq4Uyvj7U
no flags

Additional information