[Commits] [SCM] claws branch, master, updated. 3.13.2-191-g96ca00e

ticho at claws-mail.org ticho at claws-mail.org
Thu Jul 21 12:12:59 CEST 2016


The branch, master has been updated
       via  96ca00e6bc56bacf13d9e492f109875d6ecb046b (commit)
      from  4306c9eaa2f13d2fe56938f66b40e5a187242821 (commit)

Summary of changes:
 src/folderview.c  |    6 ++++++
 src/folderview.h  |    1 +
 src/main.c        |    4 ++--
 src/mainwindow.c  |    4 ++--
 src/summaryview.c |    8 ++++----
 src/toolbar.c     |    2 +-
 6 files changed, 16 insertions(+), 9 deletions(-)


- Log -----------------------------------------------------------------
commit 96ca00e6bc56bacf13d9e492f109875d6ecb046b
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Jul 21 12:12:40 2016 +0200

    Use folderview_grab_focus() outside of folderview.c.

diff --git a/src/folderview.c b/src/folderview.c
index 055ca5b..92dc6cc 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -3184,3 +3184,9 @@ void folderview_thaw(FolderView *folderview)
 	if (folderview)
 		gtk_cmclist_thaw(GTK_CMCLIST(folderview->ctree));
 }
+
+void folderview_grab_focus(FolderView *folderview)
+{
+	 if (folderview)
+		 gtk_widget_grab_focus(folderview->ctree);
+}
diff --git a/src/folderview.h b/src/folderview.h
index a53c051..b7cc432 100644
--- a/src/folderview.h
+++ b/src/folderview.h
@@ -150,5 +150,6 @@ void folderview_close_opened		(FolderView 		*folderview);
 
 void folderview_freeze(FolderView *folderview);
 void folderview_thaw(FolderView *folderview);
+void folderview_grab_focus(FolderView *folderview);
 
 #endif /* __FOLDERVIEW_H__ */
diff --git a/src/main.c b/src/main.c
index 15b479f..987bc68 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1535,8 +1535,8 @@ int main(int argc, char *argv[])
 	} else if (cmd.receive && !cmd.target) {
 		start_done = FALSE;
 		g_timeout_add(1000, defer_check, NULL);
-	} 
-	gtk_widget_grab_focus(folderview->ctree);
+	}
+	folderview_grab_focus(folderview);
 
 	if (cmd.compose) {
 		open_compose_new(cmd.compose_mailto, cmd.attach_files);
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 399067e..71e0320 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -2922,7 +2922,7 @@ gboolean main_window_empty_trash(MainWindow *mainwin, gboolean confirm, gboolean
 
 	if (mainwin->summaryview->folder_item &&
 	    mainwin->summaryview->folder_item->stype == F_TRASH)
-		gtk_widget_grab_focus(mainwin->folderview->ctree);
+		folderview_grab_focus(mainwin->folderview);
 	return TRUE;
 }
 
@@ -5441,7 +5441,7 @@ void mainwindow_exit_folder(MainWindow *mainwin) {
 	if (prefs_common.layout_mode == SMALL_LAYOUT) {
 		folderview_close_opened(mainwin->folderview);
 		mainwin_paned_show_first(GTK_PANED(mainwin->hpaned));
-		gtk_widget_grab_focus(mainwin->folderview->ctree);
+		folderview_grab_focus(mainwin->folderview);
 	}
 	mainwin->in_folder = FALSE;
 	main_window_set_menu_sensitive(mainwin);
diff --git a/src/summaryview.c b/src/summaryview.c
index 7abda57..b9e75ca 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -4979,7 +4979,7 @@ gboolean summary_execute(SummaryView *summaryview)
 	if (!GTK_CMCLIST(summaryview->ctree)->row_list) {
 		menu_set_insensitive_all
 			(GTK_MENU_SHELL(summaryview->popupmenu));
-		gtk_widget_grab_focus(summaryview->folderview->ctree);
+		folderview_grab_focus(summaryview->folderview);
 	} else {
 		menu_set_sensitive_all(GTK_MENU_SHELL(summaryview->popupmenu), TRUE);
 		gtk_widget_grab_focus(summaryview->ctree);
@@ -5080,7 +5080,7 @@ gboolean summary_expunge(SummaryView *summaryview)
 	if (!GTK_CMCLIST(summaryview->ctree)->row_list) {
 		menu_set_insensitive_all
 			(GTK_MENU_SHELL(summaryview->popupmenu));
-		gtk_widget_grab_focus(summaryview->folderview->ctree);
+		folderview_grab_focus(summaryview->folderview);
 	} else {
 		menu_set_sensitive_all(GTK_MENU_SHELL(summaryview->popupmenu), TRUE);
 		gtk_widget_grab_focus(summaryview->ctree);
@@ -6604,7 +6604,7 @@ static gint summary_folder_eventbox_pressed(GtkWidget *eventbox, GdkEventButton
 					    SummaryView *summaryview)
 {
 	if (event) {
-		gtk_widget_grab_focus(summaryview->folderview->ctree);
+		folderview_grab_focus(summaryview->folderview);
 		mainwindow_exit_folder(summaryview->mainwin);
 	}
 	return TRUE;
@@ -6750,7 +6750,7 @@ static gboolean summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
 			break;
 		/* FALLTHROUGH */	
 	case GDK_KEY_Escape:
-		gtk_widget_grab_focus(summaryview->folderview->ctree);
+		folderview_grab_focus(summaryview->folderview);
 		mainwindow_exit_folder(summaryview->mainwin);
 		return TRUE;
 	case GDK_KEY_Home: case GDK_KEY_KP_Home:
diff --git a/src/toolbar.c b/src/toolbar.c
index 697c2f9..ee98c9e 100644
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -1705,7 +1705,7 @@ static void toolbar_go_folders_cb(GtkWidget *widget, gpointer data)
 			folderview_select(mainwin->folderview, item);
 		}
 	} else {
-		gtk_widget_grab_focus(mainwin->folderview->ctree);
+		folderview_grab_focus(mainwin->folderview);
 		mainwindow_exit_folder(mainwin);
 	}
 }

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list