Skip to content

Commit

Permalink
[BUG #8436] disabled native mouse capturing for better compatibility …
Browse files Browse the repository at this point in the history
…with qx pointer events
  • Loading branch information
danielwagner committed Jun 24, 2014
1 parent 063f672 commit 8a11a93
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
24 changes: 13 additions & 11 deletions framework/source/class/qx/event/dispatch/MouseCapture.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,14 @@ qx.Class.define("qx.event.dispatch.MouseCapture",
}

// turn on native mouse capturing if the browser supports it
if (qx.core.Environment.get("browser.documentmode") !== 9) {
if (this.hasNativeCapture) {
this.nativeSetCapture(element, containerCapture);
if (this.hasNativeCapture)
var self = this;
qx.bom.Event.addNativeListener(element, "losecapture", function()
{
var self = this;
qx.bom.Event.addNativeListener(element, "losecapture", function()
{
qx.bom.Event.removeNativeListener(element, "losecapture", arguments.callee);
self.releaseCapture();
});
}
qx.bom.Event.removeNativeListener(element, "losecapture", arguments.callee);
self.releaseCapture();
});
}

this.__containerCapture = containerCapture;
Expand Down Expand Up @@ -216,14 +213,19 @@ qx.Class.define("qx.event.dispatch.MouseCapture",
},


/** Whether the browser has native mouse capture support */
hasNativeCapture : qx.core.Environment.get("engine.name") == "mshtml",
/** Whether the browser should use native mouse capturing */
hasNativeCapture : (qx.core.Environment.get("engine.name") == "mshtml" &&
(qx.core.Environment.get("os.version") !== "7" ||
qx.core.Environment.get("browser.documentmode") < 9)),


/**
* If the browser supports native mouse capturing, sets the mouse capture to
* the object that belongs to the current document.
*
* Please note that under Windows 7 (but not Windows 8), capturing is
* not only applied to mouse events as expected, but also to native pointer events.
*
* @param element {Element} The capture DOM element
* @param containerCapture {Boolean?true} If true all events originating in
* the container are captured. If false events originating in the container
Expand Down
2 changes: 2 additions & 0 deletions framework/source/class/qx/ui/form/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ qx.Class.define("qx.ui.form.Button",
* @param e {qx.event.type.Pointer} Pointer event
*/
_onTap : function(e) {
// "execute" is fired here so that the button can be dragged
// without executing it (e.g. in a TabBar with overflow)
this.execute();
e.stopPropagation();
},
Expand Down

0 comments on commit 8a11a93

Please sign in to comment.