mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 11:57:32 +09:00
parent
c2c31f51af
commit
e3827df1a0
4 changed files with 20 additions and 9 deletions
|
|
@ -8192,6 +8192,9 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent,
|
|||
}
|
||||
}
|
||||
}
|
||||
if (aEvent->mMessage == eKeyDown) {
|
||||
mIsLastKeyDownCanceled = aEvent->mFlags.mDefaultPrevented;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case eMouseUp:
|
||||
|
|
@ -8981,6 +8984,9 @@ PresShell::FireOrClearDelayedEvents(bool aFireEvents)
|
|||
!doc->EventHandlingSuppressed()) {
|
||||
nsAutoPtr<DelayedEvent> ev(mDelayedEvents[0].forget());
|
||||
mDelayedEvents.RemoveElementAt(0);
|
||||
if (ev->IsKeyPressEvent() && mIsLastKeyDownCanceled) {
|
||||
continue;
|
||||
}
|
||||
ev->Dispatch();
|
||||
}
|
||||
if (!doc->EventHandlingSuppressed()) {
|
||||
|
|
@ -9775,6 +9781,12 @@ PresShell::DelayedKeyEvent::DelayedKeyEvent(WidgetKeyboardEvent* aEvent) :
|
|||
mEvent = keyEvent;
|
||||
}
|
||||
|
||||
bool
|
||||
PresShell::DelayedKeyEvent::IsKeyPressEvent()
|
||||
{
|
||||
return mEvent->mMessage == eKeyPress;
|
||||
}
|
||||
|
||||
// Start of DEBUG only code
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
|
|||
|
|
@ -617,6 +617,7 @@ protected:
|
|||
public:
|
||||
virtual ~DelayedEvent() { }
|
||||
virtual void Dispatch() { }
|
||||
virtual bool IsKeyPressEvent() { return false; }
|
||||
};
|
||||
|
||||
class DelayedInputEvent : public DelayedEvent
|
||||
|
|
@ -641,6 +642,7 @@ protected:
|
|||
{
|
||||
public:
|
||||
explicit DelayedKeyEvent(mozilla::WidgetKeyboardEvent* aEvent);
|
||||
virtual bool IsKeyPressEvent() override;
|
||||
};
|
||||
|
||||
// Check if aEvent is a mouse event and record the mouse location for later
|
||||
|
|
@ -951,6 +953,8 @@ protected:
|
|||
// Whether the widget has received a paint message yet.
|
||||
bool mHasReceivedPaintMessage : 1;
|
||||
|
||||
bool mIsLastKeyDownCanceled : 1;
|
||||
|
||||
static bool sDisableNonTestMouseEvents;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue