Commit Graph

15 Commits

Author SHA1 Message Date
Jeremy Huddleston d16bc8a3cd XQuartz: xpbproxy: Cleanup xpbproxy threading
Confine xpbproxy to a single thread
Runs inside its own CFRunLoop

Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2010-03-21 21:56:39 -07:00
Jeremy Huddleston d8c9ba37ab XQuartz: pbproxy: Push dpy init and CFRunLoop hook setup into the pbproxy thread to avoid possible deadlock
(cherry picked from commit 49e59d32b88e4fad070f230b5efaa261b47f78db)
2009-01-02 11:02:42 -08:00
Jeremy Huddleston 029d255a65 XQuartz: pbproxy: Release display notification lock when not needed to avoid deadlock
(cherry picked from commit 22f664ab95a0cae981e9cefad6f075d051583ca5)
2008-12-21 21:35:22 -08:00
Jeremy Huddleston d7ee76f9dd XQuartz: pbproxy: Push the pbproxy Xevent processing into its own thread
and just have the AppKit thread wake it up.
(cherry picked from commit 799715b8f3327c8da59ab45706e85af2d2c438e4)
2008-11-21 10:59:10 -08: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
Jeremy Huddleston e8112784e8 XQuartz: Integrated xpbproxy into the server.
Added a configure option called --enable-standalone-xpbproxy which is useful for deveoping xpbproxy.
The 'active' switch in preferences just disables the in-server xpbproxy (not this standalone).
(cherry picked from commit 42944936326ef8732f622db9f75b79a92980550d)
2008-11-15 19:52:34 -08:00
Jeremy Huddleston 2d764e21f2 XQuartz: pbproxy: SIGHUP reloads preferences.
(cherry picked from commit cbc0935ef74ebd76ed3db16d6ab86043eeed42a3)
2008-10-23 14:16:57 -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
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 23ec8261b6 XQuartz: pbproxy: The greedy CLIPBOARD handling now works for text.
This change adds some [self own_clipboard] calls in the necessary places to get the proper greedy behavior.

UTF8_STRING and STRING properties seem to work well now with the test cases (PRIMARY, and CLIPBOARD).  I can copy from several different X apps, and have the behavior be correct when pasting.  I also verified that quartz-wm isn't doing the copying, by disabling the quartz-wm paths.
(cherry picked from commit 934669f732c28f07b9d934d8f8f0b63ccfebd900)
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