After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754952 - gdk_pixbuf_get_from_window: always returns same image
gdk_pixbuf_get_from_window: always returns same image
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-09-13 11:38 UTC by Balló György
Modified: 2015-09-18 00:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test application (1.65 KB, text/plain)
2015-09-15 12:15 UTC, Alberts Muktupāvels
Details

Description Balló György 2015-09-13 11:38:19 UTC
I always get the same screenshot image, when I take screenshot multiple times. I have to restart gnome-flasback to get a new image again.

It can be reproduced easily:
1. Press Print screen key.
2. Open a new window.
3. Press Print screen key again.
4. You'll see the same images saved into the Pictures folder.

Tested with gnome-flashback git master.
Comment 1 Alberts Muktupāvels 2015-09-13 18:42:04 UTC
I can not reproduce. Should I press very fast print key, or should I open some specific window?
Comment 2 Balló György 2015-09-13 18:52:16 UTC
I don't do any special. Anytime I press the Print screen key, I get the first screenshot again and again until I restart gnome-flashback. Even if I use Alt-Print screen or Shift-Print screen, always the first image cropped.
Comment 3 Alberts Muktupāvels 2015-09-15 12:15:06 UTC
Created attachment 311357 [details]
Test application

This is small test application that has same problem. Compile with:
gcc `pkg-config --cflags gtk+-3.0` -o test-gdk-pixbuf-from-window test-gdk-pixbuf-from-window.c `pkg-config --libs gtk+-3.0`

I can reproduce this on my laptop with intel card, but not on my main pc with nvidia card.
Comment 4 Benjamin Otte (Company) 2015-09-18 00:06:43 UTC
commit 15d043c5d239facb99fa776c100f520c350562fb
Author: Benjamin Otte <otte@redhat.com>
Date:   Fri Sep 18 02:04:10 2015 +0200

    gdk: Mark window surfaces as dirty before reading from them
        
    We do not know what happened to this surface outside of GDK.
    Especially for foreign windows, they will have been modified
    by external applications.
                        
    So be on the safe side and tell Cairo to clear all
    its caches.