[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43273] trunk/blender/intern/ghost/intern/ GHOST_SystemX11.cpp: patch [#29853] UTF-8 copy&paste for X11 GHOST

Campbell Barton ideasman42 at gmail.com
Wed Jan 11 01:34:49 CET 2012


Revision: 43273
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43273
Author:   campbellbarton
Date:     2012-01-11 00:34:42 +0000 (Wed, 11 Jan 2012)
Log Message:
-----------
patch [#29853] UTF-8 copy&paste for X11 GHOST

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_SystemX11.cpp

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemX11.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemX11.cpp	2012-01-11 00:22:21 UTC (rev 43272)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemX11.cpp	2012-01-11 00:34:42 UTC (rev 43273)
@@ -767,10 +767,11 @@
 		case SelectionRequest:
 		{
 			XEvent nxe;
-			Atom target, string, compound_text, c_string;
+			Atom target, utf8_string, string, compound_text, c_string;
 			XSelectionRequestEvent *xse = &xe->xselectionrequest;
 			
 			target = XInternAtom(m_display, "TARGETS", False);
+			utf8_string = XInternAtom(m_display, "UTF8_STRING", False);
 			string = XInternAtom(m_display, "STRING", False);
 			compound_text = XInternAtom(m_display, "COMPOUND_TEXT", False);
 			c_string = XInternAtom(m_display, "C_STRING", False);
@@ -789,7 +790,7 @@
 			nxe.xselection.time = xse->time;
 			
 			/*Check to see if the requestor is asking for String*/
-			if(xse->target == string || xse->target == compound_text || xse->target == c_string) {
+			if(xse->target == utf8_string || xse->target == string || xse->target == compound_text || xse->target == c_string) {
 				if (xse->selection == XInternAtom(m_display, "PRIMARY", False)) {
 					XChangeProperty(m_display, xse->requestor, xse->property, xse->target, 8, PropModeReplace,
 					                (unsigned char*)txt_select_buffer, strlen(txt_select_buffer));
@@ -798,13 +799,14 @@
 					                (unsigned char*)txt_cut_buffer, strlen(txt_cut_buffer));
 				}
 			} else if (xse->target == target) {
-				Atom alist[4];
+				Atom alist[5];
 				alist[0] = target;
-				alist[1] = string;
-				alist[2] = compound_text;
-				alist[3] = c_string;
+				alist[1] = utf8_string;
+				alist[2] = string;
+				alist[3] = compound_text;
+				alist[4] = c_string;
 				XChangeProperty(m_display, xse->requestor, xse->property, xse->target, 32, PropModeReplace,
-				                (unsigned char*)alist, 4);
+				                (unsigned char*)alist, 5);
 				XFlush(m_display);
 			} else  {
 				//Change property to None because we do not support anything but STRING
@@ -1342,7 +1344,7 @@
 GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
 {
 	Atom sseln;
-	Atom target= m_string;
+	Atom target= m_utf8_string;
 	Window owner;
 
 	// from xclip.c doOut() v0.11




More information about the Bf-blender-cvs mailing list