discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drag & Drop Problem


From: Andreas Höschler
Subject: Drag & Drop Problem
Date: Thu, 30 Mar 2006 19:28:08 +0200

Hello Steppers,

I have an application with a NSView sublcass. I sent

[self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];

to this view. From within the application I can drop files on this view. But if I start a second instance and try to drag and drop from one to the other application instance,

- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender

is never called and the image slides back. This works on MacOSX so I started to look into the GNUstep code and found out, that in GSDragView.m this

- (void) _handleEventDuringDragging: (NSEvent *)theEvent
{
  switch ([theEvent type])
    {
    case NSAppKitDefined:
      {
        GSAppKitSubtype sub = [theEvent subtype];

        switch (sub)
        {
        case GSAppKitWindowMoved:
        case GSAppKitWindowResized:
          /*
           * Keep window up-to-date with its current position.
           */
          [NSApp sendEvent: theEvent];
          break;

        case GSAppKitDraggingStatus:
          NSDebugLLog(@"NSDragging", @"got GSAppKitDraggingStatus\n");
          if ((int)[theEvent data1] == targetWindowRef)
            {
              unsigned int newTargetMask = [theEvent data2];

              if (newTargetMask != targetMask)
                {
NSLog(@"settig newTargetMask %d", newTargetMask); // <--- this gets called
                  targetMask = newTargetMask;
                  [self _setCursor];
                }
            }
        ...

the targetMask gets set to 8. This causes the problem! In

- (void) _handleDrag: (NSEvent*)theEvent slidePoint: (NSPoint)slidePoint

the slide back portion gets called since (targetMask & dragMask & operationMask) evaluates to 0. Any idea what's going wrong here. Is drag and drop between applications actually working on GNUstep. I encounetr this on Solaris 10 with GNOME.

Thanks,

  Andreas






reply via email to

[Prev in Thread] Current Thread [Next in Thread]