This summer I'll be tackling a Google Summer of Code assignment with Ubuntu keep clipboard contents from being lost when an application quits. You can check out my application here, developed with lots of input from my mentor Ted Gould and Ubuntu developers James Westby and David Bensimmon on IRC and the ubuntu-soc mailing list.
The problem: data loss on quit
Say you're writing an email in your word processor. If you copy it, paste it into your email client, and then close the word processor, you're golden. If you copy it, close the word processor, and try to paste, you're probably out of luck. It's an odd case, but when it happens it means loss of user data.
The problem happens because Xorg takes a conservative approach to copying. It copies only a reference to the original data when the user performs a select or copy. It doesn't go and retrieve the actual data from the source program until the user requests a paste. It saves a lot of unneeded transfer of data this way, at the expense of having no way of retrieving data from a closed program that hasn't saved its clipboard somewhere else.
The solution: save on exit
Freedesktop's ClipboardManager specification comes to the rescue. Gnome settings daemon, the component of Ubuntu that handles all copying and pasting by default, conforms by allowing applications to explicitly request to save their clipboard contents in a safe place. Applications conform by requesting a save before they exit. Everything gets squared away before a quit and we don't lose any data. Unfortunately, there are very few applications that conform to this standard, and we believe that few developers are even aware of the problem. I hope to put together an online guide to fixing the problem while patching several popular Ubuntu programs myself.
A batch fix?
The adhoc approach of fixing a series of apps seems like it'll work, but we're looking for a more systematic way to knock out the problem in many places at once. Right now, we have a variety of clipboard history applications that provide clipboard persistence by keeping track of each copy performed. These panel apps get the job done, but they're probably too heavyweight for default inclusion in Ubuntu. A lighter weight solution might be to create a library that GTK+ application developers can use to easily fix this problem. I'll be comparing existing fixes to figure out whether this is a feasible approach.
Things to watch out for: performance problem, format support, upcoming GTK+ improvements
There are several things to keep in mind as I start investigating the problem.
- I've seen reports that saving clipboard data can have a performance hit. I'll need to make sure I'm not imposing an unacceptable performance hit before I push out changes to a bunch of programs.
- An application can broadcast that it can provide a picture the user has copied as a jpg to an image program and as a text link to an editor. I'll need to make sure I'm not imposing any regressions to multiple format support on any changes I make, and report on support status as I go.
- There are some changes that might be coming down the pipeline to GTK+ this summer with the addition of a base application class. Ted mentioned that the sort of changes I'm proposing might be made easier then. All the more reason, then, to keep what I'm doing well documented so it can be easily reimplemented when there's a better place to put it.
Weeks one and two, May 24 - June 6, 2010
- Create an example program that exhibits the problem
- Fix the problem in the example program
- Put up a website that describes the problem and shows how to fix it using the example program
- Add a page of extra links and explanatory material for anyone who's researching the problem; have a section at the top for users who might just be googling the behaviour.
- Compile a list of existing patches that fix this problem and add them to the link page
- Read them to get an idea of how it's being fixed and where there are commonalities that could be factored out
- Fix the problem in one real application
- If it seems like a common library to make future fixes easier makes sense, put together a proposal for it
- Update documentation page so that it would have been useful to me in fixing the real app I tackled
oakley sunglasses
ReplyDeletepolo factory store
coach handbags outlet
clarks shoes sale
rolex watches for women
tods
puma outlet store
canada goose sale
toms outlet factory
girls jordans
hermes birkin
canada goose coats on sale
coach purses
nike high heels
michael kors outlet online
celine bags
nike factory store
polo ralph lauren factory store
fitflops sale clearance
christian louboutin outlet
michael kors outlet
oakley outlet
north face coats for women
jordan shoes
canada goose cheap
michael kors purses cheap
gucci belts
cheap nfl jerseys
jordans for sale
michael kors handbags clearance
jordan 13
new balance shoes
michael kors handbags sale
hollister outlet
mont blanc mountain
michael kors factory outlet
coach handbags 20151028lxy
jordan 11
ReplyDeletetod's
michael kors handbags
jordan 12
hermes belt
michael kors outlet
nike outlet
nike air max 90
cheap nike air max
hermes bag
ugg boots clearance
canada goose outlet sale
coach sunglasses
mbt shoes for women
kobe bryant shoes
columbia outlet store
new balance shoes
coach bags
nike air max
polo outlet
new balance running shoes
all jordan shoes
puma outlet
christian louboutin shoes
rolex mens watches
mont blanc pens
burberry outlet
timberland boots
vans outlet
fendi bags
celine outlet online
burberry sale
coach outlet
coach factory
juicy couture handbags
hermes bag
louis vuitton belts 20151028lxy