зеркало из https://github.com/mozilla/gecko-dev.git
Set time on more events. b=367927 r+sr=roc
This commit is contained in:
Родитель
84f0a10ddc
Коммит
16f07d7c9c
|
@ -384,8 +384,8 @@ public:
|
|||
PRUint32 message;
|
||||
// In widget relative coordinates, not modified by layout code.
|
||||
nsPoint refPoint;
|
||||
// Elapsed time, in milliseconds, from the time the system was
|
||||
// started to the time the message was created
|
||||
// Elapsed time, in milliseconds, from a platform-specific zero time
|
||||
// to the time the message was created
|
||||
PRUint32 time;
|
||||
// Flags to hold event flow stage and capture/bubble cancellation
|
||||
// status. This is used also to indicate whether the event is trusted.
|
||||
|
|
|
@ -90,6 +90,8 @@ nsCommonWidget::InitButtonEvent(nsMouseEvent &aEvent,
|
|||
aEvent.isMeta = (aGdkEvent->state & GDK_MOD4_MASK)
|
||||
? PR_TRUE : PR_FALSE;
|
||||
|
||||
aEvent.time = aGdkEvent->time;
|
||||
|
||||
switch (aGdkEvent->type) {
|
||||
case GDK_2BUTTON_PRESS:
|
||||
aEvent.clickCount = 2;
|
||||
|
@ -138,6 +140,7 @@ nsCommonWidget::InitMouseScrollEvent(nsMouseScrollEvent &aEvent,
|
|||
aEvent.isMeta = (aGdkEvent->state & GDK_MOD4_MASK)
|
||||
? PR_TRUE : PR_FALSE;
|
||||
|
||||
aEvent.time = aGdkEvent->time;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -152,6 +155,7 @@ nsCommonWidget::InitKeyEvent(nsKeyEvent &aEvent, GdkEventKey *aGdkEvent)
|
|||
? PR_TRUE : PR_FALSE;
|
||||
aEvent.isMeta = (aGdkEvent->state & GDK_MOD4_MASK)
|
||||
? PR_TRUE : PR_FALSE;
|
||||
|
||||
aEvent.time = aGdkEvent->time;
|
||||
}
|
||||
|
||||
|
|
|
@ -1800,6 +1800,8 @@ nsWindow::OnEnterNotifyEvent(GtkWidget *aWidget, GdkEventCrossing *aEvent)
|
|||
event.refPoint.x = nscoord(aEvent->x);
|
||||
event.refPoint.y = nscoord(aEvent->y);
|
||||
|
||||
event.time = aEvent->time;
|
||||
|
||||
LOG(("OnEnterNotify: %p\n", (void *)this));
|
||||
|
||||
nsEventStatus status;
|
||||
|
@ -1818,6 +1820,8 @@ nsWindow::OnLeaveNotifyEvent(GtkWidget *aWidget, GdkEventCrossing *aEvent)
|
|||
event.refPoint.x = nscoord(aEvent->x);
|
||||
event.refPoint.y = nscoord(aEvent->y);
|
||||
|
||||
event.time = aEvent->time;
|
||||
|
||||
LOG(("OnLeaveNotify: %p\n", (void *)this));
|
||||
|
||||
nsEventStatus status;
|
||||
|
@ -1832,6 +1836,8 @@ nsWindow::OnMotionNotifyEvent(GtkWidget *aWidget, GdkEventMotion *aEvent)
|
|||
sIsDraggingOutOf = PR_FALSE;
|
||||
|
||||
// see if we can compress this event
|
||||
// XXXldb Why skip every other motion event when we have multiple,
|
||||
// but not more than that?
|
||||
XEvent xevent;
|
||||
PRPackedBool synthEvent = PR_FALSE;
|
||||
while (XCheckWindowEvent(GDK_WINDOW_XDISPLAY(aEvent->window),
|
||||
|
@ -1857,6 +1863,8 @@ nsWindow::OnMotionNotifyEvent(GtkWidget *aWidget, GdkEventMotion *aEvent)
|
|||
? PR_TRUE : PR_FALSE;
|
||||
event.isAlt = (xevent.xmotion.state & GDK_MOD1_MASK)
|
||||
? PR_TRUE : PR_FALSE;
|
||||
|
||||
event.time = xevent.xmotion.time;
|
||||
}
|
||||
else {
|
||||
event.refPoint.x = nscoord(aEvent->x);
|
||||
|
@ -1868,6 +1876,8 @@ nsWindow::OnMotionNotifyEvent(GtkWidget *aWidget, GdkEventMotion *aEvent)
|
|||
? PR_TRUE : PR_FALSE;
|
||||
event.isAlt = (aEvent->state & GDK_MOD1_MASK)
|
||||
? PR_TRUE : PR_FALSE;
|
||||
|
||||
event.time = aEvent->time;
|
||||
}
|
||||
|
||||
nsEventStatus status;
|
||||
|
@ -2398,6 +2408,7 @@ nsWindow::OnDragMotionEvent(GtkWidget *aWidget,
|
|||
|
||||
event.refPoint.x = retx;
|
||||
event.refPoint.y = rety;
|
||||
event.time = aTime;
|
||||
|
||||
innerMostWidget->AddRef();
|
||||
|
||||
|
@ -2514,6 +2525,7 @@ nsWindow::OnDragDropEvent(GtkWidget *aWidget,
|
|||
|
||||
event.refPoint.x = retx;
|
||||
event.refPoint.y = rety;
|
||||
event.time = aTime;
|
||||
|
||||
nsEventStatus status;
|
||||
innerMostWidget->DispatchEvent(&event, status);
|
||||
|
|
Загрузка…
Ссылка в новой задаче