Thu May 16 18:47:29 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkwindow.c (gtk_window_show): Disable the focus-some-widget code for GtkPlug descendants. * gtk/gtkplug.c (gtk_plug_focus_event): Eat focus-in/out events since they can be generated by keyboard grabs, but are spurious for an embeddded widget. (#79196, Padraig O'Briain) * gtk/gtksocket.c (gtk_socket_size_request): Only pay attention to the minimum size hints, and changes to that ... ignore the default size. * gtk/gtksocket.c (gtk_socket_send_configure_event): Pass in root-window relative coordinates as per the ICCCM. * gtk/gtksocket.c (gtk_socket_size_allocate): Send as many synthetic configures as necessary to make up for ConfigureRequest events we got. (#78799, Dave Camp.)
This commit is contained in:
@ -48,6 +48,8 @@ static void gtk_plug_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
static gboolean gtk_plug_key_press_event (GtkWidget *widget,
|
||||
GdkEventKey *event);
|
||||
static gboolean gtk_plug_focus_event (GtkWidget *widget,
|
||||
GdkEventFocus *event);
|
||||
static void gtk_plug_set_focus (GtkWindow *window,
|
||||
GtkWidget *focus);
|
||||
static gboolean gtk_plug_focus (GtkWidget *widget,
|
||||
@ -123,6 +125,8 @@ gtk_plug_class_init (GtkPlugClass *class)
|
||||
widget_class->realize = gtk_plug_realize;
|
||||
widget_class->unrealize = gtk_plug_unrealize;
|
||||
widget_class->key_press_event = gtk_plug_key_press_event;
|
||||
widget_class->focus_in_event = gtk_plug_focus_event;
|
||||
widget_class->focus_out_event = gtk_plug_focus_event;
|
||||
|
||||
widget_class->show = gtk_plug_show;
|
||||
widget_class->hide = gtk_plug_hide;
|
||||
@ -653,6 +657,17 @@ gtk_plug_key_press_event (GtkWidget *widget,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_plug_focus_event (GtkWidget *widget,
|
||||
GdkEventFocus *event)
|
||||
{
|
||||
/* We eat focus-in events and focus-out events, since they
|
||||
* can be generated by something like a keyboard grab on
|
||||
* a child of the plug.
|
||||
*/
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_plug_set_focus (GtkWindow *window,
|
||||
GtkWidget *focus)
|
||||
@ -1028,15 +1043,24 @@ handle_xembed_message (GtkPlug *plug,
|
||||
|
||||
case XEMBED_FOCUS_OUT:
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (plug);
|
||||
GdkEvent event;
|
||||
|
||||
event.focus_change.type = GDK_FOCUS_CHANGE;
|
||||
event.focus_change.window = GTK_WIDGET (plug)->window;
|
||||
event.focus_change.window = widget->window;
|
||||
event.focus_change.send_event = TRUE;
|
||||
event.focus_change.in = (message == XEMBED_FOCUS_IN);
|
||||
|
||||
gtk_widget_event (GTK_WIDGET (plug), &event);
|
||||
|
||||
if (message == XEMBED_FOCUS_IN)
|
||||
{
|
||||
event.focus_change.in = TRUE;
|
||||
GTK_WIDGET_CLASS (parent_class)->focus_in_event (widget, (GdkEventFocus *)&event);
|
||||
}
|
||||
else
|
||||
{
|
||||
event.focus_change.in = FALSE;
|
||||
GTK_WIDGET_CLASS (parent_class)->focus_out_event (widget, (GdkEventFocus *)&event);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user