diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-05-10 23:58:30 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-05-11 00:11:37 -0400 |
commit | b93631164f2c4c42994ba6cc1717c37f8a5083c5 (patch) | |
tree | 497b02b6c26080dea1b68ce59fb691fc7619da71 /gtk | |
parent | 46bad5d513e4715a912123f825226f3f2b096f06 (diff) | |
download | gtk+-b93631164f2c4c42994ba6cc1717c37f8a5083c5.tar.gz |
Remove lots of focus vfuncs
In many cases, the default widget vfuncs work just fine,
combined with setting focusable.
Diffstat (limited to 'gtk')
43 files changed, 10 insertions, 114 deletions
diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c index 78b40ef887..7b83dbad5b 100644 --- a/gtk/gtkaccellabel.c +++ b/gtk/gtkaccellabel.c @@ -128,9 +128,6 @@ gtk_accel_label_class_init (GtkAccelLabelClass *class) gobject_class->set_property = gtk_accel_label_set_property; gobject_class->get_property = gtk_accel_label_get_property; - widget_class->focus = gtk_widget_focus_none; - widget_class->grab_focus = gtk_widget_grab_focus_none; - gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_ACCEL_LABEL); props[PROP_LABEL] = diff --git a/gtk/gtkappchooserwidget.c b/gtk/gtkappchooserwidget.c index 18826d7513..2f790c72c9 100644 --- a/gtk/gtkappchooserwidget.c +++ b/gtk/gtkappchooserwidget.c @@ -894,8 +894,6 @@ gtk_app_chooser_widget_class_init (GtkAppChooserWidgetClass *klass) widget_class->measure = gtk_app_chooser_widget_measure; widget_class->size_allocate = gtk_app_chooser_widget_size_allocate; widget_class->snapshot = gtk_app_chooser_widget_snapshot; - widget_class->grab_focus = gtk_widget_grab_focus_child; - widget_class->focus = gtk_widget_focus_child; g_object_class_override_property (gobject_class, PROP_CONTENT_TYPE, "content-type"); diff --git a/gtk/gtkaspectframe.c b/gtk/gtkaspectframe.c index 5e96ecc433..ba035c4e42 100644 --- a/gtk/gtkaspectframe.c +++ b/gtk/gtkaspectframe.c @@ -130,8 +130,6 @@ gtk_aspect_frame_class_init (GtkAspectFrameClass *class) widget_class->size_allocate = gtk_aspect_frame_size_allocate; widget_class->compute_expand = gtk_aspect_frame_compute_expand; widget_class->get_request_mode = gtk_aspect_frame_get_request_mode; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_child; g_object_class_install_property (gobject_class, PROP_XALIGN, diff --git a/gtk/gtkbuiltinicon.c b/gtk/gtkbuiltinicon.c index 53b0318239..b91864db44 100644 --- a/gtk/gtkbuiltinicon.c +++ b/gtk/gtkbuiltinicon.c @@ -95,8 +95,6 @@ gtk_builtin_icon_class_init (GtkBuiltinIconClass *klass) wclass->snapshot = gtk_builtin_icon_snapshot; wclass->measure = gtk_builtin_icon_measure; wclass->css_changed = gtk_builtin_icon_css_changed; - wclass->grab_focus = gtk_widget_grab_focus_none; - wclass->focus = gtk_widget_focus_none; } static void diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 1859a088c1..fd9cbf7abc 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -214,8 +214,6 @@ gtk_button_class_init (GtkButtonClass *klass) widget_class->state_flags_changed = gtk_button_state_flags_changed; widget_class->grab_notify = gtk_button_grab_notify; widget_class->unmap = gtk_button_unmap; - widget_class->grab_focus = gtk_widget_grab_focus_self; - widget_class->focus = gtk_widget_focus_self; widget_class->compute_expand = gtk_button_compute_expand; widget_class->get_request_mode = gtk_button_get_request_mode; diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index 3afe2d8e55..deadca751f 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -361,9 +361,6 @@ gtk_calendar_class_init (GtkCalendarClass *class) gobject_class->set_property = gtk_calendar_set_property; gobject_class->get_property = gtk_calendar_get_property; - widget_class->focus = gtk_widget_focus_all; - widget_class->grab_focus = gtk_widget_grab_focus_self; - /** * GtkCalendar:year: * diff --git a/gtk/gtkcenterbox.c b/gtk/gtkcenterbox.c index 01885bb3c7..8bd0a7fda0 100644 --- a/gtk/gtkcenterbox.c +++ b/gtk/gtkcenterbox.c @@ -199,9 +199,6 @@ gtk_center_box_class_init (GtkCenterBoxClass *klass) object_class->get_property = gtk_center_box_get_property; object_class->dispose = gtk_center_box_dispose; - widget_class->grab_focus = gtk_widget_grab_focus_child; - widget_class->focus = gtk_widget_focus_child; - g_object_class_override_property (object_class, PROP_ORIENTATION, "orientation"); g_object_class_install_property (object_class, PROP_BASELINE_POSITION, diff --git a/gtk/gtkcolorswatch.c b/gtk/gtkcolorswatch.c index bfdcd9d336..b9403fd316 100644 --- a/gtk/gtkcolorswatch.c +++ b/gtk/gtkcolorswatch.c @@ -478,8 +478,6 @@ gtk_color_swatch_class_init (GtkColorSwatchClass *class) widget_class->snapshot = swatch_snapshot; widget_class->size_allocate = swatch_size_allocate; widget_class->state_flags_changed = swatch_state_flags_changed; - widget_class->grab_focus = gtk_widget_grab_focus_self; - widget_class->focus = gtk_widget_focus_self; g_object_class_install_property (object_class, PROP_RGBA, g_param_spec_boxed ("rgba", P_("RGBA Color"), P_("Color as RGBA"), diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index 43c5e7d1e4..f9aaae6df4 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -123,8 +123,6 @@ gtk_container_class_init (GtkContainerClass *class) widget_class->compute_expand = gtk_container_compute_expand; widget_class->get_request_mode = gtk_container_get_request_mode; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_child; class->add = gtk_container_add_unimplemented; class->remove = gtk_container_remove_unimplemented; diff --git a/gtk/gtkdragicon.c b/gtk/gtkdragicon.c index 570c1f5f04..45cb8e1c51 100644 --- a/gtk/gtkdragicon.c +++ b/gtk/gtkdragicon.c @@ -361,8 +361,6 @@ gtk_drag_icon_class_init (GtkDragIconClass *klass) widget_class->size_allocate = gtk_drag_icon_size_allocate; widget_class->show = gtk_drag_icon_show; widget_class->hide = gtk_drag_icon_hide; - widget_class->focus = gtk_widget_focus_none; - widget_class->grab_focus = gtk_widget_grab_focus_none; /** * GtkDragIcon:child: diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index ac523bf408..08a458cff8 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -439,7 +439,7 @@ gtk_entry_class_init (GtkEntryClass *class) widget_class->grab_focus = gtk_entry_grab_focus; widget_class->focus = gtk_widget_focus_child; widget_class->mnemonic_activate = gtk_entry_mnemonic_activate; - + quark_entry_completion = g_quark_from_static_string ("gtk-entry-completion-key"); entry_props[PROP_BUFFER] = diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c index 98d66f18ed..8f331734ca 100644 --- a/gtk/gtkflowbox.c +++ b/gtk/gtkflowbox.c @@ -504,7 +504,6 @@ gtk_flow_box_child_class_init (GtkFlowBoxChildClass *class) widget_class->get_request_mode = gtk_flow_box_child_get_request_mode; widget_class->compute_expand = gtk_flow_box_child_compute_expand; widget_class->focus = gtk_flow_box_child_focus; - widget_class->grab_focus = gtk_widget_grab_focus_none; class->activate = gtk_flow_box_child_activate; diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c index 1cd3466b3b..5956b2bbd1 100644 --- a/gtk/gtkfontchooserwidget.c +++ b/gtk/gtkfontchooserwidget.c @@ -720,8 +720,6 @@ gtk_font_chooser_widget_class_init (GtkFontChooserWidgetClass *klass) widget_class->unroot = gtk_font_chooser_widget_unroot; widget_class->map = gtk_font_chooser_widget_map; widget_class->unmap = gtk_font_chooser_widget_unmap; - widget_class->focus = gtk_widget_focus_child; - widget_class->grab_focus = gtk_widget_grab_focus_child; gobject_class->finalize = gtk_font_chooser_widget_finalize; gobject_class->dispose = gtk_font_chooser_widget_dispose; diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c index a066e76c4b..5042b1b346 100644 --- a/gtk/gtkframe.c +++ b/gtk/gtkframe.c @@ -160,8 +160,6 @@ gtk_frame_class_init (GtkFrameClass *class) widget_class->measure = gtk_frame_measure; widget_class->compute_expand = gtk_frame_compute_expand; widget_class->get_request_mode = gtk_frame_get_request_mode; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_child; class->compute_child_allocation = gtk_frame_real_compute_child_allocation; diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c index 6d8ac8f342..c91cc1e427 100644 --- a/gtk/gtkglarea.c +++ b/gtk/gtkglarea.c @@ -783,8 +783,6 @@ gtk_gl_area_class_init (GtkGLAreaClass *klass) widget_class->unrealize = gtk_gl_area_unrealize; widget_class->size_allocate = gtk_gl_area_size_allocate; widget_class->snapshot = gtk_gl_area_snapshot; - widget_class->focus = gtk_widget_focus_none; - widget_class->grab_focus = gtk_widget_grab_focus_none; gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_DRAWING_AREA); diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c index 92523ab970..76e852a8c1 100644 --- a/gtk/gtkimage.c +++ b/gtk/gtkimage.c @@ -160,8 +160,6 @@ gtk_image_class_init (GtkImageClass *class) widget_class->unrealize = gtk_image_unrealize; widget_class->css_changed = gtk_image_css_changed; widget_class->system_setting_changed = gtk_image_system_setting_changed; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_none; image_props[PROP_PAINTABLE] = g_param_spec_object ("paintable", diff --git a/gtk/gtklevelbar.c b/gtk/gtklevelbar.c index cd9d6531dd..d00a03f1f3 100644 --- a/gtk/gtklevelbar.c +++ b/gtk/gtklevelbar.c @@ -901,8 +901,6 @@ gtk_level_bar_class_init (GtkLevelBarClass *klass) oclass->finalize = gtk_level_bar_finalize; wclass->direction_changed = gtk_level_bar_direction_changed; - wclass->grab_focus = gtk_widget_grab_focus_none; - wclass->focus = gtk_widget_focus_none; g_object_class_override_property (oclass, PROP_ORIENTATION, "orientation"); diff --git a/gtk/gtkmediacontrols.c b/gtk/gtkmediacontrols.c index 526c2fb380..4f09d59feb 100644 --- a/gtk/gtkmediacontrols.c +++ b/gtk/gtkmediacontrols.c @@ -260,8 +260,6 @@ gtk_media_controls_class_init (GtkMediaControlsClass *klass) widget_class->measure = gtk_media_controls_measure; widget_class->size_allocate = gtk_media_controls_size_allocate; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_child; gobject_class->dispose = gtk_media_controls_dispose; gobject_class->get_property = gtk_media_controls_get_property; diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c index b5c0d0d169..1b3dfbc754 100644 --- a/gtk/gtkoverlay.c +++ b/gtk/gtkoverlay.c @@ -310,8 +310,6 @@ gtk_overlay_class_init (GtkOverlayClass *klass) widget_class->snapshot = gtk_overlay_snapshot; widget_class->compute_expand = gtk_overlay_compute_expand; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_child; klass->get_child_position = gtk_overlay_get_child_position; diff --git a/gtk/gtkpasswordentry.c b/gtk/gtkpasswordentry.c index 8474b52152..d26bf75645 100644 --- a/gtk/gtkpasswordentry.c +++ b/gtk/gtkpasswordentry.c @@ -375,9 +375,8 @@ gtk_password_entry_class_init (GtkPasswordEntryClass *klass) widget_class->measure = gtk_password_entry_measure; widget_class->size_allocate = gtk_password_entry_size_allocate; widget_class->get_accessible = gtk_password_entry_get_accessible; - widget_class->grab_focus = gtk_widget_grab_focus_child; - widget_class->focus = gtk_widget_focus_child; widget_class->mnemonic_activate = gtk_password_entry_mnemonic_activate; + widget_class->grab_focus = gtk_widget_grab_focus_child; props[PROP_PLACEHOLDER_TEXT] = g_param_spec_string ("placeholder-text", diff --git a/gtk/gtkpicture.c b/gtk/gtkpicture.c index 71d322dd9f..401e0a8a07 100644 --- a/gtk/gtkpicture.c +++ b/gtk/gtkpicture.c @@ -301,8 +301,6 @@ gtk_picture_class_init (GtkPictureClass *class) widget_class->snapshot = gtk_picture_snapshot; widget_class->get_request_mode = gtk_picture_get_request_mode; widget_class->measure = gtk_picture_measure; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_none; /** * GtkPicture:paintable: diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c index 7b21e2b725..ccf55e48f3 100644 --- a/gtk/gtkpopover.c +++ b/gtk/gtkpopover.c @@ -1680,8 +1680,6 @@ gtk_popover_class_init (GtkPopoverClass *klass) widget_class->snapshot = gtk_popover_snapshot; widget_class->compute_expand = gtk_popover_compute_expand; widget_class->get_request_mode = gtk_popover_get_request_mode; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_child; klass->activate_default = gtk_popover_activate_default; diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c index 4c7d382751..83f2aeaf89 100644 --- a/gtk/gtkprogressbar.c +++ b/gtk/gtkprogressbar.c @@ -176,8 +176,6 @@ gtk_progress_bar_class_init (GtkProgressBarClass *class) gobject_class->finalize = gtk_progress_bar_finalize; widget_class->direction_changed = gtk_progress_bar_direction_changed; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_none; g_object_class_override_property (gobject_class, PROP_ORIENTATION, "orientation"); diff --git a/gtk/gtkrevealer.c b/gtk/gtkrevealer.c index d325686a39..74fdf52f90 100644 --- a/gtk/gtkrevealer.c +++ b/gtk/gtkrevealer.c @@ -319,8 +319,6 @@ gtk_revealer_class_init (GtkRevealerClass *klass) widget_class->measure = gtk_revealer_measure; widget_class->compute_expand = gtk_revealer_compute_expand; widget_class->get_request_mode = gtk_revealer_get_request_mode; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_child; props[PROP_TRANSITION_TYPE] = g_param_spec_enum ("transition-type", diff --git a/gtk/gtkscrollbar.c b/gtk/gtkscrollbar.c index 66cede913b..ab23a53095 100644 --- a/gtk/gtkscrollbar.c +++ b/gtk/gtkscrollbar.c @@ -196,9 +196,6 @@ gtk_scrollbar_class_init (GtkScrollbarClass *class) object_class->set_property = gtk_scrollbar_set_property; object_class->dispose = gtk_scrollbar_dispose; - widget_class->focus = gtk_widget_focus_none; - widget_class->grab_focus = gtk_widget_grab_focus_none; - props[PROP_ADJUSTMENT] = g_param_spec_object ("adjustment", P_("Adjustment"), diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 90ef269140..5a0e7a4941 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -585,9 +585,8 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class) widget_class->snapshot = gtk_scrolled_window_snapshot; widget_class->size_allocate = gtk_scrolled_window_size_allocate; - widget_class->focus = gtk_scrolled_window_focus; - widget_class->grab_focus = gtk_widget_grab_focus_self; widget_class->measure = gtk_scrolled_window_measure; + widget_class->focus = gtk_scrolled_window_focus; widget_class->map = gtk_scrolled_window_map; widget_class->unmap = gtk_scrolled_window_unmap; widget_class->realize = gtk_scrolled_window_realize; diff --git a/gtk/gtksearchbar.c b/gtk/gtksearchbar.c index a4796fa248..5609f24088 100644 --- a/gtk/gtksearchbar.c +++ b/gtk/gtksearchbar.c @@ -287,8 +287,6 @@ gtk_search_bar_class_init (GtkSearchBarClass *klass) object_class->get_property = gtk_search_bar_get_property; widget_class->compute_expand = gtk_search_bar_compute_expand; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_child; /** * GtkSearchBar:search-mode-enabled: diff --git a/gtk/gtkseparator.c b/gtk/gtkseparator.c index c1cd2e6fa1..59cc5050a0 100644 --- a/gtk/gtkseparator.c +++ b/gtk/gtkseparator.c @@ -132,9 +132,6 @@ gtk_separator_class_init (GtkSeparatorClass *class) object_class->set_property = gtk_separator_set_property; object_class->get_property = gtk_separator_get_property; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_none; - g_object_class_override_property (object_class, PROP_ORIENTATION, "orientation"); gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_SEPARATOR); diff --git a/gtk/gtkshortcutlabel.c b/gtk/gtkshortcutlabel.c index c424c51994..458a091cd2 100644 --- a/gtk/gtkshortcutlabel.c +++ b/gtk/gtkshortcutlabel.c @@ -475,9 +475,6 @@ gtk_shortcut_label_class_init (GtkShortcutLabelClass *klass) object_class->get_property = gtk_shortcut_label_get_property; object_class->set_property = gtk_shortcut_label_set_property; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_none; - /** * GtkShortcutLabel:accelerator: * diff --git a/gtk/gtkshortcutsshortcut.c b/gtk/gtkshortcutsshortcut.c index 9c4b0284ab..eed5b9c369 100644 --- a/gtk/gtkshortcutsshortcut.c +++ b/gtk/gtkshortcutsshortcut.c @@ -548,8 +548,6 @@ gtk_shortcuts_shortcut_class_init (GtkShortcutsShortcutClass *klass) widget_class->measure = gtk_shortcuts_shortcut_measure; widget_class->snapshot = gtk_shortcuts_shortcut_snapshot; widget_class->size_allocate = gtk_shortcuts_shortcut_size_allocate; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_none; /** * GtkShortcutsShortcut:accelerator: diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 43305ae9ce..b159d341e5 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -348,9 +348,9 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class) widget_class->realize = gtk_spin_button_realize; widget_class->grab_notify = gtk_spin_button_grab_notify; widget_class->state_flags_changed = gtk_spin_button_state_flags_changed; + widget_class->mnemonic_activate = gtk_spin_button_mnemonic_activate; widget_class->grab_focus = gtk_spin_button_grab_focus; widget_class->focus = gtk_widget_focus_child; - widget_class->mnemonic_activate = gtk_spin_button_mnemonic_activate; class->input = NULL; class->output = NULL; diff --git a/gtk/gtkspinner.c b/gtk/gtkspinner.c index 55ae28a33d..cb83e568f0 100644 --- a/gtk/gtkspinner.c +++ b/gtk/gtkspinner.c @@ -229,8 +229,6 @@ gtk_spinner_class_init (GtkSpinnerClass *klass) widget_class->snapshot = gtk_spinner_snapshot; widget_class->measure = gtk_spinner_measure; widget_class->css_changed = gtk_spinner_css_changed; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_none; /* GtkSpinner:spinning: * diff --git a/gtk/gtkstacksidebar.c b/gtk/gtkstacksidebar.c index b28ad7c17a..37eccfb7c3 100644 --- a/gtk/gtkstacksidebar.c +++ b/gtk/gtkstacksidebar.c @@ -390,9 +390,6 @@ gtk_stack_sidebar_class_init (GtkStackSidebarClass *klass) object_class->set_property = gtk_stack_sidebar_set_property; object_class->get_property = gtk_stack_sidebar_get_property; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_child; - obj_properties[PROP_STACK] = g_param_spec_object (I_("stack"), P_("Stack"), P_("Associated stack for this GtkStackSidebar"), diff --git a/gtk/gtkstackswitcher.c b/gtk/gtkstackswitcher.c index b8958f4703..29f962b063 100644 --- a/gtk/gtkstackswitcher.c +++ b/gtk/gtkstackswitcher.c @@ -491,9 +491,6 @@ gtk_stack_switcher_class_init (GtkStackSwitcherClass *class) object_class->dispose = gtk_stack_switcher_dispose; object_class->finalize = gtk_stack_switcher_finalize; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_child; - g_object_class_install_property (object_class, PROP_STACK, g_param_spec_object ("stack", diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c index c58406427a..c2c973f7e1 100644 --- a/gtk/gtkstatusbar.c +++ b/gtk/gtkstatusbar.c @@ -156,9 +156,6 @@ gtk_statusbar_class_init (GtkStatusbarClass *class) object_class->dispose = gtk_statusbar_dispose; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_child; - class->text_pushed = gtk_statusbar_update; class->text_popped = gtk_statusbar_update; diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c index 454bbce04a..79f0b5c652 100644 --- a/gtk/gtkswitch.c +++ b/gtk/gtkswitch.c @@ -548,9 +548,6 @@ gtk_switch_class_init (GtkSwitchClass *klass) g_object_class_install_properties (gobject_class, LAST_PROP, switch_props); - widget_class->grab_focus = gtk_widget_grab_focus_self; - widget_class->focus = gtk_widget_focus_self; - klass->activate = gtk_switch_activate; klass->state_set = state_set; diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 9bc7954a4d..ae41f0a520 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -821,8 +821,6 @@ gtk_text_view_class_init (GtkTextViewClass *klass) widget_class->measure = gtk_text_view_measure; widget_class->size_allocate = gtk_text_view_size_allocate; widget_class->snapshot = gtk_text_view_snapshot; - widget_class->grab_focus = gtk_widget_grab_focus_self; - widget_class->focus = gtk_widget_focus_all; container_class->add = gtk_text_view_add; container_class->remove = gtk_text_view_remove; diff --git a/gtk/gtkvideo.c b/gtk/gtkvideo.c index e976928bb7..b02e26128a 100644 --- a/gtk/gtkvideo.c +++ b/gtk/gtkvideo.c @@ -268,8 +268,6 @@ gtk_video_class_init (GtkVideoClass *klass) widget_class->unrealize = gtk_video_unrealize; widget_class->map = gtk_video_map; widget_class->unmap = gtk_video_unmap; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_child; widget_class->grab_notify = gtk_video_grab_notify; gobject_class->dispose = gtk_video_dispose; @@ -342,7 +340,6 @@ static void gtk_video_init (GtkVideo *self) { gtk_widget_init_template (GTK_WIDGET (self)); - } /** diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c index c85f7a5142..72c949ee73 100644 --- a/gtk/gtkviewport.c +++ b/gtk/gtkviewport.c @@ -366,9 +366,6 @@ gtk_viewport_class_init (GtkViewportClass *class) widget_class->unroot = gtk_viewport_unroot; widget_class->compute_expand = gtk_viewport_compute_expand; widget_class->get_request_mode = gtk_viewport_get_request_mode; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_child; - gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_VIEWPORT); diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 95639e7980..a47f05f0c6 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -573,6 +573,8 @@ static void gtk_widget_get_property (GObject *object, static void gtk_widget_dispose (GObject *object); static void gtk_widget_finalize (GObject *object); static void gtk_widget_real_destroy (GtkWidget *object); +static gboolean gtk_widget_real_focus (GtkWidget *widget, + GtkDirectionType direction); static void gtk_widget_real_show (GtkWidget *widget); static void gtk_widget_real_hide (GtkWidget *widget); static void gtk_widget_real_map (GtkWidget *widget); @@ -934,7 +936,7 @@ gtk_widget_class_init (GtkWidgetClass *klass) klass->snapshot = gtk_widget_real_snapshot; klass->mnemonic_activate = gtk_widget_real_mnemonic_activate; klass->grab_focus = gtk_widget_grab_focus_self; - klass->focus = gtk_widget_focus_all; + klass->focus = gtk_widget_real_focus; klass->set_focus_child = gtk_widget_real_set_focus_child; klass->move_focus = gtk_widget_real_move_focus; klass->keynav_failed = gtk_widget_real_keynav_failed; @@ -4778,12 +4780,6 @@ gtk_widget_grab_focus (GtkWidget *widget) } gboolean -gtk_widget_grab_focus_none (GtkWidget *widget) -{ - return FALSE; -} - -gboolean gtk_widget_grab_focus_self (GtkWidget *widget) { GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget); @@ -4943,9 +4939,9 @@ direction_is_forward (GtkDirectionType direction) } } -gboolean -gtk_widget_focus_all (GtkWidget *widget, - GtkDirectionType direction) +static gboolean +gtk_widget_real_focus (GtkWidget *widget, + GtkDirectionType direction) { GtkWidget *focus; @@ -5013,13 +5009,6 @@ gtk_widget_focus_child (GtkWidget *widget, return gtk_widget_focus_move (widget, direction); } -gboolean -gtk_widget_focus_none (GtkWidget *widget, - GtkDirectionType direction) -{ - return FALSE; -} - static void gtk_widget_real_move_focus (GtkWidget *widget, GtkDirectionType direction) diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h index e42969c830..9cb94845ee 100644 --- a/gtk/gtkwidgetprivate.h +++ b/gtk/gtkwidgetprivate.h @@ -357,10 +357,6 @@ guint gtk_widget_add_surface_transform_changed_callback (GtkWidget void gtk_widget_remove_surface_transform_changed_callback (GtkWidget *widget, guint id); -/* focus vfuncs for non-focusable non-containers */ -gboolean gtk_widget_grab_focus_none (GtkWidget *widget); -gboolean gtk_widget_focus_none (GtkWidget *widget, - GtkDirectionType direction); /* focus vfuncs for non-focusable containers with focusable children */ gboolean gtk_widget_grab_focus_child (GtkWidget *widget); gboolean gtk_widget_focus_child (GtkWidget *widget, @@ -369,9 +365,6 @@ gboolean gtk_widget_focus_child (GtkWidget *widget, gboolean gtk_widget_grab_focus_self (GtkWidget *widget); gboolean gtk_widget_focus_self (GtkWidget *widget, GtkDirectionType direction); -/* focus vfuncs for focusable widgets with children that receive focus */ -gboolean gtk_widget_focus_all (GtkWidget *widget, - GtkDirectionType direction); /* inline getters */ diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 07bf4d8103..fc949183cc 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -757,7 +757,6 @@ gtk_window_class_init (GtkWindowClass *klass) widget_class->compute_expand = gtk_window_compute_expand; widget_class->get_request_mode = gtk_window_get_request_mode; widget_class->focus = gtk_window_focus; - widget_class->grab_focus = gtk_widget_grab_focus_none; widget_class->move_focus = gtk_window_move_focus; widget_class->state_flags_changed = gtk_window_state_flags_changed; widget_class->css_changed = gtk_window_css_changed; diff --git a/gtk/gtkwindowhandle.c b/gtk/gtkwindowhandle.c index e2817a235a..18a2d4f12e 100644 --- a/gtk/gtkwindowhandle.c +++ b/gtk/gtkwindowhandle.c @@ -572,8 +572,6 @@ gtk_window_handle_class_init (GtkWindowHandleClass *klass) object_class->set_property = gtk_window_handle_set_property; widget_class->unrealize = gtk_window_handle_unrealize; - widget_class->grab_focus = gtk_widget_grab_focus_none; - widget_class->focus = gtk_widget_focus_child; props[PROP_CHILD] = g_param_spec_object ("child", |