GNOME Bugzilla – Bug 601693
Shouldn't cycle tab if gtk-keynav-wrap-around is 0
Last modified: 2010-03-17 09:21:48 UTC
As said on bug #589263, we shouldn't cycle tabs if this option is disabled.
This is a perfect bug for a new contributor.
I'd love to give it a go, would you have any tips on where to start looking? Were menu_tabs_[next, prev] along the right lines?
Hi Aaron, Code is in src/empathy-chat-window.c in 2 functions: chat_window_tabs_next_activate_cb and chat_window_tabs_previous_activate_cb. You should use GtkSettings API to check if the gtk-keynav-wrap-around is 0 and don't cycle in that case.
Created attachment 156256 [details] [review] Proposed patch Patch of src/empathy-chat-window.c only (no ChangeLog entry, will repatch including one if requested)
Review of attachment 156256 [details] [review]: Thanks a lot for your patch. Don't worry about ChangeLog entry, we don't use it anymore, it's automatically generated from the git history. I inlined some minor style comments. ::: src/empathy-chat-window.c @@ +1028,3 @@ EmpathyChat *chat; gint index_, numPages; + gboolean *wrapAround; We use this_style for variables. @@ +1032,3 @@ priv = GET_PRIV (window); + g_object_get (gtk_settings_get_default (), "gtk-keynav-wrap-around", &wrapAround, NULL); This line is longer than 80 chars, you should wrap it. @@ +1053,3 @@ EmpathyChat *chat; gint index_, numPages; + gboolean wrap_around; this one is not tab-aligned @@ +1057,3 @@ priv = GET_PRIV (window); + g_object_get (gtk_settings_get_default (), "gtk-keynav-wrap-around", &wrap_around, NULL); same problem about the length. @@ +1082,3 @@ priv = GET_PRIV (window); + g_object_get (gtk_settings_get_default (), "gtk-keynav-wrap-around", &wrap_around, NULL); here too.
Created attachment 156308 [details] [review] corrected patch
I'm glad you picked up on those mistakes, I was adamant I had changed all my wrapAround variables to wrap_around which highlighted the fact that I'd unnecessarily changed chat_window_tabs_left_activate_cb. I'll submit a corrected patch.
Merged, thanks a lot for your patch!