summaryrefslogtreecommitdiff
path: root/dtrans
diff options
context:
space:
mode:
authorPhilipp Lohmann <pl@openoffice.org>2001-02-14 15:32:31 +0000
committerPhilipp Lohmann <pl@openoffice.org>2001-02-14 15:32:31 +0000
commit021d77a42b87ff8629857f58604c3c534be1b2be (patch)
treeb4133363cd054f64fa1aa366976f38490eac8196 /dtrans
parent1cdf9bd25a9992af1de53f1bae1dc2b6da8ed770 (diff)
respect active attribute on XDropTarget
Diffstat (limited to 'dtrans')
-rw-r--r--dtrans/source/X11/X11_droptarget.cxx5
-rw-r--r--dtrans/source/X11/X11_selection.cxx64
2 files changed, 41 insertions, 28 deletions
diff --git a/dtrans/source/X11/X11_droptarget.cxx b/dtrans/source/X11/X11_droptarget.cxx
index 79bd0cedb8e6..2484006713ed 100644
--- a/dtrans/source/X11/X11_droptarget.cxx
+++ b/dtrans/source/X11/X11_droptarget.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: X11_droptarget.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: pl $ $Date: 2001-02-09 16:37:26 $
+ * last change: $Author: pl $ $Date: 2001-02-14 16:32:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -94,6 +94,7 @@ void DropTarget::initialize( const Sequence< Any >& args )
args.getConstArray()[1] >>= aWindow;
SelectionManager::get().initialize( args );
SelectionManager::get().registerDropTarget( aWindow, this );
+ m_bActive = true;
}
}
diff --git a/dtrans/source/X11/X11_selection.cxx b/dtrans/source/X11/X11_selection.cxx
index 9617e9864fa4..1ecb9e554ee7 100644
--- a/dtrans/source/X11/X11_selection.cxx
+++ b/dtrans/source/X11/X11_selection.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: X11_selection.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: obr $ $Date: 2001-02-14 10:36:33 $
+ * last change: $Author: pl $ $Date: 2001-02-14 16:32:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1255,6 +1255,7 @@ void SelectionManager::handleDropEvent( XClientMessageEvent& rMessage )
::std::hash_map< Window, DropTargetEntry >::iterator it =
m_aDropTargets.find( aTarget );
if( it != m_aDropTargets.end() &&
+ it->second.m_pTarget->m_bActive &&
( m_aDropEnterEvent.data.l[0] == None || m_aDropEnterEvent.data.l[0] == aSource )
)
{
@@ -1501,17 +1502,20 @@ void SelectionManager::sendDropPosition( bool bForce, Time eventTime )
m_aDropTargets.find( m_aDropWindow );
if( it != m_aDropTargets.end() )
{
- int x, y;
- Window aChild;
- XTranslateCoordinates( m_pDisplay, it->second.m_aRootWindow, m_aDropWindow, m_nLastDragX, m_nLastDragY, &x, &y, &aChild );
- DropTargetDragEvent dtde;
- dtde.Source = static_cast< OWeakObject* >(it->second.m_pTarget );
- dtde.Context = new DropTargetDragContext( m_aCurrentDropWindow, m_nDropTimestamp, *this );
- dtde.Location.X = x;
- dtde.Location.Y = y;
- dtde.DropAction = m_nUserDragAction;
- dtde.SourceActions = m_nSourceActions;
- it->second->dragOver( dtde );
+ if( it->second.m_pTarget->m_bActive )
+ {
+ int x, y;
+ Window aChild;
+ XTranslateCoordinates( m_pDisplay, it->second.m_aRootWindow, m_aDropWindow, m_nLastDragX, m_nLastDragY, &x, &y, &aChild );
+ DropTargetDragEvent dtde;
+ dtde.Source = static_cast< OWeakObject* >(it->second.m_pTarget );
+ dtde.Context = new DropTargetDragContext( m_aCurrentDropWindow, m_nDropTimestamp, *this );
+ dtde.Location.X = x;
+ dtde.Location.Y = y;
+ dtde.DropAction = m_nUserDragAction;
+ dtde.SourceActions = m_nSourceActions;
+ it->second->dragOver( dtde );
+ }
}
else if( bForce ||
@@ -1725,19 +1729,23 @@ void SelectionManager::handleDragEvent( XEvent& rMessage )
{
if( it != m_aDropTargets.end() )
{
- int x, y;
- Window aChild;
- XTranslateCoordinates( m_pDisplay, rMessage.xbutton.root, m_aDropWindow, rMessage.xbutton.x_root, rMessage.xbutton.y_root, &x, &y, &aChild );
- DropTargetDropEvent dtde;
- dtde.Source = static_cast< OWeakObject* >(it->second.m_pTarget );
- dtde.Context = new DropTargetDropContext( m_aCurrentDropWindow, m_nDropTimestamp, *this );
- dtde.Location.X = x;
- dtde.Location.Y = y;
- dtde.DropAction = m_nUserDragAction;
- dtde.SourceActions = m_nSourceActions;
- dtde.Transferable = m_xDragSourceTransferable;
- it->second->drop( dtde );
- bCancel = false;
+ if( it->second.m_pTarget->m_bActive )
+ {
+ int x, y;
+ Window aChild;
+ XTranslateCoordinates( m_pDisplay, rMessage.xbutton.root, m_aDropWindow, rMessage.xbutton.x_root, rMessage.xbutton.y_root, &x, &y, &aChild );
+ DropTargetDropEvent dtde;
+ dtde.Source = static_cast< OWeakObject* >(it->second.m_pTarget );
+ dtde.Context = new DropTargetDropContext( m_aCurrentDropWindow, m_nDropTimestamp, *this );
+ dtde.Location.X = x;
+ dtde.Location.Y = y;
+ dtde.DropAction = m_nUserDragAction;
+ dtde.SourceActions = m_nSourceActions;
+ dtde.Transferable = m_xDragSourceTransferable;
+ it->second->drop( dtde );
+ bCancel = false;
+ }
+ else bCancel = true;
}
else if( m_nCurrentProtocolVersion >= 0 )
{
@@ -2028,6 +2036,10 @@ void SelectionManager::updateDragWindow( int nX, int nY, Window aRoot )
m_aDropWindow = aNewCurrentWindow;
m_aDropProxy = aNewProxy != None ? aNewProxy : m_aDropWindow;
+ it = m_aDropTargets.find( m_aDropWindow );
+ if( it != m_aDropTargets.end() && ! it->second.m_pTarget->m_bActive )
+ m_aDropProxy = None;
+
if( m_aDropProxy != None )
m_xDragSourceListener->dragEnter( dsde );
// send XdndEnter