[gitg: 5/36] focus: Don't change selection on focus in



commit bb1b6ef425d17bb95de0127b6f3e1470c0303b68
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Dec 10 16:47:01 2012 +0100

    focus: Don't change selection on focus in
    
    We can pick different default initial focus depending on the tab direction
    when focus goes into the widget, but we should always start with the
    currently selected row if any.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=689060

 egg-list-box.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/egg-list-box.c b/egg-list-box.c
index 79c43a2..b75b5be 100644
--- a/egg-list-box.c
+++ b/egg-list-box.c
@@ -967,13 +967,11 @@ egg_list_box_real_focus (GtkWidget* widget, GtkDirectionType direction)
        {
          switch (direction)
            {
-           case GTK_DIR_DOWN:
-           case GTK_DIR_TAB_FORWARD:
-             next_focus_child = egg_list_box_get_first_visible (list_box);
-             break;
            case GTK_DIR_UP:
            case GTK_DIR_TAB_BACKWARD:
-             next_focus_child = egg_list_box_get_last_visible (list_box);
+             next_focus_child = priv->selected_child;
+             if (next_focus_child == NULL)
+               next_focus_child = egg_list_box_get_last_visible (list_box);
              break;
            default:
              next_focus_child = priv->selected_child;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]