[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-8-g7519c0093
paul at claws-mail.org
paul at claws-mail.org
Tue Jul 13 10:35:23 CEST 2021
The branch, gtk3 has been updated
via 7519c00939efe1e0a11eafa974e52463ac1c6042 (commit)
from b5cfac00cb6432e222063c5e40c5c8ad82351b3b (commit)
Summary of changes:
src/addr_compl.c | 57 ++++++++++++++++++++++++++++----------------------------
1 file changed, 29 insertions(+), 28 deletions(-)
- Log -----------------------------------------------------------------
commit 7519c00939efe1e0a11eafa974e52463ac1c6042
Author: paul <paul at claws-mail.org>
Date: Tue Jul 13 09:35:20 2021 +0100
replace deprecated GDK functions
diff --git a/src/addr_compl.c b/src/addr_compl.c
index 8eed6b5f4..69fd70208 100644
--- a/src/addr_compl.c
+++ b/src/addr_compl.c
@@ -1,7 +1,7 @@
/*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
*
- * Copyright (C) 2000-2012 by Alfons Hoogervorst & The Claws Mail Team.
+ * Copyright (C) 2000-2021 the Claws Mail team and Alfons Hoogervorst
*
* 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
@@ -956,28 +956,27 @@ static void completion_window_advance_selection(GtkTreeView *list_view, gboolean
* \param cw Completion window.
*/
static void addrcompl_resize_window( CompletionWindow *cw ) {
+ GdkDisplay *display;
GtkRequisition r;
GdkGrabStatus status;
- gint x, y, width, height;
-
- gdk_window_get_geometry( gtk_widget_get_window( cw->window ), &x, &y, &width, &height );
+ gint x, y, width;
+ gdk_window_get_position(gtk_widget_get_window(cw->window), &x, &y);
+ width = gdk_window_get_width(gtk_widget_get_window(cw->window));
+
gtk_widget_queue_resize_no_redraw(cw->list_view);
- gtk_widget_get_preferred_size( cw->list_view, &r, NULL);
-
- /* Adjust window height to available screen space */
- if( y + r.height > gdk_screen_height())
- r.height = gdk_screen_height() - y;
+ gtk_widget_get_preferred_size(cw->list_view, &r, NULL);
gtk_widget_set_size_request(cw->window, width, r.height);
- gdk_pointer_grab(gtk_widget_get_window(cw->window), TRUE,
- GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK,
- NULL, NULL, GDK_CURRENT_TIME);
- status = gdk_keyboard_grab(gtk_widget_get_window(cw->window), FALSE, GDK_CURRENT_TIME);
+ display = gdk_display_get_default();
+ status = gdk_seat_grab(gdk_display_get_default_seat(display),
+ gtk_widget_get_window(cw->window),
+ GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK |
+ GDK_BUTTON_RELEASE_MASK,
+ TRUE, NULL, NULL, NULL, NULL);
if (status != GDK_GRAB_SUCCESS)
- g_warning("gdk_keyboard_grab failed with status %d", status);
+ g_warning("gdk_seat_grab failed with status %d", status);
gtk_grab_add(cw->window);
}
@@ -1080,6 +1079,7 @@ static gboolean addrcompl_idle( gpointer data ) {
pthread_mutex_lock( & _completionMutex_ );
if( _displayQueue_ ) {
node = _displayQueue_;
+ node = g_list_next(node); /* skip search term */
while( node ) {
address = node->data;
/* g_print( "address ::: %s :::\n", address ); */
@@ -1459,6 +1459,7 @@ static void address_completion_create_completion_window( GtkEntry *entry_ )
GdkRectangle rect;
GtkWidget *scroll, *list_view;
GdkGrabStatus status;
+ GdkDisplay *display;
GtkRequisition r;
GtkWidget *window;
GtkWidget *entry = GTK_WIDGET(entry_);
@@ -1498,10 +1499,9 @@ static void address_completion_create_completion_window( GtkEntry *entry_ )
gtk_window_move(GTK_WINDOW(window), x, y + rect.height);
/* Resize window to fit initial (empty) address list */
- gtk_widget_get_preferred_size( list_view, &r, NULL);
- gtk_widget_set_size_request( window, rect.width, r.height );
- gtk_widget_show_all( window );
- gtk_widget_get_preferred_size( list_view, &r, NULL );
+ gtk_widget_get_preferred_size(list_view, &r, NULL);
+ gtk_widget_set_size_request(window, rect.width, r.height);
+ gtk_widget_show_all(window);
/* Setup handlers */
g_signal_connect(G_OBJECT(list_view), "button_press_event",
@@ -1520,13 +1520,14 @@ static void address_completion_create_completion_window( GtkEntry *entry_ )
"key-press-event",
G_CALLBACK(completion_window_key_press),
_compWindow_ );
- gdk_pointer_grab(gtk_widget_get_window(window), TRUE,
- GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK,
- NULL, NULL, GDK_CURRENT_TIME);
- status = gdk_keyboard_grab(gtk_widget_get_window(window), FALSE, GDK_CURRENT_TIME);
+ display = gdk_display_get_default();
+ status = gdk_seat_grab(gdk_display_get_default_seat(display),
+ gtk_widget_get_window(window),
+ GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK |
+ GDK_BUTTON_RELEASE_MASK,
+ TRUE, NULL, NULL, NULL, NULL);
if (status != GDK_GRAB_SUCCESS)
- g_warning("gdk_keyboard_grab failed with status %d", status);
+ g_warning("gdk_seat_grab failed with status %d", status);
gtk_grab_add( window );
}
@@ -1785,11 +1786,11 @@ static void addr_compl_create_list_view_columns(GtkWidget *list_view)
column = gtk_tree_view_column_new_with_attributes
("", renderer,
"pixbuf", ADDR_COMPL_ICON, NULL);
- gtk_tree_view_append_column(GTK_TREE_VIEW(list_view), column);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(list_view), column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes
("", renderer, "text", ADDR_COMPL_ADDRESS, NULL);
- gtk_tree_view_append_column(GTK_TREE_VIEW(list_view), column);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(list_view), column);
}
static gboolean list_view_button_press(GtkWidget *widget, GdkEventButton *event,
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list