[Commits] [SCM] claws branch, gtk3, updated. 3.16.0-83-gc00851f

ticho at claws-mail.org ticho at claws-mail.org
Thu Feb 15 18:46:14 CET 2018


The branch, gtk3 has been updated
       via  c00851f6dd8e3e4beb363d4c7504bf90e46ea7e2 (commit)
      from  44a06b793270ab026289759ae56ffa3a76a54a53 (commit)

Summary of changes:
 src/edittags.c                           |    3 ++-
 src/grouplistdialog.c                    |    5 +++--
 src/gtk/about.c                          |    6 ++++--
 src/gtk/gtkutils.c                       |    3 ++-
 src/gtk/gtkvscrollbutton.c               |    3 ++-
 src/mainwindow.c                         |    6 ++++--
 src/mimeview.c                           |    3 ++-
 src/noticeview.c                         |   29 ++++++++++++++++++++++-------
 src/plugins/pdf_viewer/poppler_viewer.c  |    6 ++++--
 src/plugins/vcalendar/vcal_meeting_gtk.c |   22 +++++++++++++++++-----
 src/summary_search.c                     |    3 ++-
 src/textview.c                           |    9 ++++++---
 12 files changed, 70 insertions(+), 28 deletions(-)


- Log -----------------------------------------------------------------
commit c00851f6dd8e3e4beb363d4c7504bf90e46ea7e2
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Feb 15 18:46:01 2018 +0100

    Get rid of deprecated gtk_cursor_new().

diff --git a/src/edittags.c b/src/edittags.c
index 1209dd0..4b0fa9f 100644
--- a/src/edittags.c
+++ b/src/edittags.c
@@ -607,7 +607,8 @@ static void apply_window_create(void)
 	applywindow.add_btn = add_btn;
 	applywindow.add_entry = new_tag_entry;
 	applywindow.has_tag_col = FALSE;
-	applywindow.watch_cursor = gdk_cursor_new(GDK_WATCH);
+	applywindow.watch_cursor = gdk_cursor_new_for_display(
+			gtk_widget_get_display(window), GDK_WATCH);
 }
 
 static void apply_window_list_view_clear_tags(GtkWidget *list_view)
diff --git a/src/grouplistdialog.c b/src/grouplistdialog.c
index 5e9776e..a6d32a3 100644
--- a/src/grouplistdialog.c
+++ b/src/grouplistdialog.c
@@ -415,9 +415,10 @@ static void grouplist_dialog_set_list(const gchar *pattern, gboolean refresh)
 	if (!pattern || *pattern == '\0')
 		pattern = "*";
 
-	if (!watch_cursor)
-		watch_cursor = gdk_cursor_new(GDK_WATCH);
 	window = gtk_widget_get_window(dialog);
+	if (!watch_cursor)
+		watch_cursor = gdk_cursor_new_for_display(
+				gdk_window_get_display(window), GDK_WATCH);
 	gdk_window_set_cursor(window, watch_cursor);
 	main_window_cursor_wait(mainwindow_get_mainwindow());
 	GTK_EVENTS_FLUSH();
diff --git a/src/gtk/about.c b/src/gtk/about.c
index 5ad56a4..38933db 100644
--- a/src/gtk/about.c
+++ b/src/gtk/about.c
@@ -1087,9 +1087,11 @@ static void about_textview_uri_update(GtkWidget *textview, gint x, gint y)
 		window = gtk_text_view_get_window(GTK_TEXT_VIEW(textview),
 						GTK_TEXT_WINDOW_TEXT);
 		if (!hand_cursor)
-			hand_cursor = gdk_cursor_new(GDK_HAND2);
+			hand_cursor = gdk_cursor_new_for_display(
+					gdk_window_get_display(window), GDK_HAND2);
 		if (!text_cursor)
-			text_cursor = gdk_cursor_new(GDK_XTERM);
+			text_cursor = gdk_cursor_new_for_display(
+					gdk_window_get_display(window), GDK_XTERM);
 		gdk_window_set_cursor(window, uri ? hand_cursor : text_cursor);
 	}
 }
diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c
index a628eda..98deab3 100644
--- a/src/gtk/gtkutils.c
+++ b/src/gtk/gtkutils.c
@@ -1169,7 +1169,8 @@ static void link_btn_enter(GtkButton *button, gpointer data)
 	gdkwin = gtk_widget_get_window(window);
 
 	if (!hand_cursor)
-		hand_cursor = gdk_cursor_new(GDK_HAND2);
+		hand_cursor = gdk_cursor_new_for_display(
+				gdk_window_get_display(gdkwin), GDK_HAND2);
 	if (window && gdkwin)
 		gdk_window_set_cursor(gdkwin, hand_cursor);
 
diff --git a/src/gtk/gtkvscrollbutton.c b/src/gtk/gtkvscrollbutton.c
index 6d18715..3df2b5c 100644
--- a/src/gtk/gtkvscrollbutton.c
+++ b/src/gtk/gtkvscrollbutton.c
@@ -146,7 +146,8 @@ static void gtk_vscrollbutton_init(GtkVScrollbutton *scrollbutton)
     GtkWidget *arrow;
 
     if (!hand_cursor)
-	    hand_cursor = gdk_cursor_new(GDK_HAND2);
+	    hand_cursor = gdk_cursor_new_for_display(
+					gtk_widget_get_display(GTK_WIDGET(scrollbutton)),GDK_HAND2);
 
     scrollbutton->upbutton = gtk_event_box_new();
     scrollbutton->downbutton = gtk_event_box_new();
diff --git a/src/mainwindow.c b/src/mainwindow.c
index e312068..f73a257 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -2212,9 +2212,11 @@ MainWindow *main_window_create()
 		hooks_register_hook(PROGRESSINDICATOR_HOOKLIST, mainwindow_progressindicator_hook, mainwin);
 
 	if (!watch_cursor)
-		watch_cursor = gdk_cursor_new(GDK_WATCH);
+		watch_cursor = gdk_cursor_new_for_display(
+				gtk_widget_get_display(mainwin->window), GDK_WATCH);
 	if (!hand_cursor)
-		hand_cursor = gdk_cursor_new(GDK_HAND2);
+		hand_cursor = gdk_cursor_new_for_display(
+				gtk_widget_get_display(mainwin->window), GDK_HAND2);
 
 	/* init work_offline */
 	if (prefs_common.work_offline)
diff --git a/src/mimeview.c b/src/mimeview.c
index a065624..7201ac9 100644
--- a/src/mimeview.c
+++ b/src/mimeview.c
@@ -264,7 +264,8 @@ MimeView *mimeview_create(MainWindow *mainwin)
 	gint cols;
 
 	if (!hand_cursor)
-		hand_cursor = gdk_cursor_new(GDK_HAND2);
+		hand_cursor = gdk_cursor_new_for_display(
+				gtk_widget_get_display(mainwin->window), GDK_HAND2);
 
 	debug_print("Creating MIME view...\n");
 	mimeview = g_new0(MimeView, 1);
diff --git a/src/noticeview.c b/src/noticeview.c
index 290833d..edea73f 100644
--- a/src/noticeview.c
+++ b/src/noticeview.c
@@ -58,6 +58,16 @@ static gboolean noticeview_enter_notify(GtkWidget *widget,
 
 static GdkCursor *hand_cursor = NULL;
 
+static void set_hand_cursor(GdkWindow *window)
+{
+	cm_return_if_fail(window != NULL);
+
+	if (!hand_cursor) {
+		hand_cursor = gdk_cursor_new_for_display(
+				gdk_window_get_display(window), GDK_HAND2);
+	}
+}
+
 NoticeView *noticeview_create(MainWindow *mainwin)
 {
 	NoticeView *noticeview;
@@ -73,9 +83,6 @@ NoticeView *noticeview_create(MainWindow *mainwin)
 	debug_print("Creating notice view...\n");
 	noticeview = g_new0(NoticeView, 1);
 
-	if (!hand_cursor)
-		hand_cursor = gdk_cursor_new(GDK_HAND2);
-
 	noticeview->window = mainwin->window;
 	
 	vbox = gtk_vbox_new(FALSE, 4);
@@ -213,8 +220,12 @@ static gboolean noticeview_visi_notify(GtkWidget *widget,
 				       GdkEventVisibility *event,
 				       NoticeView *noticeview)
 {
-	if (noticeview->icon_clickable)
-		gdk_window_set_cursor(gtk_widget_get_window(noticeview->evtbox), hand_cursor);
+	GdkWindow *window = gtk_widget_get_window(noticeview->evtbox);
+
+	if (noticeview->icon_clickable) {
+		set_hand_cursor(window);
+		gdk_window_set_cursor(window, hand_cursor);
+	}
 	return FALSE;
 }
 
@@ -230,8 +241,12 @@ static gboolean noticeview_enter_notify(GtkWidget *widget,
 				      GdkEventCrossing *event,
 				      NoticeView *noticeview)
 {
-	if (noticeview->icon_clickable)
-		gdk_window_set_cursor(gtk_widget_get_window(noticeview->evtbox), hand_cursor);
+	GdkWindow *window = gtk_widget_get_window(noticeview->evtbox);
+
+	if (noticeview->icon_clickable) {
+		set_hand_cursor(window);
+		gdk_window_set_cursor(window, hand_cursor);
+	}
 	return FALSE;
 }
 
diff --git a/src/plugins/pdf_viewer/poppler_viewer.c b/src/plugins/pdf_viewer/poppler_viewer.c
index fc6580c..d04ee49 100644
--- a/src/plugins/pdf_viewer/poppler_viewer.c
+++ b/src/plugins/pdf_viewer/poppler_viewer.c
@@ -821,7 +821,8 @@ static void pdf_viewer_button_press_events_cb(GtkWidget *widget, GdkEventButton
 	#endif
 	static GdkCursor *hand_cur = NULL;
 
-	if (!hand_cur) hand_cur = gdk_cursor_new(GDK_FLEUR);
+	if (!hand_cur) hand_cur = gdk_cursor_new_for_display(
+			gtk_widget_get_display(widget), GDK_FLEUR);
 
 	/* Execute Poppler Links */
 	if (event->button == 1 && viewer->in_link) {
@@ -1015,7 +1016,8 @@ static void pdf_viewer_move_events_cb(GtkWidget *widget, GdkEventMotion *event,
 	viewer->pdf_view_vadj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(viewer->scrollwin));
 	viewer->pdf_view_hadj = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(viewer->scrollwin));
 
-	if (!link_cur) link_cur = gdk_cursor_new(GDK_HAND2);
+	if (!link_cur) link_cur = gdk_cursor_new_for_display(
+			gtk_widget_get_display(viewer->scrollwin), GDK_HAND2);
 
 	ccur = FALSE;
 	viewer->in_link = FALSE;	
diff --git a/src/plugins/vcalendar/vcal_meeting_gtk.c b/src/plugins/vcalendar/vcal_meeting_gtk.c
index 967ac8c..75820b9 100644
--- a/src/plugins/vcalendar/vcal_meeting_gtk.c
+++ b/src/plugins/vcalendar/vcal_meeting_gtk.c
@@ -253,6 +253,16 @@ static gint get_dtdate(const gchar *str, gint field)
 
 }
 
+static void set_watch_cursor(GdkWindow *window)
+{
+	cm_return_if_fail(window != NULL);
+
+	if (!watch_cursor)
+		watch_cursor = gdk_cursor_new_for_display(
+				gdk_window_get_display(window), GDK_WATCH);
+}
+
+
 static gboolean add_btn_cb(GtkButton *widget, gpointer data)
 {
 	VCalAttendee *attendee = (VCalAttendee *)data;
@@ -1059,8 +1069,10 @@ static gboolean check_attendees_availability(VCalMeeting *meet, gboolean tell_if
 	gtk_widget_set_sensitive(meet->avail_btn, FALSE);
 
 	gdkwin = gtk_widget_get_window(meet->window);
-	if (gdkwin != NULL)
+	if (gdkwin != NULL) {
+		set_watch_cursor(gdkwin);
 		gdk_window_set_cursor(gdkwin, watch_cursor);
+	}
 
 	for (cur = attlist; cur && cur->data; cur = cur->next) {
 		VCalAttendee *attendee = (VCalAttendee *)cur->data;
@@ -1248,8 +1260,10 @@ static gboolean send_meeting_cb(GtkButton *widget, gpointer data)
 	gtk_widget_set_sensitive(meet->avail_btn, FALSE);
 
 	gdkwin = gtk_widget_get_window(meet->window);
-	if (gdkwin != NULL)
+	if (gdkwin != NULL) {
+		set_watch_cursor(gdkwin);
 		gdk_window_set_cursor(gdkwin, watch_cursor);
+	}
 
 	organizer	= get_organizer(meet);
 	account		= account_find_from_address(organizer, FALSE);
@@ -1387,9 +1401,6 @@ static VCalMeeting *vcal_meeting_create_real(VCalEvent *event, gboolean visible)
 	GtkWidget *maemo_vbox0;
 #endif
 
-	if (!watch_cursor)
-		watch_cursor = gdk_cursor_new(GDK_WATCH);
-
 	meet->visible = visible;
 
 	meet->window 		= gtkut_window_new(GTK_WINDOW_TOPLEVEL, "vcal_meeting_gtk");
@@ -1740,6 +1751,7 @@ static VCalMeeting *vcal_meeting_create_real(VCalEvent *event, gboolean visible)
 		gtk_widget_hide(meet->total_avail_img);
 		gtk_widget_set_sensitive(meet->avail_btn, avail_btn_can_be_sensitive());
 	}
+
 	return meet;
 }
 
diff --git a/src/summary_search.c b/src/summary_search.c
index 9d05951..0dbf056 100644
--- a/src/summary_search.c
+++ b/src/summary_search.c
@@ -684,7 +684,8 @@ static gboolean summary_search_prereduce_msg_list()
 	FolderItem *item = summaryview->folder_item;
 	static GdkCursor *watch_cursor = NULL;
 	if (!watch_cursor)
-		watch_cursor = gdk_cursor_new(GDK_WATCH);
+		watch_cursor = gdk_cursor_new_for_display(
+				gtk_widget_get_display(summaryview->scrolledwin), GDK_WATCH);
 
 	if (search_window.matcher_is_outdated && !summary_search_prepare_matcher())
 		return FALSE;
diff --git a/src/textview.c b/src/textview.c
index e652a5e..f0f54a7 100644
--- a/src/textview.c
+++ b/src/textview.c
@@ -532,11 +532,14 @@ static void textview_create_tags(GtkTextView *text, TextView *textview)
 void textview_init(TextView *textview)
 {
 	if (!hand_cursor)
-		hand_cursor = gdk_cursor_new(GDK_HAND2);
+		hand_cursor = gdk_cursor_new_for_display(
+				gtk_widget_get_display(textview->vbox), GDK_HAND2);
 	if (!text_cursor)
-		text_cursor = gdk_cursor_new(GDK_XTERM);
+		text_cursor = gdk_cursor_new_for_display(
+				gtk_widget_get_display(textview->vbox), GDK_XTERM);
 	if (!watch_cursor)
-		watch_cursor = gdk_cursor_new(GDK_WATCH);
+		watch_cursor = gdk_cursor_new_for_display(
+				gtk_widget_get_display(textview->vbox), GDK_WATCH);
 
 	textview_reflect_prefs(textview);
 	textview_set_font(textview, NULL);

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list