[Commits] [SCM] claws branch, gtk3, updated. 3.16.0-891-g72e28208e

paul at claws-mail.org paul at claws-mail.org
Tue Dec 10 12:20:24 CET 2019


The branch, gtk3 has been updated
       via  72e28208e3e98fe44e795c78e605bc4715a760fe (commit)
      from  6f8ce65f565493b38a3d5213f3adf1bc7114240b (commit)

Summary of changes:
 src/gtk/gtkaspell.c   | 20 +-------------------
 src/gtk/spell_entry.c |  6 +-----
 2 files changed, 2 insertions(+), 24 deletions(-)


- Log -----------------------------------------------------------------
commit 72e28208e3e98fe44e795c78e605bc4715a760fe
Author: paul <paul at claws-mail.org>
Date:   Tue Dec 10 11:20:20 2019 +0000

    replace deprecated gtk_widget_get_child_requisition(), and remove other unnecessary cruft

diff --git a/src/gtk/gtkaspell.c b/src/gtk/gtkaspell.c
index e1ee183f9..ada3a5b4b 100644
--- a/src/gtk/gtkaspell.c
+++ b/src/gtk/gtkaspell.c
@@ -2068,13 +2068,10 @@ static void set_menu_pos(GtkMenu *menu, gint *x, gint *y,
 {
 	GtkAspell 	*gtkaspell = (GtkAspell *) data;
 	gint 		 xx = 0, yy = 0;
-	gint 		 sx,     sy;
-	gint 		 wx,     wy;
 	GtkTextView 	*text = GTK_TEXT_VIEW(gtkaspell->gtktext);
 	GtkTextBuffer	*textbuf;
 	GtkTextIter	 iter;
 	GdkRectangle	 rect;
-	GtkRequisition 	 r;
 
 	textbuf = gtk_text_view_get_buffer(gtkaspell->gtktext);
 	gtk_text_buffer_get_iter_at_mark(textbuf, &iter,
@@ -2087,22 +2084,7 @@ static void set_menu_pos(GtkMenu *menu, gint *x, gint *y,
 	gdk_window_get_origin(gtk_widget_get_window(GTK_WIDGET(gtkaspell->gtktext)),
 			&xx, &yy);
 
-	sx = gdk_screen_width();
-	sy = gdk_screen_height();
-
-	gtk_widget_get_child_requisition(GTK_WIDGET(menu), &r);
-
-	wx =  r.width;
-	wy =  r.height;
-
-	*x = rect.x + xx + 8;
-
-	*y = rect.y + rect.height + yy;
-
-	if (*x + wx > sx)
-		*x = sx - wx;
-	if (*y + wy > sy)
-		*y = *y - wy - 10;
+	gtk_widget_get_preferred_size(GTK_WIDGET(menu), NULL, NULL);
 }
 
 /* change the current dictionary of gtkaspell
diff --git a/src/gtk/spell_entry.c b/src/gtk/spell_entry.c
index 98eaccc7e..a29690898 100644
--- a/src/gtk/spell_entry.c
+++ b/src/gtk/spell_entry.c
@@ -566,11 +566,10 @@ static void set_menu_pos(GtkMenu *menu, gint *x, gint *y,
 	GtkAspell *gtkaspell = entry->gtkaspell;
 	gint pango_offset, win_x, win_y, scr_x, scr_y, text_index, entry_x;
 	gchar *text;
-	GtkRequisition subject_rq;
 	PangoLayout *layout = gtk_entry_get_layout(GTK_ENTRY(entry));
 	PangoLayoutLine *line = pango_layout_get_lines(layout)->data;
 
-	gtk_widget_get_child_requisition(GTK_WIDGET(entry), &subject_rq);
+	gtk_widget_get_preferred_size(GTK_WIDGET(entry), NULL, NULL);
 	
 	/* screen -> compose window coords */
 	gdk_window_get_origin(gtk_widget_get_window(GTK_WIDGET(gtkaspell->parent_window)),
@@ -587,9 +586,6 @@ static void set_menu_pos(GtkMenu *menu, gint *x, gint *y,
 	pango_offset = gtk_entry_text_index_to_layout_index(GTK_ENTRY(entry),
 					text_index);
 	pango_layout_line_index_to_x(line, pango_offset, TRUE, &entry_x);
-
-	*x = scr_x + win_x + PANGO_PIXELS(entry_x) + 8;
-	*y = scr_y + win_y + subject_rq.height;
 }
 
 void claws_spell_entry_context_set(ClawsSpellEntry *entry)

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list