0

When I run the gtk3 python code using pygobject in Ubuntu 18.04, the code runs without any warnings. But when I build it on Ubuntu 16.04 for snap, I am getting these warnings:

Gdk-WARNING **: gdk-frame-clock: layout continuously requested, giving up after 4 tries

There is no part of the code that tries to refresh the screen even twice within a second(unless there is some check_resize events). I am unable to understand what is causing this error. I don't have a Ubuntu 16.04 with me. so I can't debug either.

Steps to reproduce

Install the edge release from the snap.

sudo snap install --edge halo-weather

and run it.

halo-weather

It's an opensource project of a simple weather application named Halo. Here is the entry point python script.

Can somebody give me some directions?

Cijo
  • 2,726
  • 1
  • 14
  • 24

1 Answers1

1

The error generally means you are directly trying to modify the UI out of sync with GTK thread.

So we need to make sure that all UI updating functions are not directly called and instead queued to be called by Gtk using any of the following:

GLib.idle_add(callback, ...)
GLib.timeout_add(interval, callback, ...)  # X milliseconds delay
GLib.timeout_add_seconds(interval, callback, ...)  # X seconds delay

Hope that will help someone.

Cijo
  • 2,726
  • 1
  • 14
  • 24