Commit bf660df9 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

File containing #defines for XEMBED protocol.

Thu Apr 19 16:11:07 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/Makefile.am xembed.h: File containing #defines
	for XEMBED protocol.

	* gtk/gtkplug.[ch] gtk/gtksocket.[ch]:

	- Change protocol from old plug/socket specific protocol
	  to XEMBED draft
	- Various fixes to work with GTK+-2.0

	Still quite a bit of work to do here to handle initiation
	from the socket side (as specified by XEMBED), to handle
	the more advanced features of XEMBED, and to figure out
	a good way to handle same-app embedding with less overhead
	than using full XEMBED.
parent e13ec209
......@@ -359,6 +359,7 @@ gtk_c_sources = @STRIP_BEGIN@ \
gtkwindow-decorate.c \
fnmatch.c \
fnmatch.h \
xembed.h \
@STRIP_END@
# we use our own built_sources variable rules to avoid automake's
......
This diff is collapsed.
This diff is collapsed.
......@@ -58,6 +58,9 @@ struct _GtkSocket
guint focus_in : 1;
guint have_size : 1;
guint need_map : 1;
GHashTable *grabbed_keys;
GtkWidget *toplevel;
};
struct _GtkSocketClass
......
......@@ -2248,13 +2248,9 @@ static gint
gtk_window_focus_in_event (GtkWidget *widget,
GdkEventFocus *event)
{
GtkWindow *window;
GtkWindow *window = GTK_WINDOW (widget);
GdkEventFocus fevent;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_WINDOW (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
/* It appears spurious focus in events can occur when
* the window is hidden. So we'll just check to see if
* the window is visible before actually handling the
......@@ -2262,7 +2258,8 @@ gtk_window_focus_in_event (GtkWidget *widget,
*/
if (GTK_WIDGET_VISIBLE (widget))
{
window = GTK_WINDOW (widget);
window->has_focus = TRUE;
if (window->focus_widget &&
window->focus_widget != widget &&
!GTK_WIDGET_HAS_FOCUS (window->focus_widget))
......@@ -2282,14 +2279,11 @@ static gint
gtk_window_focus_out_event (GtkWidget *widget,
GdkEventFocus *event)
{
GtkWindow *window;
GtkWindow *window = GTK_WINDOW (widget);
GdkEventFocus fevent;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_WINDOW (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
window = GTK_WINDOW (widget);
window->has_focus = FALSE;
if (window->focus_widget &&
window->focus_widget != widget &&
GTK_WIDGET_HAS_FOCUS (window->focus_widget))
......@@ -2456,32 +2450,29 @@ gtk_window_real_set_focus (GtkWindow *window,
if (window->focus_widget)
{
event.type = GDK_FOCUS_CHANGE;
event.window = window->focus_widget->window;
event.in = FALSE;
if (GTK_WIDGET_RECEIVES_DEFAULT (window->focus_widget) &&
(window->focus_widget != window->default_widget))
{
GTK_WIDGET_UNSET_FLAGS (window->focus_widget, GTK_HAS_DEFAULT);
/* if any widget had the default set there should be
a default_widget, but might not so this is a sanity
check */
if (window->default_widget)
GTK_WIDGET_SET_FLAGS (window->default_widget, GTK_HAS_DEFAULT);
}
gtk_widget_event (window->focus_widget, (GdkEvent*) &event);
if (window->has_focus)
{
event.type = GDK_FOCUS_CHANGE;
event.window = window->focus_widget->window;
event.in = FALSE;
gtk_widget_event (window->focus_widget, (GdkEvent*) &event);
}
}
window->focus_widget = focus;
if (window->focus_widget)
{
event.type = GDK_FOCUS_CHANGE;
event.window = window->focus_widget->window;
event.in = TRUE;
if (GTK_WIDGET_RECEIVES_DEFAULT (window->focus_widget) &&
(window->focus_widget != window->default_widget))
{
......@@ -2491,8 +2482,15 @@ gtk_window_real_set_focus (GtkWindow *window,
if (window->default_widget)
GTK_WIDGET_UNSET_FLAGS (window->default_widget, GTK_HAS_DEFAULT);
}
gtk_widget_event (window->focus_widget, (GdkEvent*) &event);
if (window->has_focus)
{
event.type = GDK_FOCUS_CHANGE;
event.window = window->focus_widget->window;
event.in = TRUE;
gtk_widget_event (window->focus_widget, (GdkEvent*) &event);
}
}
if (window->default_widget &&
......
......@@ -70,6 +70,7 @@ struct _GtkWindow
GtkWindowType type : 4;
guint has_user_ref_count : 1;
guint has_focus : 1;
guint allow_shrink : 1;
guint allow_grow : 1;
guint auto_shrink : 1;
......
/* XEMBED messages */
#define XEMBED_EMBEDDED_NOTIFY 0
#define XEMBED_WINDOW_ACTIVATE 1
#define XEMBED_WINDOW_DEACTIVATE 2
#define XEMBED_REQUEST_FOCUS 3
#define XEMBED_FOCUS_IN 4
#define XEMBED_FOCUS_OUT 5
#define XEMBED_FOCUS_NEXT 6
#define XEMBED_FOCUS_PREV 7
#define XEMBED_GRAB_KEY 8
#define XEMBED_UNGRAB_KEY 9
#define XEMBED_MODALITY_ON 10
#define XEMBED_MODALITY_OFF 11
/* Details for XEMBED_FOCUS_IN: */
#define XEMBED_FOCUS_CURRENT 0
#define XEMBED_FOCUS_FIRST 1
#define XEMBED_FOCUS_LAST 2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment