Bug #102578. Clicking wrongfully fires onmouseout. Ignore some mouse out events generated by window managers. r=bryner, sr=blizzard
This commit is contained in:
Родитель
92b8b3afef
Коммит
0bbc0740e4
|
@ -97,6 +97,9 @@ static inline PRBool is_context_menu_key(const nsKeyEvent& inKeyEvent);
|
|||
static void key_event_to_context_menu_event(const nsKeyEvent* inKeyEvent,
|
||||
nsMouseEvent* outCMEvent);
|
||||
|
||||
static int is_parent_ungrab_enter(GdkEventCrossing *aEvent);
|
||||
static int is_parent_grab_leave(GdkEventCrossing *aEvent);
|
||||
|
||||
/* callbacks from widgets */
|
||||
static gboolean expose_event_cb (GtkWidget *widget,
|
||||
GdkEventExpose *event);
|
||||
|
@ -3127,6 +3130,10 @@ gboolean
|
|||
enter_notify_event_cb (GtkWidget *widget,
|
||||
GdkEventCrossing *event)
|
||||
{
|
||||
if (is_parent_ungrab_enter(event)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
nsWindow *window = get_window_for_gdk_window(event->window);
|
||||
if (!window)
|
||||
return TRUE;
|
||||
|
@ -3141,6 +3148,10 @@ gboolean
|
|||
leave_notify_event_cb (GtkWidget *widget,
|
||||
GdkEventCrossing *event)
|
||||
{
|
||||
if (is_parent_grab_leave(event)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
nsWindow *window = get_window_for_gdk_window(event->window);
|
||||
if (!window)
|
||||
return TRUE;
|
||||
|
@ -3679,6 +3690,25 @@ key_event_to_context_menu_event(const nsKeyEvent* aKeyEvent,
|
|||
aCMEvent->acceptActivation = PR_FALSE;
|
||||
}
|
||||
|
||||
/* static */
|
||||
int
|
||||
is_parent_ungrab_enter(GdkEventCrossing *aEvent)
|
||||
{
|
||||
return (GDK_CROSSING_UNGRAB == aEvent->mode) &&
|
||||
((GDK_NOTIFY_ANCESTOR == aEvent->detail) ||
|
||||
(GDK_NOTIFY_VIRTUAL == aEvent->detail));
|
||||
|
||||
}
|
||||
|
||||
/* static */
|
||||
int
|
||||
is_parent_grab_leave(GdkEventCrossing *aEvent)
|
||||
{
|
||||
return (GDK_CROSSING_GRAB == aEvent->mode) &&
|
||||
((GDK_NOTIFY_ANCESTOR == aEvent->detail) ||
|
||||
(GDK_NOTIFY_VIRTUAL == aEvent->detail));
|
||||
}
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
/**
|
||||
* void
|
||||
|
|
Загрузка…
Ссылка в новой задаче