Commit Graph

18 Commits

Author SHA1 Message Date
Jeremy Huddleston 4127e8e5be XQuartz: clang static analysis fixes
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-02-15 15:03:49 -08:00
Jeremy Huddleston 7ece2cb220 XQuartz: pbproxy: 64bit fixes: Properly process an array of Atoms
(cherry picked from commit 1b659cda1af02762a31cc7875e457b08c8dc68b5)
2009-09-06 14:06:06 -07:00
Jeremy Huddleston c4ec71b405 XQuartz: pbproxy: nuke RCS Id, update header license/copyright
(cherry picked from commit 477c6968a88429bb9c10222a5836bdc936d10ab1)
2008-11-19 10:58:15 -08:00
George Peter Staplin 9007d3beea XQuartz: pbproxy: Add code to handle PICT conversion to PNG and JPEG.
This may work, unfortunately I don't have test apps that fail.

The way it works is by using an NSImage class initWithPasteboard:
method, which we then get the TIFFRepresentation of, and convert
to PNG or JPEG.

The TIFFRepresentation uses NSTIFFCompressionNone; which should be
lossless.
(cherry picked from commit 8d048cfa956f4a0860250cc836a6748912b37ad8)
2008-10-28 22:01:22 -07:00
Jeremy Huddleston 28d4f71193 XQuartz: pbproxy: Fix compilation on case-sensitive file systems...
(cherry picked from commit 6622efca216663c99d112c7a226bde691d1f3215)
2008-10-23 16:30:53 -07:00
Jeremy Huddleston 84ef8ed6fb XQuartz: implemented primary-on-grab and fixed clipboard-to-pasteboard
(cherry picked from commit bcb83eea729a01026d99d1cfc2b77385b5b275fd)
2008-10-15 17:31:54 -07:00
Jeremy Huddleston b3a971d8b5 XQuartz: xpbproxy: Support some of the preference toggles from X11.app, cleaned up CLIPBOARD_MANAGER atom management.
(cherry picked from commit f7673bb4de3c1f71eb390a3279eed3589efc3df4)
2008-10-04 21:17:02 -07:00
George Peter Staplin 7bb73a9513 XQuartz: pbproxy: Possibly fix a memory leak by using an [NSApp run] loop,
instead of calling CFRunLoopRun() directly.  The leak wasn't reproducible on
this machine, but someone was able to produce a leak trace with Instruments
that indicates it was leaking in the CFRunLoopRun() path.

x-input.m: dequeue and ignore events when pbproxy_active is false.

x-selection.h: add an is_active method that is used by x-input.m to ignore
events.

x-selection.m: Handle nearly every preference, except for primary_on_grab,
which I don't really understand yet.
(cherry picked from commit 4d51ad851e64da83cbdfb0a4a22428418a7bcf75)
2008-10-03 11:14:49 -07:00
George Peter Staplin b1d0b19661 XQuartz: pbproxy: Make the signal handler safer by using _exit, and only exit.
Remove some unnecesssary headers.

Remove some dead code that was never called or used in pbproxy.

Make use of an NSAutoreleasePool in x_init.  It could potentially cause a leak
on a startup without this.

Start adding reload_preferences to the x_selection class, as well as event
handling for that.
(cherry picked from commit 602e8ba8f7ee196696bc9e3cea6ecdf3200dcf5c)
2008-10-03 11:14:30 -07:00
Jeremy Huddleston b7ad86ff8a Xquartz: xpbproxy: Split out app-specific stuff to app-main.m in prep for making this into a thread.
(cherry picked from commit c2012138a520560f8a2160518ea73fced410c3b7)
2008-10-03 11:12:57 -07:00
George Peter Staplin 586fbc91df XQuartz: pbproxy: Fix NSObject memory leaks by properly using the
NSAutoreleasePool.   Now the usage is consistent.  In x_input_run()
we create a pool, and release it after processing the XEvents.

Add some getpid() output to main for debugging.  It needs a bit more
testing before the next release.

Don't retain the NSPasteboard as the old code did.  That may have
contributed to the leak, and it made it so that we needed the
NSAutoreleasePool created in main().

Remove the _known_types, and _pasteboard instance variables from
the x_selection class.  They aren't needed anymore.

The leaks program now indicates 0 leaks after some usage.  I want
to test further, but this seems much better, and my memory usage
graph indicates it's not growing.
(cherry picked from commit b245d84a72ee3929546cd11a6eba3c60fb4a4d95)
2008-09-26 12:31:06 -07:00
George Peter Staplin 852a0b0dde XQuartz: pbproxy: Add an X error handler that returns 0.
Move the struct atom_list into the x-selection class, so that it's
no longer a global variable named atoms.  This may ease pthread
integration and reduce the chances of symbols conflicting.
(cherry picked from commit c1403c713ca80104ae3736bd2ed1eb6ffa5192b6)
2008-09-21 17:40:42 -07:00
George Peter Staplin f67490ceb5 XQuartz: pbproxy: Make the proxy handle copy request races, and PRIMARY
INCR transfers mixed with a CLIPBOARD change.

Fix a bug with some UTF-8 transfers.  I can only guess that my UTF-8
tests before were inadequate.  I can now copy/paste any characters between
uxterm and Textedit.app.
(cherry picked from commit 7ca1532e8e6e2c733c9c508eee0de73d09ecb947)
2008-09-21 17:40:41 -07:00
George Peter Staplin 00bfbee59f XQuartz: pbproxy: pbproxy now responds to selection request events.
We can now copy and paste images to and from X11.  Text copying and
pasting works as well.

The NSPasteboard can contain TIFF or PICT images, and pbproxy will
translate to an image/png or image/jpeg request, and list those in the
TARGETS.

I added a description of the basic design at the top of x-selection.m.

I removed the request_data x_selection class struct.  It's not needed.
(cherry picked from commit 4a8daf884694c9c420c45d427f1f84e608e7e48f)
2008-09-21 17:40:16 -07:00
George Peter Staplin 7c2eb3d41a XQuartz: pbproxy: return the TARGETS list as a 32-bit list to fix a bug that was in the original.
Add TRACE() calls where appropriate to try to figure out why we are losing CLIPBOARD at times, after transferring PRIMARY to the NSPasteboard.

Use the new pbproxy_clipboard_to_pasteboard where appropriate.
(cherry picked from commit 40190675a6c1889cca3574e5d1a9c16ab74315a7)
2008-09-21 17:40:15 -07:00
George Peter Staplin 6b42f40ff9 Rename reclaim_clipboard to claim_clipboard.
(cherry picked from commit d333a8e2b5514b8b76a78c6a13a3f5149ea8de27)
2008-09-21 17:40:15 -07:00
Jeremy Huddleston 5b397642cd XQuartz: pbproxy: First round of updates to pbproxy from George.
(cherry picked from commit 5c8b956f8f3f17e8d577d97cb66424954be72684)
2008-09-21 17:40:14 -07:00
Jeremy Huddleston 1669308be6 XQuartz: Added pasteboard proxy code stripped out of quartz-wm.
(cherry picked from commit 1f842c71c35db031a24de646429834d6054adf1d)
(cherry picked from commit 144746223d8dc3f6ff2a0e805aa27a6e57df558a)
2008-09-03 09:33:58 -07:00