Bug#716920: libgtk2.0-0: patch gtk+ to allow iceweasel to paste into vnc

T. Perkins 1404927934 at noid.net
Sun Jul 14 19:01:24 UTC 2013


Package: libgtk2.0-0
Version: 2.24.20-1
Severity: normal
Tags: upstream patch


Dear Maintainer,

VNC is a commonly used graphical desktop "remote control" system:

  http://en.wikipedia.org/wiki/Vnc

Copy and paste (using the standard X11 selection mechanism) from Iceweasel to
a VNC viewer session does not work ("clipboard" contents are not updated
within the VNC session).

Copy and paste of the same content from Iceweasel to an Xterm, and then, from
the Xterm to VNC does work.  Only going directly from Iceweasel to VNC
fails...

I happen to use the vncviewer that comes with the ssvnc package, but I believe
this problem will occur with any VNC client.

This bug is long standing as I found this old report that describes the
problem and provides the gtk+ patch that fixes the bug:

  https://bugzilla.redhat.com/show_bug.cgi?id=596748

In the above, the patch is described by Adam Tkac like so:

  After more detailed inspection this is actually a bug in gtk2,
  gtk_selection_owner_set_for_display() function doesn't handle
  GDK_CURRENT_TIME macro well.

Essentially (as I understand it), most apps do not care about the time stamp
associated with a paste selection, but the VNC viewer is an exception as it's
looking to synchronize its concept of the "clipboard" across platforms so it
checks for "freshness".

Iceweasel time stamps its selection using GDK_CURRENT_TIME (I think this is
just a constant of value 0) and this is not considered to be "fresh" by VNC,
so it does not sync the clipboard...

The patch causes gtk+ to use the current time for GDK_CURRENT_TIME (not 0).

The patch is from Adam Tkac and looks like:

  diff -up gtk+-2.21.1/gtk/gtkselection.c.firefox gtk+-2.21.1/gtk/gtkselection.c
  --- gtk+-2.21.1/gtk/gtkselection.c.firefox  2010-05-30 08:52:44.000000000 +0200
  +++ gtk+-2.21.1/gtk/gtkselection.c  2010-06-09 13:00:43.484978010 +0200
  @@ -679,6 +679,16 @@ gtk_selection_owner_set_for_display (Gdk

         tmp_list = tmp_list->next;
       }
  +
  +  /* Translate a timestamp of GDK_CURRENT_TIME appropriately */
  +  if (time == GDK_CURRENT_TIME)
  +    {
  +#ifdef GDK_WINDOWING_X11
  +      time = gdk_x11_display_get_user_time (display);
  +#else
  +      time = gtk_get_current_event_time ();
  +#endif
  +    }

     if (gdk_selection_owner_set_for_display (display, window, selection, time, TRUE))
       {

The patch can be downloaded here:

  https://bugzilla.redhat.com/attachment.cgi?id=422506

I've tested the patch on my own system like so:

  cd ~/tmp
    apt-get build-dep gtk+2.0
    apt-get source    gtk+2.0
    wget -nd 'https://bugzilla.redhat.com/attachment.cgi?id=422506'
    cd gtk+2.0-*
      patch -p1 <'../attachment.cgi?id=422506'
      debian/rules binary
      dpkg -i ../libgtk2.0-0_2.20.1-2_i386.deb

The patch works perfectly for me and it resolves a bug that has bugged me for
a long time...  :^)

Thank you for your time and consideration...  It's much appreciated!

- Tor




-- System Information:
Debian Release: 6.0.7
  APT prefers oldstable-updates
  APT policy: (900, 'oldstable-updates'), (900, 'oldstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32 (SMP w/8 CPU cores; PREEMPT)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
Shell: /bin/sh linked to /bin/dash

Versions of packages libgtk2.0-0 depends on:
ii  libatk1.0-0         1.30.0-1             The ATK accessibility toolkit
ii  libc6               2.11.3-4             Embedded GNU C Library: Shared lib
ii  libcairo2           1.8.10-6             The Cairo 2D vector graphics libra
ii  libcomerr2          1.41.12-4stable1     common error description library
ii  libcups2            1.4.4-7+squeeze3     Common UNIX Printing System(tm) - 
ii  libfontconfig1      2.8.0-2.1            generic font configuration library
ii  libfreetype6        2.4.2-2.1+squeeze4   FreeType 2 font engine, shared lib
ii  libgcrypt11         1.4.5-2              LGPL Crypto library - runtime libr
ii  libglib2.0-0        2.24.2-1             The GLib library of C routines
ii  libgnutls26         2.8.6-1+squeeze2     the GNU TLS library - runtime libr
ii  libgssapi-krb5-2    1.8.3+dfsg-4squeeze7 MIT Kerberos runtime libraries - k
ii  libgtk2.0-common    2.20.1-2             Common files for the GTK+ graphica
ii  libjasper1          1.900.1-7+squeeze1   The JasPer JPEG-2000 runtime libra
ii  libjpeg62           6b1-1                The Independent JPEG Group's JPEG 
ii  libk5crypto3        1.8.3+dfsg-4squeeze7 MIT Kerberos runtime libraries - C
ii  libkrb5-3           1.8.3+dfsg-4squeeze7 MIT Kerberos runtime libraries
ii  libpango1.0-0       1.28.3-1+squeeze2    Layout and rendering of internatio
ii  libpng12-0          1.2.44-1+squeeze4    PNG library - runtime
ii  libtiff4            3.9.4-5+squeeze9     Tag Image File Format (TIFF) libra
ii  libx11-6            2:1.3.3-4+squeeze1   X11 client-side library
ii  libxcomposite1      1:0.4.2-1            X11 Composite extension library
ii  libxcursor1         1:1.1.10-2+squeeze1  X cursor management library
ii  libxdamage1         1:1.1.3-1            X11 damaged region extension libra
ii  libxext6            2:1.1.2-1+squeeze1   X11 miscellaneous extension librar
ii  libxfixes3          1:4.0.5-1+squeeze1   X11 miscellaneous 'fixes' extensio
ii  libxi6              2:1.3-8              X11 Input extension library
ii  libxinerama1        2:1.1-3+squeeze1     X11 Xinerama extension library
ii  libxrandr2          2:1.3.0-3+squeeze1   X11 RandR extension library
ii  libxrender1         1:0.9.6-1+squeeze1   X Rendering Extension client libra
ii  shared-mime-info    0.71-4               FreeDesktop.org shared MIME databa
ii  zlib1g              1:1.2.3.4.dfsg-3     compression library - runtime

Versions of packages libgtk2.0-0 recommends:
ii  hicolor-icon-theme            0.12-1     default fallback theme for FreeDes
ii  libgtk2.0-bin                 2.20.1-2   The programs for the GTK+ graphica

Versions of packages libgtk2.0-0 suggests:
pn  gvfs                          <none>     (no description available)
ii  librsvg2-common               2.26.3-1   SAX-based renderer library for SVG

-- no debconf information



More information about the pkg-gnome-maintainers mailing list