/soc/2012/tomkiewicz/gg: 481258ec30de: Merge fix for lost focus bug

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Fri Aug 17 11:22:45 EDT 2012


Changeset: 481258ec30de5bb43aeb352020523685ffee04b8
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2012-08-17 17:22 +0200
Branch:	 soc.2012.gg
URL: http://hg.pidgin.im/soc/2012/tomkiewicz/gg/rev/481258ec30de

Description:

Merge fix for lost focus bug

diffstat:

 COPYRIGHT                                |    1 +
 ChangeLog                                |   10 +-
 libpurple/media/enum-types.h             |   12 +-
 pidgin/gtk3compat.h                      |   11 +
 pidgin/gtkaccount.c                      |   12 +-
 pidgin/gtkblist.c                        |   84 ++++++----
 pidgin/gtkcellrendererexpander.c         |   23 ++-
 pidgin/gtkconv.c                         |  228 +++++++++++++++++++-----------
 pidgin/gtkconvwin.h                      |    2 +-
 pidgin/gtkimhtml.h                       |    2 +-
 pidgin/gtkmedia.c                        |    2 +-
 pidgin/gtkplugin.c                       |    6 +-
 pidgin/gtkroomlist.c                     |   45 +++--
 pidgin/gtkstatusbox.c                    |  116 ++++++++++-----
 pidgin/gtkutils.c                        |  115 +--------------
 pidgin/gtkutils.h                        |   30 +---
 pidgin/gtkwebviewtoolbar.c               |   79 ++++------
 pidgin/gtkwhiteboard.c                   |    5 +
 pidgin/pidginstock.c                     |    7 +-
 pidgin/pidgintooltip.c                   |    8 +-
 pidgin/plugins/disco/gtkdisco.c          |    8 +-
 pidgin/plugins/gestures/stroke-draw.c    |   16 ++-
 pidgin/plugins/perl/common/GtkConvWin.xs |    5 -
 pidgin/plugins/pidginrc.c                |   10 +-
 pidgin/plugins/themeedit.c               |   11 +-
 pidgin/plugins/ticker/gtkticker.c        |   15 +-
 26 files changed, 451 insertions(+), 412 deletions(-)

diffs (truncated from 1908 to 300 lines):

diff --git a/COPYRIGHT b/COPYRIGHT
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -342,6 +342,7 @@ Greg McNew
 Robert McQueen
 Mihály Mészáros
 Robert Mibus
+David Michael
 Lars T. Mikkelsen
 Benjamin Miller
 Kevin Miller
diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -49,8 +49,6 @@ version 3.0.0 (??/??/????):
 	* Invalid user moods can no longer be sent to the server.
 
 	Plugins:
-	* The Voice/Video Settings plugin supports using the sndio GStreamer
-	  backends. (Brad Smith) (#14414)
 	* The Offline Message Emulation plugin now adds a note that the message
 	  was an offline message. (Flavius Anton) (#2497)
 
@@ -59,6 +57,10 @@ version 2.10.7:
 	* Fix a crash at startup with large contact list. Avatar support for
 	  buddies will be disabled till 3.0.0. (#15226, #14305)
 
+	Gadu-Gadu:
+	* Fix a crash at startup with large contact list. Avatar support for
+	  buddies will be disabled till 3.0.0. (#15226, #14305)
+
 	MSN:
 	* Fix a crash when removing a user before its icon is loaded. (Mark
 	  Barfield) (#15217)
@@ -67,6 +69,10 @@ version 2.10.7:
 	* Fix a double-free in profile/picture loading code. (Mihai Serban)
 	  (#15053)
 
+	Plugins:
+	* The Voice/Video Settings plugin supports using the sndio GStreamer
+	 backends. (Brad Smith) (#14414)
+
 version 2.10.6 (07/06/2012):
 	Pidgin:
 	* Fix a bug that requires a triple-click to open a conversation
diff --git a/libpurple/media/enum-types.h b/libpurple/media/enum-types.h
--- a/libpurple/media/enum-types.h
+++ b/libpurple/media/enum-types.h
@@ -44,7 +44,7 @@ typedef enum {
 	PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX,
 	PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX,
 	PURPLE_MEDIA_CANDIDATE_TYPE_RELAY,
-	PURPLE_MEDIA_CANDIDATE_TYPE_MULTICAST,
+	PURPLE_MEDIA_CANDIDATE_TYPE_MULTICAST
 } PurpleMediaCandidateType;
 
 /** Media caps */
@@ -56,14 +56,14 @@ typedef enum {
 	PURPLE_MEDIA_CAPS_VIDEO_SINGLE_DIRECTION = 1 << 3,
 	PURPLE_MEDIA_CAPS_AUDIO_VIDEO = 1 << 4,
 	PURPLE_MEDIA_CAPS_MODIFY_SESSION = 1 << 5,
-	PURPLE_MEDIA_CAPS_CHANGE_DIRECTION = 1 << 6,
+	PURPLE_MEDIA_CAPS_CHANGE_DIRECTION = 1 << 6
 } PurpleMediaCaps;
 
 /** Media component types */
 typedef enum {
 	PURPLE_MEDIA_COMPONENT_NONE = 0,
 	PURPLE_MEDIA_COMPONENT_RTP = 1,
-	PURPLE_MEDIA_COMPONENT_RTCP = 2,
+	PURPLE_MEDIA_COMPONENT_RTCP = 2
 } PurpleMediaComponentType;
 
 /** Media info types */
@@ -76,13 +76,13 @@ typedef enum {
 	PURPLE_MEDIA_INFO_PAUSE,
 	PURPLE_MEDIA_INFO_UNPAUSE,
 	PURPLE_MEDIA_INFO_HOLD,
-	PURPLE_MEDIA_INFO_UNHOLD,
+	PURPLE_MEDIA_INFO_UNHOLD
 } PurpleMediaInfoType;
 
 /** Media network protocols */
 typedef enum {
 	PURPLE_MEDIA_NETWORK_PROTOCOL_UDP,
-	PURPLE_MEDIA_NETWORK_PROTOCOL_TCP,
+	PURPLE_MEDIA_NETWORK_PROTOCOL_TCP
 } PurpleMediaNetworkProtocol;
 
 /** Media session types */
@@ -100,7 +100,7 @@ typedef enum {
 typedef enum {
 	PURPLE_MEDIA_STATE_NEW = 0,
 	PURPLE_MEDIA_STATE_CONNECTED,
-	PURPLE_MEDIA_STATE_END,
+	PURPLE_MEDIA_STATE_END
 } PurpleMediaState;
 
 /**
diff --git a/pidgin/gtk3compat.h b/pidgin/gtk3compat.h
--- a/pidgin/gtk3compat.h
+++ b/pidgin/gtk3compat.h
@@ -25,9 +25,17 @@
  * Also, any public API should not depend on this file.
  */
 
+#if !GTK_CHECK_VERSION(3,2,0)
+
+#define GTK_FONT_CHOOSER GTK_FONT_SELECTION_DIALOG
+#define gtk_font_chooser_dialog_new(x,y) gtk_font_selection_dialog_new(x)
+#define gtk_font_chooser_get_font gtk_font_selection_dialog_get_font_name
+#define gtk_font_chooser_set_font gtk_font_selection_dialog_set_font_name
+
 #if !GTK_CHECK_VERSION(3,0,0)
 
 #define gdk_x11_window_get_xid GDK_WINDOW_XWINDOW
+#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,z)
 
 #if !GTK_CHECK_VERSION(2,24,0)
 
@@ -36,6 +44,7 @@
 #define GtkComboBoxText GtkComboBox
 #define GTK_COMBO_BOX_TEXT GTK_COMBO_BOX
 #define gtk_combo_box_text_new gtk_combo_box_new_text
+#define gtk_combo_box_text_new_with_entry gtk_combo_box_entry_new_text
 #define gtk_combo_box_text_append_text gtk_combo_box_append_text
 #define gtk_combo_box_text_get_active_text gtk_combo_box_get_active_text
 #define gtk_combo_box_text_remove gtk_combo_box_remove_text
@@ -168,5 +177,7 @@ static inline gint gdk_window_get_height
 
 #endif /* 3.0.0 */
 
+#endif /* 3.2.0 */
+
 #endif /* _PIDGINGTK3COMPAT_H_ */
 
diff --git a/pidgin/gtkaccount.c b/pidgin/gtkaccount.c
--- a/pidgin/gtkaccount.c
+++ b/pidgin/gtkaccount.c
@@ -917,12 +917,13 @@ add_protocol_options(AccountPrefsDialog 
 				if (str_hints)
 				{
 					const GSList *hint_it = str_hints;
-					entry = gtk_combo_box_entry_new_text();
+					entry = gtk_combo_box_text_new_with_entry();
 					while (hint_it)
 					{
 						const gchar *hint = hint_it->data;
-						hint_it = g_list_next(hint_it);
-						gtk_combo_box_append_text(GTK_COMBO_BOX(entry), hint);
+						hint_it = g_slist_next(hint_it);
+						gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(entry),
+						                               hint);
 					}
 				}
 				else
@@ -941,7 +942,8 @@ add_protocol_options(AccountPrefsDialog 
 				}
 
 				if (str_value != NULL && str_hints)
-					gtk_entry_set_text(GTK_ENTRY(GTK_BIN(entry)->child), str_value);
+					gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(entry))),
+					                   str_value);
 				else
 					gtk_entry_set_text(GTK_ENTRY(entry), str_value);
 
@@ -1474,7 +1476,7 @@ ok_account_prefs_cb(GtkWidget *w, Accoun
 			switch (opt_entry->type) {
 				case PURPLE_PREF_STRING:
 					if (GTK_IS_COMBO_BOX(opt_entry->widget))
-						value = gtk_combo_box_get_active_text(GTK_COMBO_BOX(opt_entry->widget));
+						value = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(opt_entry->widget));
 					else
 						value = gtk_entry_get_text(GTK_ENTRY(opt_entry->widget));
 					purple_account_set_string(account, opt_entry->setting, value);
diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c
--- a/pidgin/gtkblist.c
+++ b/pidgin/gtkblist.c
@@ -2965,7 +2965,11 @@ static struct tooltip_data * create_tip_
 static gboolean
 pidgin_blist_paint_tip(GtkWidget *widget, cairo_t *cr, gpointer null)
 {
+#if GTK_CHECK_VERSION(3,0,0)
+	GtkStyleContext *context;
+#else
 	GtkStyle *style;
+#endif
 	int current_height, max_width;
 	int max_text_width;
 	int max_avatar_width;
@@ -2977,7 +2981,12 @@ pidgin_blist_paint_tip(GtkWidget *widget
 	if(gtkblist->tooltipdata == NULL)
 		return FALSE;
 
+#if GTK_CHECK_VERSION(3,0,0)
+	context = gtk_widget_get_style_context(gtkblist->tipwindow);
+	gtk_style_context_add_class(context, GTK_STYLE_CLASS_TOOLTIP);
+#else
 	style = gtk_widget_get_style(gtkblist->tipwindow);
+#endif
 
 	max_text_width = 0;
 	max_avatar_width = 0;
@@ -3007,27 +3016,34 @@ pidgin_blist_paint_tip(GtkWidget *widget
 		if (td->avatar && pidgin_gdk_pixbuf_is_opaque(td->avatar))
 		{
 #if GTK_CHECK_VERSION(3,0,0)
-			if (dir == GTK_TEXT_DIR_RTL)
-				gtk_paint_flat_box(style, cr, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
-				                   gtkblist->tipwindow, "tooltip",
+			gtk_style_context_save(context);
+			gtk_style_context_add_class(context, GTK_STYLE_CLASS_FRAME);
+			if (dir == GTK_TEXT_DIR_RTL) {
+				gtk_render_frame(context, cr,
+				                 TOOLTIP_BORDER - 1, current_height - 1,
+				                 td->avatar_width + 2, td->avatar_height + 2);
+			} else {
+				gtk_render_frame(context, cr,
+				                 max_width - (td->avatar_width + TOOLTIP_BORDER) - 1,
+				                 current_height - 1,
+				                 td->avatar_width + 2, td->avatar_height + 2);
+			}
+			gtk_style_context_restore(context);
+#else
+			if (dir == GTK_TEXT_DIR_RTL) {
+				gtk_paint_flat_box(style, gtkblist->tipwindow->window,
+				                   GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+				                   NULL, gtkblist->tipwindow, "tooltip",
 				                   TOOLTIP_BORDER - 1, current_height - 1,
 				                   td->avatar_width + 2, td->avatar_height + 2);
-			else
-				gtk_paint_flat_box(style, cr, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
-				                   gtkblist->tipwindow, "tooltip",
+			} else {
+				gtk_paint_flat_box(style, gtkblist->tipwindow->window,
+				                   GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+				                   NULL, gtkblist->tipwindow, "tooltip",
 				                   max_width - (td->avatar_width + TOOLTIP_BORDER) - 1,
-				                   current_height - 1,
-				                   td->avatar_width + 2, td->avatar_height + 2);
-#else
-			if (dir == GTK_TEXT_DIR_RTL)
-				gtk_paint_flat_box(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
-				                   NULL, gtkblist->tipwindow, "tooltip",
-				                   TOOLTIP_BORDER -1, current_height -1, td->avatar_width +2, td->avatar_height + 2);
-			else
-				gtk_paint_flat_box(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
-				                   NULL, gtkblist->tipwindow, "tooltip",
-				                   max_width - (td->avatar_width+ TOOLTIP_BORDER)-1,
-				                   current_height-1,td->avatar_width+2, td->avatar_height+2);
+				                   current_height - 1, td->avatar_width + 2,
+				                   td->avatar_height + 2);
+			}
 #endif
 		}
 
@@ -3067,14 +3083,13 @@ pidgin_blist_paint_tip(GtkWidget *widget
 		if (td->name_layout) {
 #if GTK_CHECK_VERSION(3,0,0)
 			if (dir == GTK_TEXT_DIR_RTL) {
-				gtk_paint_layout(style, cr, GTK_STATE_NORMAL, FALSE,
-				                 gtkblist->tipwindow, "tooltip",
-				                 max_width - (TOOLTIP_BORDER + status_size + SMALL_SPACE) - PANGO_PIXELS(300000),
-				                 current_height, td->name_layout);
+				gtk_render_layout(context, cr,
+				                  max_width - (TOOLTIP_BORDER + status_size + SMALL_SPACE) - PANGO_PIXELS(300000),
+				                  current_height, td->name_layout);
 			} else {
-				gtk_paint_layout(style, cr, GTK_STATE_NORMAL, FALSE,
-				                 gtkblist->tipwindow, "tooltip",
-				                 TOOLTIP_BORDER + status_size + SMALL_SPACE, current_height, td->name_layout);
+				gtk_render_layout(context, cr,
+				                  TOOLTIP_BORDER + status_size + SMALL_SPACE,
+				                  current_height, td->name_layout);
 			}
 #else
 			if (dir == GTK_TEXT_DIR_RTL) {
@@ -3093,21 +3108,22 @@ pidgin_blist_paint_tip(GtkWidget *widget
 		if (td->layout) {
 #if GTK_CHECK_VERSION(3,0,0)
 			if (dir != GTK_TEXT_DIR_RTL) {
-				gtk_paint_layout(style, cr, GTK_STATE_NORMAL, FALSE,
-				                 gtkblist->tipwindow, "tooltip",
-				                 TOOLTIP_BORDER + status_size + SMALL_SPACE, current_height + td->name_height, td->layout);
+				gtk_render_layout(context, cr,
+				                  TOOLTIP_BORDER + status_size + SMALL_SPACE,
+				                  current_height + td->name_height,
+				                  td->layout);
 			} else {
-				gtk_paint_layout(style, cr, GTK_STATE_NORMAL, FALSE,
-				                 gtkblist->tipwindow, "tooltip",
-				                 max_width - (TOOLTIP_BORDER + status_size + SMALL_SPACE) - PANGO_PIXELS(300000),
-				                 current_height + td->name_height,
-				                 td->layout);
+				gtk_render_layout(context, cr,
+				                  max_width - (TOOLTIP_BORDER + status_size + SMALL_SPACE) - PANGO_PIXELS(300000),
+				                  current_height + td->name_height,
+				                  td->layout);
 			}
 #else



More information about the Commits mailing list