Commit 1bc2cfd0 authored by Jim Mathies's avatar Jim Mathies
Browse files

Bug 463088 - Tab tear off cursor needs to be constant on Windows. r=enndeakin.

parent 8ca8ee9e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1925,6 +1925,9 @@
            // "internet shortcut"
            dt.mozSetDataAt("text/plain", spec, 0);
            
            // Set the cursor to an arrow during tab drags.
            dt.mozCursor = "default";

            var canvas = tabPreviews.capture(target, false);
            dt.setDragImage(canvas, 0, 0);
            aEvent.stopPropagation();
+21 −1
Original line number Diff line number Diff line
@@ -76,7 +76,8 @@ nsDOMDataTransfer::nsDOMDataTransfer()
    mIsExternal(PR_FALSE),
    mUserCancelled(PR_FALSE),
    mDragImageX(0),
    mDragImageY(0)
    mDragImageY(0),
    mCursorState(PR_FALSE)
{
}

@@ -297,6 +298,25 @@ nsDOMDataTransfer::GetMozItemCount(PRUint32* aCount)
  return NS_OK;
}

NS_IMETHODIMP
nsDOMDataTransfer::GetMozCursor(nsAString& aCursorState)
{
  if (mCursorState)
    aCursorState.AssignASCII("default");
  else
    aCursorState.AssignASCII("auto");
  return NS_OK;
}

NS_IMETHODIMP
nsDOMDataTransfer::SetMozCursor(const nsAString& aCursorState)
{
  // Lock the cursor to an arrow during the drag.
  mCursorState = aCursorState.EqualsASCII("default");

  return NS_OK;
}

NS_IMETHODIMP
nsDOMDataTransfer::MozTypesAt(PRUint32 aIndex, nsIDOMDOMStringList** aTypes)
{
+3 −0
Original line number Diff line number Diff line
@@ -167,6 +167,9 @@ protected:
  PRUint32 mDropEffect;
  PRUint32 mEffectAllowed;

  // Indicates the behavior of the cursor during drag operations
  PRPackedBool mCursorState;

  // readonly data transfers may not be modified except the drop effect and
  // effect allowed.
  PRPackedBool mReadOnly;
+11 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@

interface nsIVariant;

[scriptable, uuid(B5947DD0-8E86-4B9C-AA65-C86303EFCF94)]
[scriptable, uuid(E4970BA1-9567-455C-8B4E-4607D7E741BB)]
interface nsIDOMDataTransfer : nsISupports
{
  /**
@@ -180,6 +180,16 @@ interface nsIDOMNSDataTransfer : nsISupports
   */
  readonly attribute unsigned long mozItemCount;

  /**
   * Sets the drag cursor state. Primarily used to control the cursor during
   * tab drags, but could be expanded to other uses.
   *
   * Possible values:
   *  auto - use default system behavior.
   *  default - set the cursor to an arrow during the drag operation.
   */
  attribute DOMString mozCursor;

  /**
   * Holds a list of the format types of the data that is stored for an item
   * at the specified index. If the index is not in the range from 0 to
+1 −1
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ nsDragService::StartInvokingDragSession(IDataObject * aDataObj,
{
  // To do the drag we need to create an object that
  // implements the IDataObject interface (for OLE)
  nsNativeDragSource* nativeDragSource = new nsNativeDragSource();
  nsNativeDragSource* nativeDragSource = new nsNativeDragSource(mDataTransfer);
  if (!nativeDragSource)
    return NS_ERROR_OUT_OF_MEMORY;

Loading