Re Inkscape clipboard, I believe there are two major problems :
1) General to all platforms, the fact that Inkscape spends time at exit,
putting items on the clipboard:
I believe that Inkscape current behavior is the correct one.
Placing items on the clipboard is an expensive operation. Most operating
systems have switched to a "delayed clipboard request fulfilling" model:
an app offers items on the clipboard, at the user request, but does not
actually pass them to the OS. Only when another app requests the clip,
the original app fulfills the request. On exit, if the app owns the
promised items on the clipboard, the OS will request to fulfill
placement of items on the clipboard, to make them available to other apps.
The reason for that behavior is that it makes apps look nicer. If all
"copy" requests were to be materialized in the clipboard immediately,
the user would have to wait a significant amount of time when he/she
presses Cmd-C. It is especially true of Inkscape. Inkscape's cut and
past operations are especially expensive, because the have to go through
uniconverter.
By delaying clipboard requests fulfillment, the user as a better
experience: when he requests a paste in another app, the app who own the
clipboard item is the the background and can fulfill the request at any
speed, without annoying the user. Materializing items in the clipboard
at exit does not annoy the user, because the user is focus on other
activities and does not mind a rather slow app exit.
2) Mac specific:
Inkscape+quartz cannot interact with the clipboard, due to the fact that
the gtk library + quartz backend does not do a proper job of translating
mime-types to Uniform Type Identifier, and vice-versa.
The patch below, should fix properly gtk2+quartz, but I'm still testing it.
Valerio
Patch:
diff -Naur gtk/gtkquartz.c gtk/gtkquartz.c
--- gtk/gtkquartz.c 2011-11-22 05:36:41.000000000 -0700
+++ gtk/gtkquartz.c 2013-01-18 09:25:59.000000000 -0700
@@ -80,16 +80,16 @@
static NSString *
target_to_pasteboard_type (const char *target)
{
- if (strcmp (target, "UTF8_STRING") == 0)
- return NSStringPboardType;
- else if (strcmp (target, "image/tiff") == 0)
- return NSTIFFPboardType;
- else if (strcmp (target, "application/x-color") == 0)
- return NSColorPboardType;
- else if (strcmp (target, "text/uri-list") == 0)
- return NSURLPboardType;
- else
- return [NSString stringWithUTF8String:target];
+ NSString *str;
+ CFStringRef uti;
+
+ if (strcmp (target, "UTF8_STRING") == 0)
+ return NSStringPboardType;
+ else {
+ str = [[NSString alloc] initWithUTF8String:target];
+ uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType,
(CFStringRef)str, NULL);
+ return (NSString *) uti;
+ }
}
NSSet *
@@ -127,16 +127,14 @@
GdkAtom
_gtk_quartz_pasteboard_type_to_atom (NSString *type)
{
+ NSString *str;
+
if ([type isEqualToString:NSStringPboardType])
return gdk_atom_intern_static_string ("UTF8_STRING");
- else if ([type isEqualToString:NSTIFFPboardType])
- return gdk_atom_intern_static_string ("image/tiff");
- else if ([type isEqualToString:NSColorPboardType])
- return gdk_atom_intern_static_string ("application/x-color");
- else if ([type isEqualToString:NSURLPboardType])
- return gdk_atom_intern_static_string ("text/uri-list");
- else
- return gdk_atom_intern ([type UTF8String], FALSE);
+ else {
+ str = (NSString
*)UTTypeCopyPreferredTagWithClass((CFStringRef)type, kUTTagClassMIMEType);
+ return gdk_atom_intern([str UTF8String], FALSE);
+ }
}
GList *
Show replies by date