python - Gdk.pixbuff_get_from_window return same result after first invocation -
i'm testing following code in linux (ubuntu 15.04), using python3.4 , pygobject 3.14:
from gi.repository import gdk, glib, gtk def print_screen(): win = gdk.get_default_root_window() size = (win.get_width(), win.get_height()) pixbuff = gdk.pixbuf_get_from_window(win, 0, 0, *size) name = 'screen-' + str(glib.get_current_time()) + '.png' pixbuff.savev(name, 'png', [], []) return true def start(): glib.timeout_add_seconds(1, print_screen) return false glib.timeout_add_seconds(5, start) gtk.main()
so waits 5 seconds, takes screenshots once second.
the issue is, screenshots turn out same image. initial delay of 5 seconds added intentionally , shows screen not same when program started, first call received correct buffer. later calls fetch actual screenshots well. how can that?
the bug not reproduce in windows 10 and, according ace, neither in ubuntu 14.04.2. hear using ubuntu 15.04 gtk+ 3.14 confirm bug in configuration.
i reproduced on ubuntu 15.04 live cd (all necessary libraries come preinstalled). there workaround this?
Comments
Post a Comment