Ticket #4130: 0001-Use-getter-to-get-a-Gtk.Clipboard.patch

File 0001-Use-getter-to-get-a-Gtk.Clipboard.patch, 932 bytes (added by garnacho, 10 years ago)

patch to fix Write issue

  • toolbar.py

    From 2ad8eb035da885b6e232112e74cea761fd9472a4 Mon Sep 17 00:00:00 2001
    From: Carlos Garnacho <carlosg@gnome.org>
    Date: Fri, 21 Dec 2012 13:49:29 +0100
    Subject: [PATCH] Use getter to get a Gtk.Clipboard
    
    Clipboards are per-display singleton objects that must be obtained
    through the available getters.
    ---
     toolbar.py | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/toolbar.py b/toolbar.py
    index 55d40a8..a25e5d8 100644
    a b class EditToolbar(Gtk.Toolbar): 
    133133        self._findnext.set_sensitive(False)
    134134
    135135    def __paste_button_cb(self, button):
    136         clipboard = Gtk.Clipboard()
     136        clipboard = Gtk.Clipboard.get_for_display(button.get_display(),
     137                                                  Gdk.Atom.intern('CLIPBOARD', False))
    137138
    138139        if clipboard.wait_is_image_available():
    139140            pixbuf_sel = clipboard.wait_for_image()