diff options
Diffstat (limited to 'packages/gtk+/gtk+-2.6.10/gtk.keynav.gtkwidget.patch')
-rwxr-xr-x | packages/gtk+/gtk+-2.6.10/gtk.keynav.gtkwidget.patch | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/packages/gtk+/gtk+-2.6.10/gtk.keynav.gtkwidget.patch b/packages/gtk+/gtk+-2.6.10/gtk.keynav.gtkwidget.patch new file mode 100755 index 0000000000..7cf4e13cf6 --- /dev/null +++ b/packages/gtk+/gtk+-2.6.10/gtk.keynav.gtkwidget.patch @@ -0,0 +1,127 @@ +diff -r -u -p /data/zzz/gtk-2.6/gtk+-2.6.10/gtk/widget/gtkwidget.c gtk/widget/gtkwidget.c +--- /data/zzz/gtk-2.6/gtk+-2.6.10/gtk/widget/gtkwidget.c 2006-05-30 13:57:49.732943065 +0800 ++++ gtk/gtkwidget.c 2006-05-30 13:57:24.716589268 +0800 +@@ -120,6 +120,7 @@ enum { + ACCEL_CLOSURES_CHANGED, + SCREEN_CHANGED, + CAN_ACTIVATE_ACCEL, ++ KEYNAV_FAILED, + LAST_SIGNAL + }; + +@@ -202,6 +203,8 @@ static gboolean gtk_widget_real_focus_o + GdkEventFocus *event); + static gboolean gtk_widget_real_focus (GtkWidget *widget, + GtkDirectionType direction); ++static gboolean gtk_widget_real_keynav_failed (GtkWidget *widget, ++ GtkDirectionType direction); + static PangoContext* gtk_widget_peek_pango_context (GtkWidget *widget); + static void gtk_widget_propagate_state (GtkWidget *widget, + GtkStateData *data); +@@ -363,6 +366,7 @@ gtk_widget_class_init (GtkWidgetClass *k + klass->mnemonic_activate = gtk_widget_real_mnemonic_activate; + klass->grab_focus = gtk_widget_real_grab_focus; + klass->focus = gtk_widget_real_focus; ++ klass->keynav_failed = gtk_widget_real_keynav_failed; + klass->event = NULL; + klass->button_press_event = NULL; + klass->button_release_event = NULL; +@@ -1368,6 +1372,16 @@ gtk_widget_class_init (GtkWidgetClass *k + _gtk_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GDK_TYPE_SCREEN); ++ ++ widget_signals[KEYNAV_FAILED] = ++ g_signal_new (("keynav_failed"), ++ G_TYPE_FROM_CLASS (object_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GtkWidgetClass, keynav_failed), ++ _gtk_boolean_handled_accumulator, NULL, ++ _gtk_marshal_BOOLEAN__ENUM, ++ G_TYPE_BOOLEAN, 1, ++ GTK_TYPE_DIRECTION_TYPE); + /** + * GtkWidget::can-activate-accel: + * @widget: the object which received the signal +@@ -4044,6 +4058,34 @@ gtk_widget_real_focus (GtkWidget + return FALSE; + } + ++static gboolean ++gtk_widget_real_keynav_failed (GtkWidget *widget, ++ GtkDirectionType direction) ++{ ++ GtkSettings *settings = gtk_widget_get_settings (widget); ++ gboolean cursor_only_focus; ++ ++ g_object_get (settings, "gtk-cursor-only-focus", &cursor_only_focus, NULL); ++ ++ switch (direction) ++ { ++ case GTK_DIR_TAB_FORWARD: ++ case GTK_DIR_TAB_BACKWARD: ++ return FALSE; ++ ++ case GTK_DIR_UP: ++ case GTK_DIR_DOWN: ++ case GTK_DIR_LEFT: ++ case GTK_DIR_RIGHT: ++ if (cursor_only_focus) ++ return FALSE; ++ } ++ ++ gdk_beep (); ++ ++ return TRUE; ++} ++ + /** + * gtk_widget_is_focus: + * @widget: a #GtkWidget +@@ -5500,6 +5542,20 @@ gtk_widget_child_focus (GtkWidget + return return_val; + } + ++gboolean ++gtk_widget_keynav_failed (GtkWidget *widget, ++ GtkDirectionType direction) ++{ ++ gboolean return_val; ++ ++ g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE); ++ ++ g_signal_emit (widget, widget_signals[KEYNAV_FAILED], 0, ++ direction, &return_val); ++ ++ return return_val; ++} ++ + /** + * gtk_widget_set_uposition: + * @widget: a #GtkWidget +diff -r -u -p /data/zzz/gtk-2.6/gtk+-2.6.10/gtk/widget/gtkwidget.h gtk/widget/gtkwidget.h +--- /data/zzz/gtk-2.6/gtk+-2.6.10/gtk/widget/gtkwidget.h 2006-05-30 13:57:49.736942642 +0800 ++++ gtk/gtkwidget.h 2006-05-30 13:57:24.716589268 +0800 +@@ -406,8 +406,9 @@ struct _GtkWidgetClass + gboolean (*can_activate_accel) (GtkWidget *widget, + guint signal_id); + ++ gboolean (* keynav_failed) (GtkWidget *widget, ++ GtkDirectionType direction); + /* Padding for future expansion */ +- void (*_gtk_reserved2) (void); + void (*_gtk_reserved3) (void); + void (*_gtk_reserved4) (void); + void (*_gtk_reserved5) (void); +@@ -562,7 +563,8 @@ GdkWindow *gtk_widget_get_parent_window + + gboolean gtk_widget_child_focus (GtkWidget *widget, + GtkDirectionType direction); +- ++gboolean gtk_widget_keynav_failed (GtkWidget *widget, ++ GtkDirectionType direction); + void gtk_widget_set_size_request (GtkWidget *widget, + gint width, + gint height); +Only in gtk/widget: gtkwidget.h.bak +Only in gtk/widget: gtkwidget.lo |