mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 631473 - Don't consume mouse scroll events outside arrow panels on OS X. r=mstange r=enndeakin
This commit is contained in:
parent
47b29112b3
commit
61b4e7cee5
@ -94,6 +94,7 @@ GK_ATOM(applyTemplates, "apply-templates")
|
|||||||
GK_ATOM(mozapptype, "mozapptype")
|
GK_ATOM(mozapptype, "mozapptype")
|
||||||
GK_ATOM(archive, "archive")
|
GK_ATOM(archive, "archive")
|
||||||
GK_ATOM(area, "area")
|
GK_ATOM(area, "area")
|
||||||
|
GK_ATOM(arrow, "arrow")
|
||||||
GK_ATOM(article, "article")
|
GK_ATOM(article, "article")
|
||||||
GK_ATOM(ascending, "ascending")
|
GK_ATOM(ascending, "ascending")
|
||||||
GK_ATOM(aside, "aside")
|
GK_ATOM(aside, "aside")
|
||||||
|
@ -178,6 +178,9 @@ public:
|
|||||||
virtual bool ShouldRollupOnMouseWheelEvent()
|
virtual bool ShouldRollupOnMouseWheelEvent()
|
||||||
{ return true; }
|
{ return true; }
|
||||||
|
|
||||||
|
virtual bool ShouldConsumeOnMouseWheelEvent()
|
||||||
|
{ return false; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A combobox should not roll up if activated by a mouse activate message
|
* A combobox should not roll up if activated by a mouse activate message
|
||||||
* (eg. X-mouse).
|
* (eg. X-mouse).
|
||||||
|
@ -288,6 +288,7 @@ public:
|
|||||||
// nsIRollupListener
|
// nsIRollupListener
|
||||||
virtual bool Rollup(uint32_t aCount, nsIContent** aLastRolledUp);
|
virtual bool Rollup(uint32_t aCount, nsIContent** aLastRolledUp);
|
||||||
virtual bool ShouldRollupOnMouseWheelEvent();
|
virtual bool ShouldRollupOnMouseWheelEvent();
|
||||||
|
virtual bool ShouldConsumeOnMouseWheelEvent();
|
||||||
virtual bool ShouldRollupOnMouseActivate();
|
virtual bool ShouldRollupOnMouseActivate();
|
||||||
virtual uint32_t GetSubmenuWidgetChain(nsTArray<nsIWidget*> *aWidgetChain);
|
virtual uint32_t GetSubmenuWidgetChain(nsTArray<nsIWidget*> *aWidgetChain);
|
||||||
virtual void NotifyGeometryChange() {}
|
virtual void NotifyGeometryChange() {}
|
||||||
|
@ -238,6 +238,21 @@ bool nsXULPopupManager::ShouldRollupOnMouseWheelEvent()
|
|||||||
return StringBeginsWith(value, NS_LITERAL_STRING("autocomplete"));
|
return StringBeginsWith(value, NS_LITERAL_STRING("autocomplete"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool nsXULPopupManager::ShouldConsumeOnMouseWheelEvent()
|
||||||
|
{
|
||||||
|
nsMenuChainItem* item = GetTopVisibleMenu();
|
||||||
|
if (!item)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
nsMenuPopupFrame* frame = item->Frame();
|
||||||
|
if (frame->PopupType() != ePopupTypePanel)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
nsIContent* content = frame->GetContent();
|
||||||
|
return !(content && content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
|
||||||
|
nsGkAtoms::arrow, eCaseMatters));
|
||||||
|
}
|
||||||
|
|
||||||
// a menu should not roll up if activated by a mouse activate message (eg. X-mouse)
|
// a menu should not roll up if activated by a mouse activate message (eg. X-mouse)
|
||||||
bool nsXULPopupManager::ShouldRollupOnMouseActivate()
|
bool nsXULPopupManager::ShouldRollupOnMouseActivate()
|
||||||
{
|
{
|
||||||
|
@ -2867,8 +2867,9 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
|||||||
// check to see if scroll events should roll up the popup
|
// check to see if scroll events should roll up the popup
|
||||||
if ([theEvent type] == NSScrollWheel) {
|
if ([theEvent type] == NSScrollWheel) {
|
||||||
shouldRollup = rollupListener->ShouldRollupOnMouseWheelEvent();
|
shouldRollup = rollupListener->ShouldRollupOnMouseWheelEvent();
|
||||||
// always consume scroll events that aren't over the popup
|
// consume scroll events that aren't over the popup
|
||||||
consumeEvent = YES;
|
// unless the popup is an arrow panel
|
||||||
|
consumeEvent = rollupListener->ShouldConsumeOnMouseWheelEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we're dealing with menus, we probably have submenus and
|
// if we're dealing with menus, we probably have submenus and
|
||||||
|
@ -29,10 +29,15 @@ class nsIRollupListener {
|
|||||||
virtual bool Rollup(uint32_t aCount, nsIContent** aLastRolledUp) = 0;
|
virtual bool Rollup(uint32_t aCount, nsIContent** aLastRolledUp) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Asks the RollupListener if it should rollup on mousevents
|
* Asks the RollupListener if it should rollup on mouse wheel events
|
||||||
*/
|
*/
|
||||||
virtual bool ShouldRollupOnMouseWheelEvent() = 0;
|
virtual bool ShouldRollupOnMouseWheelEvent() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asks the RollupListener if it should consume mouse wheel events
|
||||||
|
*/
|
||||||
|
virtual bool ShouldConsumeOnMouseWheelEvent() = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Asks the RollupListener if it should rollup on mouse activate, eg. X-Mouse
|
* Asks the RollupListener if it should rollup on mouse activate, eg. X-Mouse
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user