[Xquartz-dev] quartz-wm test version Re: Back to copy/paste.
Ben Byer
bbyer at apple.com
Mon Apr 21 18:33:43 PDT 2008
On Apr 21, 2008, at 3:54 AM, Derek Fawcus wrote:
> On Sat, Apr 19, 2008 at 12:12:19PM +0200, Harald Hanche-Olsen wrote:
>>
>> For now, this is for people to play with and report back what they
>> think. Is it too much trouble to compile an experimental quartz-wm
>> and
>> put the binary where we can get at it?
>
> Or even a version with an option like '--dont-proxy' so that people
> can
> experiment with a seperate copy&paste client? (OK one could do that
> using a different WM, but what else would one lose?)
Okay. I build a version of quartz-wm, including the changes depicted
below. Let me know if you see anything else you want me to
instrument. The binary is available here: quartz-wm-20080421.bz2
diff -drup quartzwm/main.m quartzwm-paste/main.m
--- quartzwm/main.m 2006-09-05 17:56:06.000000000 -0700
+++ quartzwm-paste/main.m 2008-04-21 18:07:08.000000000 -0700
@@ -39,6 +39,7 @@ static int _window_count;
static x_selection *_selection_object;
static BOOL _only_proxy = NO;
+static BOOL _no_pasteboard = NO;
BOOL focus_follows_mouse = NO;
BOOL focus_click_through = NO;
@@ -173,10 +174,14 @@ x_init (void)
}
else
{
+ if (_no_pasteboard) {
XAppleWMSelectInput (x_dpy, AppleWMControllerNotifyMask
| AppleWMActivationNotifyMask
| AppleWMPasteboardNotifyMask);
-
+ } else {
+ XAppleWMSelectInput (x_dpy, AppleWMControllerNotifyMask
+ | AppleWMActivationNotifyMask);
+ }
XSetErrorHandler (x_init_error_handler);
for (i = 0; i < ScreenCount (x_dpy); i++)
@@ -798,6 +803,8 @@ main (int argc, const char *argv[])
{
NSAutoreleasePool *pool;
int i;
+ fprintf(stderr,"WARNING: this is an experimental, unsupported
test version of quartz-wm\n");
+ fprintf(stderr,"Built on 2008/04/21\n");
pool = [[NSAutoreleasePool alloc] init];
@@ -812,6 +819,8 @@ main (int argc, const char *argv[])
{
if (strcmp (argv[i], "--only-proxy") == 0)
_only_proxy = YES;
+ if (strcmp (argv[i], "--no-pasteboard") == 0)
+ _no_pasteboard = YES;
else if (strcmp (argv[i], "--synchronous") == 0)
_Xdebug = 1;
else if (strcmp (argv[i], "--help") == 0)
@@ -820,7 +829,8 @@ main (int argc, const char *argv[])
Aqua window manager for X11.\n\n\
where OPTIONS... are any of:\n\
--only-proxy Don't manage windows, just proxy\n\
- pasteboard between X11 and Cocoa.\n");
+ pasteboard between X11 and Cocoa.\n\
+ --no-pasteboard Don't proxy pasteboard between X11 and
Cocoa.\n");
return 0;
}
else
diff -drup quartzwm/x-selection.m quartzwm-paste/x-selection.m
--- quartzwm/x-selection.m 2006-07-07 11:24:28.000000000 -0700
+++ quartzwm-paste/x-selection.m 2008-04-21 18:07:52.000000000
-0700
@@ -113,7 +113,9 @@ IfEventWithTimeout (Display *dpy, XEvent
- (void) x_active:(Time)timestamp
{
TRACE ();
+ fprintf(stderr, "x_active()\n");
+ _proxied_selection = x_atom_clipboard;
if ([_pasteboard changeCount] != _my_last_change)
{
if ([_pasteboard availableTypeFromArray: _known_types] != nil)
@@ -136,6 +138,7 @@ IfEventWithTimeout (Display *dpy, XEvent
TRACE ();
+ fprintf(stderr, "x_inactive()\n");
if (_proxied_selection == XA_PRIMARY)
return;
@@ -156,6 +159,7 @@ IfEventWithTimeout (Display *dpy, XEvent
{
Window w;
+ fprintf(stderr, "x_copy()\n");
/* Lazily copies the PRIMARY selection to the pasteboard. */
w = XGetSelectionOwner (x_dpy, XA_PRIMARY);
@@ -179,7 +183,7 @@ IfEventWithTimeout (Display *dpy, XEvent
- (void) clear_event:(XSelectionClearEvent *)e
{
TRACE ();
-
+ fprintf(stderr, "clear_event()\n");
/* Right now we don't care about this. */
}
@@ -228,6 +232,7 @@ convert_1 (XSelectionRequestEvent *e, NS
TRACE ();
+ fprintf(stderr, "request_event()\n");
reply.xselection.type = SelectionNotify;
reply.xselection.selection = e->selection;
reply.xselection.target = e->target;
@@ -290,8 +295,9 @@ convert_1 (XSelectionRequestEvent *e, NS
{
/* Someone sent us data we're waiting for. */
- Atom type;
- int format, r, offset;
+ fprintf(stderr, "notify_event()\n");
+ Atom type;
+ int format, r, offset;
unsigned long nitems, bytes_after;
unsigned char *data, *buf;
NSString *string;
@@ -444,7 +450,7 @@ again:
- (void) pasteboardChangedOwner:(NSPasteboard *)sender
{
TRACE ();
-
+ fprintf(stderr, "pasteboardChangedOwner()\n");
@@ -228,6 +232,7 @@ convert_1 (XSelectionRequestEvent *e, NS
TRACE ();
+ fprintf(stderr, "request_event()\n");
reply.xselection.type = SelectionNotify;
reply.xselection.selection = e->selection;
reply.xselection.target = e->target;
@@ -290,8 +295,9 @@ convert_1 (XSelectionRequestEvent *e, NS
{
/* Someone sent us data we're waiting for. */
- Atom type;
- int format, r, offset;
+ fprintf(stderr, "notify_event()\n");
+ Atom type;
+ int format, r, offset;
unsigned long nitems, bytes_after;
unsigned char *data, *buf;
NSString *string;
@@ -444,7 +450,7 @@ again:
- (void) pasteboardChangedOwner:(NSPasteboard *)sender
{
TRACE ();
-
+ fprintf(stderr, "pasteboardChangedOwner()\n");
/* Right now we don't care with this. */
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/xquartz-dev/attachments/20080421/46af65f5/attachment-0001.html
More information about the Xquartz-dev
mailing list