[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-43-g5e237aee3

paul at claws-mail.org paul at claws-mail.org
Wed Aug 11 08:43:46 UTC 2021


The branch, gtk3 has been updated
       via  5e237aee3c9075b0a68003cc753ecf74233747f7 (commit)
      from  b8e35947d41d3c8d3613ff2e6c61b641d194ce8b (commit)

Summary of changes:
 src/addr_compl.c      |  7 ++++++-
 src/alertpanel.c      | 13 ++++++++++---
 src/compose.c         |  8 ++++++--
 src/folderview.c      | 13 ++++++++++---
 src/gtk/gtkutils.c    | 18 ++++++++++++------
 src/gtk/prefswindow.c | 14 ++++++++++----
 src/mainwindow.c      | 11 +++++++++--
 src/prefs_themes.c    | 14 +++++++++-----
 src/summaryview.c     |  8 ++++++--
 9 files changed, 78 insertions(+), 28 deletions(-)


- Log -----------------------------------------------------------------
commit 5e237aee3c9075b0a68003cc753ecf74233747f7
Author: paul <paul at claws-mail.org>
Date:   Wed Aug 11 09:43:42 2021 +0100

    replace some deprecated functions

diff --git a/src/addr_compl.c b/src/addr_compl.c
index 69fd70208..0d0bb9d97 100644
--- a/src/addr_compl.c
+++ b/src/addr_compl.c
@@ -866,6 +866,11 @@ static CompletionWindow *addrcompl_create_window( void ) {
  * \param cw Window to destroy.
  */
 static void addrcompl_destroy_window( CompletionWindow *cw ) {
+	GdkDisplay *display;
+	GdkSeat    *seat;
+	
+	display = gdk_display_get_default();
+	seat = gdk_display_get_default_seat(display);
 	/* Stop all searches currently in progress */
 #ifndef USE_ALT_ADDRBOOK
 	addrindex_stop_search( _queryID_ );
@@ -893,7 +898,7 @@ static void addrcompl_destroy_window( CompletionWindow *cw ) {
 	}
 	
 	/* Re-enable keyboard, required at least for Gtk3/Win32 */
-	gdk_keyboard_ungrab(GDK_CURRENT_TIME);
+	gdk_seat_ungrab(seat);
 }
 
 /**
diff --git a/src/alertpanel.c b/src/alertpanel.c
index defaa4897..25aed10d8 100644
--- a/src/alertpanel.c
+++ b/src/alertpanel.c
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2020 the Claws Mail team and Hiroyuki Yamamoto
+ * Copyright (C) 1999-2021 the Claws Mail team and Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -201,13 +201,20 @@ void alertpanel_error_log(const gchar *format, ...)
 
 static void alertpanel_show(void)
 {
+	GdkDisplay *display;
+	GdkSeat    *seat;
+	GdkDevice  *device;
 	gtk_window_set_modal(GTK_WINDOW(window), TRUE);
 	manage_window_set_transient(GTK_WINDOW(window));
 	gtk_widget_show_all(window);
 	value = G_ALERTWAIT;
+	
+	display = gdk_display_get_default();
+	seat = gdk_display_get_default_seat(display);
+	device = gdk_seat_get_pointer(seat);
 
-	if (gdk_pointer_is_grabbed())
-		gdk_pointer_ungrab(GDK_CURRENT_TIME);
+	if (gdk_display_device_is_grabbed(display, device))
+		gdk_seat_ungrab(seat);
 	inc_lock();
 	while ((value & G_ALERT_VALUE_MASK) == G_ALERTWAIT)
 		gtk_main_iteration();
diff --git a/src/compose.c b/src/compose.c
index d3482763d..6b32f89d4 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -7754,6 +7754,7 @@ static Compose *compose_create(PrefsAccount *account,
 #endif
 
 	static GdkGeometry geometry;
+	GdkRectangle workarea = {0};
 
 	cm_return_val_if_fail(account != NULL, NULL);
 
@@ -7776,9 +7777,12 @@ static Compose *compose_create(PrefsAccount *account,
 	gtk_window_set_default_size(GTK_WINDOW(window), prefs_common.compose_width,
 				    prefs_common.compose_height);
 
+	gdk_monitor_get_workarea(gdk_display_get_primary_monitor(gdk_display_get_default()),
+				 &workarea);
+
 	if (!geometry.max_width) {
-		geometry.max_width = gdk_screen_width();
-		geometry.max_height = gdk_screen_height();
+		geometry.max_width = workarea.width;
+		geometry.max_height = workarea.height;
 	}
 
 	gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL,
diff --git a/src/folderview.c b/src/folderview.c
index dc5736988..9b2e364e9 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2019 the Claws Mail team and Hiroyuki Yamamoto
+ * Copyright (C) 1999-2021 the Claws Mail team and Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -2248,6 +2248,9 @@ void folderview_close_opened(FolderView *folderview, gboolean dirty)
 static void folderview_selected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
 				gint column, FolderView *folderview)
 {
+	GdkDisplay *display;
+	GdkSeat    *seat;
+	GdkDevice  *device;
 	static gboolean can_select = TRUE;	/* exclusive lock */
 	gboolean opened;
 	FolderItem *item;
@@ -2256,6 +2259,10 @@ static void folderview_selected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
 	GtkCMCTreeNode *old_opened = folderview->opened;
 	START_TIMING("");
 	folderview->selected = row;
+	
+	display = gdk_display_get_default();
+	seat = gdk_display_get_default_seat(display);
+	device = gdk_seat_get_pointer(seat);
 
 	debug_print("newly selected %p, opened %p\n", folderview->selected, 
 			folderview->opened);
@@ -2311,8 +2318,8 @@ static void folderview_selected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
 	/* ungrab the mouse event */
 	if (gtk_widget_has_grab(GTK_WIDGET(ctree))) {
 		gtk_grab_remove(GTK_WIDGET(ctree));
-		if (gdk_pointer_is_grabbed())
-			gdk_pointer_ungrab(GDK_CURRENT_TIME);
+		if (gdk_display_device_is_grabbed(display, device))
+			gdk_seat_ungrab(seat);
 	}
 
 	/* Open Folder */
diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c
index 8607aef8a..3512e97cd 100644
--- a/src/gtk/gtkutils.c
+++ b/src/gtk/gtkutils.c
@@ -593,14 +593,18 @@ void gtkut_window_popup(GtkWidget *window)
 {
 	GdkWindow *gdkwin;
 	gint x, y, sx, sy, new_x, new_y;
+	GdkRectangle workarea = {0};
 
 	gdkwin = gtk_widget_get_window(window);
 
 	cm_return_if_fail(window != NULL);
 	cm_return_if_fail(gdkwin != NULL);
 
-	sx = gdk_screen_width();
-	sy = gdk_screen_height();
+	gdk_monitor_get_workarea(gdk_display_get_primary_monitor(gdk_display_get_default()),
+				 &workarea);
+
+	sx = workarea.width;
+	sy = workarea.height;
 
 	gdk_window_get_origin(gdkwin, &x, &y);
 	new_x = x % sx; if (new_x < 0) new_x = 0;
@@ -617,14 +621,18 @@ void gtkut_widget_get_uposition(GtkWidget *widget, gint *px, gint *py)
 	GdkWindow *gdkwin;
 	gint x, y;
 	gint sx, sy;
+	GdkRectangle workarea = {0};
 
 	gdkwin = gtk_widget_get_window(widget);
 
 	cm_return_if_fail(widget != NULL);
 	cm_return_if_fail(gdkwin != NULL);
 
-	sx = gdk_screen_width();
-	sy = gdk_screen_height();
+	gdk_monitor_get_workarea(gdk_display_get_primary_monitor(gdk_display_get_default()),
+				 &workarea);
+
+	sx = workarea.width;
+	sy = workarea.height;
 
 	/* gdk_window_get_root_origin ever return *rootwindow*'s position */
 	gdk_window_get_root_origin(gdkwin, &x, &y);
@@ -926,7 +934,6 @@ GtkWidget *gtkut_get_replace_btn(const gchar *button_label)
 GtkWidget *gtkut_stock_button(const gchar *stock_image, const gchar *label)
 {
 	GtkWidget *button;
-	gint i;
 	
 	cm_return_val_if_fail(stock_image != NULL, NULL);
 
@@ -934,7 +941,6 @@ GtkWidget *gtkut_stock_button(const gchar *stock_image, const gchar *label)
 	if (label != NULL)
 		gtk_button_set_label(GTK_BUTTON(button), _(label));
 	gtk_button_set_use_underline(GTK_BUTTON(button), TRUE);
-	gtk_button_set_use_stock(GTK_BUTTON(button), TRUE);
 	gtk_button_set_always_show_image(GTK_BUTTON(button), TRUE);
 	
 	return button;
diff --git a/src/gtk/prefswindow.c b/src/gtk/prefswindow.c
index f95794998..665035ad5 100644
--- a/src/gtk/prefswindow.c
+++ b/src/gtk/prefswindow.c
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2019 the Claws Mail Team and Hiroyuki Yamamoto
+ * Copyright (C) 1999-2021 the Claws Mail Team and Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -400,10 +400,11 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
 							 PrefsCloseCallbackFunc close_cb)
 {
 	PrefsWindow *prefswindow;
-	gint x = gdk_screen_width();
-	gint y = gdk_screen_height();
+	gint x;
+	gint y;
 	static GdkGeometry geometry;
 	GtkAdjustment *adj;
+	GdkRectangle workarea = {0};
 
 	prefswindow = g_new0(PrefsWindow, 1);
 
@@ -541,7 +542,12 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
 	}
 
 	MANAGE_WINDOW_SIGNALS_CONNECT(prefswindow->window);
-
+	
+	gdk_monitor_get_workarea(gdk_display_get_primary_monitor(gdk_display_get_default()),
+				 &workarea);
+	x =  workarea.width;
+	y =  workarea.height;
+	
 	if (!geometry.min_height) {
 		
 		if (x < 800 && y < 600) {
diff --git a/src/mainwindow.c b/src/mainwindow.c
index f7a1f6996..d8d0388de 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -2205,6 +2205,9 @@ void main_window_update_actions_menu(MainWindow *mainwin)
 
 void main_window_cursor_wait(MainWindow *mainwin)
 {
+	GdkDisplay *display;
+
+	display = gdk_display_get_default();
 
 	if (mainwin->cursor_count == 0) {
 		gdk_window_set_cursor(gtk_widget_get_window(mainwin->window), watch_cursor);
@@ -2213,11 +2216,15 @@ void main_window_cursor_wait(MainWindow *mainwin)
 	
 	mainwin->cursor_count++;
 
-	gdk_flush();
+	gdk_display_flush(display);
 }
 
 void main_window_cursor_normal(MainWindow *mainwin)
 {
+	GdkDisplay *display;
+
+	display = gdk_display_get_default();
+
 	if (mainwin->cursor_count)
 		mainwin->cursor_count--;
 
@@ -2225,7 +2232,7 @@ void main_window_cursor_normal(MainWindow *mainwin)
 		gdk_window_set_cursor(gtk_widget_get_window(mainwin->window), NULL);
 		textview_cursor_normal(mainwin->messageview->mimeview->textview);
 	}
-	gdk_flush();
+	gdk_display_flush(display);
 }
 
 /* lock / unlock the user-interface */
diff --git a/src/prefs_themes.c b/src/prefs_themes.c
index 91161bbdb..1132ddb0b 100644
--- a/src/prefs_themes.c
+++ b/src/prefs_themes.c
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2003-2021 the Claws Mail team and Hiroyuki Yamamoto
+ * Copyright (C) 2003-2021 the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -660,10 +660,14 @@ static void prefs_themes_menu_item_activated_cb(GtkWidget *widget, gpointer data
 #define MM_INCH 0.0393700787402
 static gdouble prefs_themes_compute_ppi(GdkScreen *screen)
 {
-	gdouble wp = gdk_screen_get_width(screen);
-	gdouble hp = gdk_screen_get_height(screen);
-	gdouble wi = gdk_screen_get_width_mm(screen);
-	gdouble hi = gdk_screen_get_height_mm(screen);
+	GdkRectangle workarea = {0};
+	GdkMonitor *monitor = gdk_display_get_primary_monitor(gdk_display_get_default());
+
+	gdk_monitor_get_workarea(monitor, &workarea);
+	gdouble wp = workarea.width;
+	gdouble hp = workarea.height;
+	gdouble wi = gdk_monitor_get_width_mm(monitor);
+	gdouble hi = gdk_monitor_get_height_mm(monitor);
 	gdouble dp, di;
 
 	debug_print("screen is %f x %f pixels, %f x %f mm\n", wp, hp, wi, hi);
diff --git a/src/summaryview.c b/src/summaryview.c
index 0c2c567d6..9d0b9a433 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2020 the Claws Mail team and Hiroyuki Yamamoto
+ * Copyright (C) 1999-2021 the Claws Mail team and Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -3239,16 +3239,20 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
 	GHashTable *msgid_table;
 	GHashTable *subject_table = NULL;
 	GSList * cur;
+	GdkDisplay *display;
+
 	gboolean vert_layout = (prefs_common.layout_mode == VERTICAL_LAYOUT);
 	gboolean small_layout = (prefs_common.layout_mode == SMALL_LAYOUT);
 	START_TIMING("");
 	
 	if (!mlist) return;
 
+	display = gdk_display_get_default();
+
 	debug_print("Setting summary from message data...\n");
 	STATUSBAR_PUSH(summaryview->mainwin,
 		       _("Setting summary from message data..."));
-	gdk_flush();
+	gdk_display_flush(display);
 
 	g_signal_handlers_block_by_func(G_OBJECT(ctree),
 				       G_CALLBACK(summary_tree_expanded), summaryview);

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list