[GNC] Calendar does not pop up

Pierre Fortin pf at pfortin.com
Mon Nov 15 11:20:45 EST 2021


On Sun, 14 Nov 2021 17:06:19 -0800 john wrote:

>> On Nov 14, 2021, at 3:51 PM, Pierre Fortin <pf at pfortin.com> wrote:
>> 
>> On Sat, 13 Nov 2021 10:11:11 -0800 john wrote:
>>   
>>> The calendar itself is a GtkCalendar, https://developer-old.gnome.org/gtk3/3.24/GtkCalendar.html, wrapped in gnucash/register/register-gnome/gnucash-date-picker.*  which adds the popup behavior and gnucash/register/register-gnome/datecell-gnome.c. You probably should start by setting a breakpoint in popup_get_height (https://github.com/Gnucash/gnucash/blob/58d37b75b09e71805bc0bc932866b00e5051bd94/gnucash/register/register-gnome/datecell-gnome.c#L650) to see if it's getting a sane value.  
>> 
>> Thanks for the hints John.  gdb wasn't helpful, so I decided to track
>> down GtkCalendar.  It no longer seems available in my distro. Finally
>> located https://github.com/debmint/gtkcalendarentry -- but its
>> configure.ac fails.  
>> 
>> I'm suspecting GtkCalendar is being deprecated.  It's not worth any more
>> effort on my part... Building gnucash 4.8 was a cakewalk compared to this.  
>
>GtkCalendar isn't a separate package, it's part of libgtk. I already gave you a link to the documentation, here's where the sources live for Gtk3, the version of the library that GnuCash uses: https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtkcalendar.c <https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtkcalendar.c>, and here it is in the current Gtk4 master: https://gitlab.gnome.org/GNOME/gtk/-/blob/master/gtk/gtkcalendar.c <https://gitlab.gnome.org/GNOME/gtk/-/blob/master/gtk/gtkcalendar.c>. Not deprecated. It's on your system, GnuCash wouldn't even compile if it wasn't.

Sorry...  last time I wrote any C[1] was over 45 years ago.  I'm really
trying to figure this out...
  [1] Compared to today, C was extremely primitive back then.

Does gnucash use dbus to talk to GtkCalendar?

I normally see lots of konsole "noise" (firefox nightly in particular); so
wasn't paying attention to those messages... Just noticed this one each
time I start gnucash (4.4 & 4.8): 
  (gnucash:3896915): dbind-WARNING **: 08:21:57.808: Couldn't register
  with accessibility bus: Did not receive a reply. Possible causes
  include: the remote application did not send a reply, the message bus
  security policy blocked the reply, the reply timeout expired, or the
  network connection was broken.
Now that I'm watching, also seeing this message when starting emacs and
claws-mail...

strace of dbus connect:
  socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 9
  connect(9, {sa_family=AF_UNIX, sun_path=@"/tmp/dbus-W8ET4CQGL8"}, 23) = 0
  fcntl(9, F_GETFL)                       = 0x2 (flags O_RDWR)
  fcntl(9, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
  geteuid()                               = 1000
  getsockname(9, {sa_family=AF_UNIX}, [128->2]) = 0
  poll([{fd=9, events=POLLOUT}], 1, 0)    = 1 ([{fd=9, revents=POLLOUT}])
  sendto(9, "\0", 1, MSG_NOSIGNAL, NULL, 0) = 1
  sendto(9, "AUTH EXTERNAL 31303030\r\n", 24, MSG_NOSIGNAL, NULL, 0) = 24
  poll([{fd=9, events=POLLIN}], 1, -1)    = 1 ([{fd=9, revents=POLLIN}])
  read(9, "OK acf17cb0e67cd5a7569eda50618e6"..., 2048) = 37
  poll([{fd=9, events=POLLOUT}], 1, -1)   = 1 ([{fd=9, revents=POLLOUT}])
  sendto(9, "NEGOTIATE_UNIX_FD\r\n", 19, MSG_NOSIGNAL, NULL, 0) = 19
  poll([{fd=9, events=POLLIN}], 1, -1)    = 1 ([{fd=9, revents=POLLIN}])
  read(9, "AGREE_UNIX_FD\r\n", 2048)      = 15
  poll([{fd=9, events=POLLOUT}], 1, -1)   = 1 ([{fd=9, revents=POLLOUT}])
  sendto(9, "BEGIN\r\n", 7, MSG_NOSIGNAL, NULL, 0) = 7
  poll([{fd=9, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=9, revents=POLLIN|POLLOUT|POLLHUP}])
  recvmsg(9, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="", iov_len=2048}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 0
  close(9)                                = 0
  getpeername(2, 0x7ffe1a850840, [128])   = -1 ENOTSOCK (Socket operation on non-socket)
  futex(0x7f040247c658, FUTEX_WAKE_PRIVATE, 2147483647) = 0
  ioctl(2, TCGETS, 0x7ffe1a850820)        = -1 ENOTTY (Inappropriate ioctl for device)
  getpid()                                = 3909181
  stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1744, ...}) = 0
  write(2, "\n(gnucash:3909181): dbind-WARNIN"..., 305


Building gnucash:

$ ll /usr/include/gtk*/gtk/gtkcalendar.h 
-rw-r--r-- 1 root root 7599 Dec 18  2020 /usr/include/gtk-2.0/gtk/gtkcalendar.h 
-rw-r--r-- 1 root root 6812 Dec  2  2020 /usr/include/gtk-3.0/gtk/gtkcalendar.h 
-rw-r--r-- 1 root root 3371 Jan 30  2021 /usr/include/gtk-4.0/gtk/gtkcalendar.h

$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local > /tmp/gnucash.log

$ make  >> /tmp/gnucash.log #### yet, this output got sent to stderr:
/usr/bin/ld: CMakeFiles/gnc-backend-xml-utils.dir/gnc-xml-backend.cpp.o:
in function `GncXmlBackend::write_to_file(bool)':
gnc-xml-backend.cpp:(.text+0x1150): warning: the use of `mktemp' is
dangerous, better use `mkstemp' or `mkdtemp' date-utilities.scm:527:22:
warning: non-literal format string options.scm:162:17: warning:
non-literal format string standard/advanced-portfolio.scm:1093:24:
warning: non-literal format string standard/category-barchart.scm:505:25:
warning: non-literal format string standard/equity-statement.scm:301:9:
warning: non-literal format string standard/ifrs-cost-basis.scm:200:5:
warning: possibly unbound variable `amount->monetary'
standard/income-statement.scm:406:9: warning: non-literal format string
standard/trial-balance.scm:406:13: warning: non-literal format string

Scanning the build log file...

$ grep -i calendar /tmp/gnucash.log

$ grep -i gtk /tmp/gnucash.log
-- Checking for module 'webkit2gtk-4.0>=2.14.0'
--   Found webkit2gtk-4.0, version 2.34.1
-- Checking for module 'gtk+-3.0>=3.22.30'
--   Found gtk+-3.0, version 3.24.24
-- Checking for module 'gwengui-gtk3'
--   Found gwengui-gtk3, version 5.3.0
[ 40%] Building C object gnucash/gnome-utils/CMakeFiles/gnc-gnome-utils.dir/gnc-gtk-utils.c.o


>But your problem is more likely to be with the popup that wraps GtkCalendar than with GtkCalendar itself.

The puzzling part is that the calendar just disappeared one day a few
months ago while still on 4.4; so likely something external in libgtk
and/or dbus updates..?

Thanks,
Pierre

>Regards,
>John Ralls
>


More information about the gnucash-user mailing list