зеркало из https://github.com/mozilla/gecko-dev.git
fix focus problems documented in bug #45351. make sure that key press events are not passed to mozilla windows when an external gtk widget has focus and make sure that key press events are passed to mozilla when it has focus and a key press event happens outside of its windows. r=pavlov a=waterson
This commit is contained in:
Родитель
567fe19827
Коммит
07aaa865af
|
@ -916,12 +916,10 @@ dispatch_superwin_event(GdkEvent *event, nsWindow *window)
|
|||
if (!window->sFocusWindow)
|
||||
{
|
||||
GtkWidget *mozArea = window->GetMozArea();
|
||||
if (mozArea)
|
||||
{
|
||||
gtk_propagate_event(mozArea, event);
|
||||
}
|
||||
else
|
||||
g_print("dispatch_superwin_event: aeii! failed to get the mozarea!\n");
|
||||
NS_ASSERTION(mozArea, "Failed to get GtkMozArea for superwin event!\n");
|
||||
// pass it off to gtk's event system and return
|
||||
gtk_propagate_event(mozArea, event);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1966,16 +1966,6 @@ NS_METHOD nsWindow::CreateNative(GtkObject *parentWidget)
|
|||
InstallToplevelDragDropSignal();
|
||||
InstallToplevelDragDataReceivedSignal();
|
||||
|
||||
AddToEventMask(mShell, GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK);
|
||||
gtk_signal_connect(GTK_OBJECT(mShell),
|
||||
"key_press_event",
|
||||
GTK_SIGNAL_FUNC(handle_key_press_event),
|
||||
this);
|
||||
gtk_signal_connect(GTK_OBJECT(mShell),
|
||||
"key_release_event",
|
||||
GTK_SIGNAL_FUNC(handle_key_release_event),
|
||||
this);
|
||||
|
||||
// set the shell window as a drop target
|
||||
gtk_drag_dest_set (mShell,
|
||||
(GtkDestDefaults)0,
|
||||
|
@ -1984,6 +1974,18 @@ NS_METHOD nsWindow::CreateNative(GtkObject *parentWidget)
|
|||
(GdkDragAction)0);
|
||||
}
|
||||
|
||||
if (mMozArea) {
|
||||
AddToEventMask(mMozArea, GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK);
|
||||
gtk_signal_connect(GTK_OBJECT(mMozArea),
|
||||
"key_press_event",
|
||||
GTK_SIGNAL_FUNC(handle_key_press_event),
|
||||
this);
|
||||
gtk_signal_connect(GTK_OBJECT(mMozArea),
|
||||
"key_release_event",
|
||||
GTK_SIGNAL_FUNC(handle_key_release_event),
|
||||
this);
|
||||
}
|
||||
|
||||
if (mSuperWin) {
|
||||
// add the shell_window for this window to the table lookup
|
||||
// this is so that as part of destruction we can find the superwin
|
||||
|
|
Загрузка…
Ссылка в новой задаче