Alexander Back wrote: > > Hi Will, > > WillP wrote: >> Update: this does not seem to be a problem with Opera but is does happen >> in >> Firefox 3.0.5 and IE 6.0 >> >> >> WillP wrote: >>> When an internal window is dragged and the mouse moves outside the >>> document area (and even outside the browser frame) the drag is not >>> terminated and if a mouse up happens outside the web page the window >>> drag >>> continues when the mouse returns inside the document area - this is not >>> ideal behaviour. >>> >>> I don't know enough about the browsers to know if there is a mouse/drag >>> exit/leave/out event which could be used to fix this but it would be >>> good >>> to know if it is possible for this behaviour to be corrected. > Unfortunately not. There is no event fired for IE and Firefox when the > mouse pointer moves outside the browser, so you cannot easily stop the > drag session. > You can use the "mouseout" event at the window object, but this still > does not solve the problem completely. If the user moves out *and* holds > the mouse button the drag session should be still valid. Or you choose > to stop the drag session whenever the user leaves the window. > Anyway, there is no clean solution to this problem and this is the > reason for no implementation in the framework. Hopefully there will be > some useful events in all browsers in the future to handle this issue. > > Thanks for clarifying the lack of explicit leave/exit event - I suspected as much.
Would there be anything wrong with changing the _onMoveMouseMove method of MMoveable so that if there is no button pressed when a move occurs while the move state is still in effect (and therefore the mouse up must have happened outside the document) the move is terminated without any further repositioning of the moved widget? In this scenario: If a move frame is not used the widget stays at the location is was when the mouse left the document. If a move frame is used the move operation has no effect at all. Here's the code. _onMoveMouseMove : function(e) { // Only react when dragging is active if (!this.hasState("move")) { return; } if(e.getButton() == "none") { // Remove drag state this.removeState("move"); // Disable capturing this.__moveHandle.releaseCapture(); // Hide frame afterwards if (this.getUseMoveFrame()) { this.__getMoveFrame().exclude(); } } else { // Apply new coordinates using DOM var coords = this.__computeMoveCoordinates(e); if (this.getUseMoveFrame()) { this.__getMoveFrame().setDomPosition(coords.left, coords.top); } else { this.setDomPosition(coords.left, coords.top); } } }, Thanks, Will -- View this message in context: http://www.nabble.com/0.8---Internal-Window-drag-not-ending-when-mouse-leaves-document-tp21092362p21330517.html Sent from the qooxdoo-devel mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel