Backing out bug 849099 for causing functionality regressions (bug 897901), csets cbf5e9ebd287, 0a565c255a8b, d6623f06fe55

This commit is contained in:
Gijs Kruitbosch 2013-07-25 13:53:47 +02:00
parent db1dd60d63
commit db4ffde7a8
2 changed files with 16 additions and 21 deletions

View File

@ -2,14 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifdef MOZ_WIDGET_COCOA
let useHitTest = true;
#elifdef XP_WIN
let sysInfo = Components.classes["@mozilla.org/system-info;1"]
.getService(Components.interfaces.nsIPropertyBag2);
let useHitTest = parseFloat(sysInfo.getProperty("version")) >= 6;
#else
let useHitTest = false;
#ifdef XP_WIN
#define USE_HITTEST
#elifdef MOZ_WIDGET_COCOA
#define USE_HITTEST
#endif
this.EXPORTED_SYMBOLS = [ "WindowDraggingElement" ];
@ -17,10 +13,12 @@ this.EXPORTED_SYMBOLS = [ "WindowDraggingElement" ];
this.WindowDraggingElement = function WindowDraggingElement(elem) {
this._elem = elem;
this._window = elem.ownerDocument.defaultView;
if (useHitTest && !this.isPanel())
#ifdef USE_HITTEST
if (!this.isPanel())
this._elem.addEventListener("MozMouseHittest", this, false);
else
this._elem.addEventListener("mousedown", this, false);
#endif
this._elem.addEventListener("mousedown", this, false);
};
WindowDraggingElement.prototype = {
@ -62,11 +60,13 @@ WindowDraggingElement.prototype = {
},
handleEvent: function(aEvent) {
let isPanel = this.isPanel();
if (useHitTest && !isPanel) {
#ifdef USE_HITTEST
if (!isPanel) {
if (this.shouldDrag(aEvent))
aEvent.preventDefault();
return;
}
#endif
switch (aEvent.type) {
case "mousedown":

View File

@ -5495,16 +5495,11 @@ nsWindow::ClientMarginHitTestPoint(int32_t mx, int32_t my)
std::max(mHorResizeMargin - mNonClientOffset.left,
kResizableBorderMinSize));
bool allowContentOverride = false;
// We can skip content hit testing pre-Vista because there's no Aero Snap
// or similar, so there is no need for OS integration:
if (WinUtils::GetWindowsVersion() >= WinUtils::VISTA_VERSION) {
allowContentOverride = mSizeMode == nsSizeMode_Maximized ||
(mx >= winRect.left + nonClientSize.left &&
mx <= winRect.right - nonClientSize.right &&
my >= winRect.top + nonClientSize.top &&
my <= winRect.bottom - nonClientSize.bottom);
}
bool allowContentOverride = mSizeMode == nsSizeMode_Maximized ||
(mx >= winRect.left + nonClientSize.left &&
mx <= winRect.right - nonClientSize.right &&
my >= winRect.top + nonClientSize.top &&
my <= winRect.bottom - nonClientSize.bottom);
// The border size. If there is no content under mouse cursor, the border
// size should be larger than the values in system settings. Otherwise,