[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#489998: marked as done (x11-apps: xclipboard does not support UTF-8 (patch available))



Your message dated Sun, 06 Dec 2009 11:55:06 +0000
with message-id <E1NHFhi-0001Xi-15@ries.debian.org>
and subject line Bug#489998: fixed in x11-apps 7.5+1
has caused the Debian Bug report #489998,
regarding x11-apps: xclipboard does not support UTF-8 (patch available)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
489998: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=489998
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: x11-apps
Version: 7.3+2
Severity: normal

While reading manuals on X selections and libxt I have
added support of UTF-8 to xclipboard. Please, find
a patch attached.

To enable correct display of international texts in
Xt widgets one has to define

*international: true

in her/his ~./Xresources file.

An enough rich set of bitmap fonts must be also installed.
Just for reference I also attach a screenshot.

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (900, 'testing'), (90, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages x11-apps depends on:
ii  cpp                          4:4.3.1-1   The GNU C preprocessor (cpp)
ii  libc6                        2.7-10      GNU C Library: Shared libraries
ii  libice6                      2:1.0.4-1   X11 Inter-Client Exchange library
ii  libpng12-0                   1.2.27-1    PNG library - runtime
ii  libsm6                       2:1.0.3-2   X11 Session Management library
ii  libx11-6                     2:1.1.4-2.1 X11 client-side library
ii  libxaw7                      2:1.0.4-2   X11 Athena Widget library
ii  libxcursor1                  1:1.1.9-1   X cursor management library
ii  libxext6                     2:1.0.4-1   X11 miscellaneous extension librar
ii  libxft2                      2.1.12-3    FreeType-based font drawing librar
ii  libxkbfile1                  1:1.0.5-1   X11 keyboard file manipulation lib
ii  libxmu6                      2:1.0.4-1   X11 miscellaneous utility library
ii  libxmuu1                     2:1.0.4-1   X11 miscellaneous micro-utility li
ii  libxrender1                  1:0.9.4-2   X Rendering Extension client libra
ii  libxt6                       1:1.0.5-3   X11 toolkit intrinsics library
ii  x11-common                   1:7.3+12    X Window System (X.Org) infrastruc

x11-apps recommends no packages.

-- no debconf information

Attachment: xclipboard_unicode.png
Description: PNG image

--- x11-apps-7.3+2.orig/xclipboard/xclipboard.c	2007-05-16 19:44:53.000000000 +0400
+++ x11-apps-7.3+2+nmu1/xclipboard/xclipboard.c	2008-07-09 09:57:11.000000000 +0400
@@ -27,6 +27,7 @@
  * Author:  Ralph Swick, DEC/Project Athena
  * Updated for R4:  Chris D. Peterson,  MIT X Consortium.
  * Reauthored by: Keith Packard, MIT X Consortium.
+ * Added UTF-8 support: Stanislav Maslovski <stanislav.maslovski@gmail.com>
  */
 /* $XFree86: xc/programs/xclipboard/xclipboard.c,v 1.8tsi Exp $ */
 
@@ -70,6 +71,7 @@
 
 static Atom wm_delete_window;
 static Atom wm_protocols;
+static Atom UTF8_STRING;
 
 static void EraseTextWidget ( void );
 static void NewCurrentClipContents ( char *data, int len );
@@ -477,6 +479,19 @@
     XFree(value);
 }
 
+static void 
+InsertClipboardUtf8(Widget w, XtPointer client_data, Atom *selection, 
+		Atom *type, XtPointer value, unsigned long *length, 
+		int *format)
+{
+    if (*type == XT_CONVERT_FAIL)
+	XtGetSelectionValue(w, *selection, XA_STRING, InsertClipboard,
+			    NULL, CurrentTime);
+    else
+	InsertClipboard(w, client_data, selection, type,
+			value, length, format);
+}
+
 static Boolean 
 ConvertSelection(Widget w, Atom *selection, Atom *target,
 		 Atom *type, XtPointer *value, unsigned long *length, 
@@ -493,8 +508,9 @@
 	XmuConvertStandardSelection(w, req->time, selection, target, type,
 				    (XPointer*)&std_targets, &std_length,
 				    format);
-	*value = XtMalloc(sizeof(Atom)*(std_length + 5));
+	*value = XtMalloc(sizeof(Atom)*(std_length + 6));
 	targetP = *(Atom**)value;
+	*targetP++ = UTF8_STRING;
 	*targetP++ = XA_STRING;
 	*targetP++ = XA_TEXT(d);
 	*targetP++ = XA_LENGTH(d);
@@ -554,6 +570,23 @@
     	return True;
     }
     
+    if (*target == UTF8_STRING)
+    {
+	Arg args[1];
+	Widget source;
+	char *data;
+
+	source = XawTextGetSource (text);
+	XtSetArg (args[0], XtNstring, &data);
+	XtGetValues (source, args, 1);
+	*length = strlen (data);
+	*value = XtMalloc (*length + 1);
+	strcpy(*value, data);
+	*type = UTF8_STRING;
+	*format = 8;
+	return True;
+    }
+    
     if (XmuConvertStandardSelection(w, req->time, selection, target, type,
 				    (XPointer *) value, length, format))
 	return True;
@@ -564,7 +597,7 @@
 static void 
 LoseSelection(Widget w, Atom *selection)
 {
-    XtGetSelectionValue(w, *selection, XA_STRING, InsertClipboard,
+    XtGetSelectionValue(w, *selection, UTF8_STRING, InsertClipboardUtf8,
 			NULL, CurrentTime);
 }
 
@@ -620,6 +653,7 @@
     /* CLIPBOARD_MANAGER is a non-standard mechanism */
     ManagerAtom = XInternAtom(XtDisplay(top), "CLIPBOARD_MANAGER", False);
     ClipboardAtom = XA_CLIPBOARD(XtDisplay(top));
+    UTF8_STRING = XInternAtom(XtDisplay(top), "UTF8_STRING", False);
     if (XGetSelectionOwner(XtDisplay(top), ManagerAtom))
 	XtError("another clipboard is already running\n");
 

--- End Message ---
--- Begin Message ---
Source: x11-apps
Source-Version: 7.5+1

We believe that the bug you reported is fixed in the latest version of
x11-apps, which is due to be installed in the Debian FTP archive:

x11-apps_7.5+1.dsc
  to main/x/x11-apps/x11-apps_7.5+1.dsc
x11-apps_7.5+1.tar.gz
  to main/x/x11-apps/x11-apps_7.5+1.tar.gz
x11-apps_7.5+1_i386.deb
  to main/x/x11-apps/x11-apps_7.5+1_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 489998@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Brice Goglin <bgoglin@debian.org> (supplier of updated x11-apps package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sun, 06 Dec 2009 12:23:46 +0100
Source: x11-apps
Binary: x11-apps
Architecture: source i386
Version: 7.5+1
Distribution: unstable
Urgency: low
Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
Changed-By: Brice Goglin <bgoglin@debian.org>
Description: 
 x11-apps   - X applications
Closes: 489998 518383 536410 549457
Changes: 
 x11-apps (7.5+1) unstable; urgency=low
 .
   [ Julien Cristau ]
   * Update xload config.{guess,sub}, adding avr32 support (closes: #536410)
   * Improve the long description using patch from Justin B Rye (closes:
     #549457).  Thanks!
 .
   [ Brice Goglin ]
   * Add ico 1.0.2, closes: #518383.
   * bitmap 1.0.4.
   * xclipboard 1.1.0.
     + Add UTF8 support, closes: #489998.
   * xclock 1.0.4.
     + Drop 06_xclock_geometry.diff, applied upstream.
   * xcursorgen 1.0.3.
   * xeyes 1.0.991.
   * xgc 1.0.2.
   * xmag 1.0.3.
   * xman 1.1.0.
   * xwd 1.0.3.
     + Drop 01_xwd_do_not_spew_usage_on_connection_error.diff, applied upstream.
   * xwud 1.0.2.
   * Refresh patches.
Checksums-Sha1: 
 cb8a76f57a047db0a9c742e30a6fd4a58aa3d3fa 1264 x11-apps_7.5+1.dsc
 802389dbb968f7af1118ac79a66c973557749f99 3313029 x11-apps_7.5+1.tar.gz
 716736fe288ffc1d62b3638cb4b9991c9043cfbb 660662 x11-apps_7.5+1_i386.deb
Checksums-Sha256: 
 4e21420481b33da896f4c80e7b715bc14537240d6276a3d2af162c636b344ad9 1264 x11-apps_7.5+1.dsc
 4ac4e3d00cbbf2b45bc7f2dcd99e2b24857cb1e9a7a8406cbf68b1968d1e025d 3313029 x11-apps_7.5+1.tar.gz
 4e604acafb05cf24f0741fd578c5efb91280263e26e1c24f6c6524aa79a41122 660662 x11-apps_7.5+1_i386.deb
Files: 
 ef028038678a875e0fa9866132dbf10f 1264 x11 optional x11-apps_7.5+1.dsc
 57dc5de03b782c228d587694bbfc8bb5 3313029 x11 optional x11-apps_7.5+1.tar.gz
 ebe778b036c60157eddafccb7de5ed82 660662 x11 optional x11-apps_7.5+1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAksblUoACgkQRh88F8PcWfreMQCgmN2x2WF4JyP2BUSpnkNGzilu
sLsAmwes2WfQMLOrgO06g2KAC7QLbBD9
=3SVH
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: