Hard code freeze break requests for Empathy: GTK+ 2.22 API changes



In order to be able to build with GTK+ 2.22 we should apply the
following patches to Empathy:
https://bugzilla.gnome.org/show_bug.cgi?id=630107

Probably worth to get them in for 2.32.0 as that's not only deprecation
warnings but also API changes.


	G.

-- 
Guillaume Desmottes <gdesmott gnome org>
Jabber <cassidy jabber belnet be>
GPG 1024D/711E31B1 | 1B5A 1BA8 11AA F0F1 2169  E28A AC55 8671 711E 31B1
>From 1b45e098798485cadba9c943cb2e64587564b374 Mon Sep 17 00:00:00 2001
From: Diego Escalante Urrelo <descalante igalia com>
Date: Sun, 19 Sep 2010 18:06:27 -0500
Subject: [PATCH] empathy-avatar-image: don't use gdk_display global

This is deprecated for GTK+ 2.22.

Bug #630107
---
 libempathy-gtk/empathy-avatar-image.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libempathy-gtk/empathy-avatar-image.c b/libempathy-gtk/empathy-avatar-image.c
index cfc73b7..c74557f 100644
--- a/libempathy-gtk/empathy-avatar-image.c
+++ b/libempathy-gtk/empathy-avatar-image.c
@@ -160,11 +160,11 @@ avatar_image_add_filter (EmpathyAvatarImage *avatar_image)
 	gdk_error_trap_push ();
 	if (gdkwindow) {
 		XWindowAttributes attrs;
-		XGetWindowAttributes (gdk_display, window, &attrs);
+		XGetWindowAttributes (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), window, &attrs);
 		mask |= attrs.your_event_mask;
 	}
 
-	XSelectInput (gdk_display, window, mask);
+	XSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), window, mask);
 
 	gdk_error_trap_pop ();
 
-- 
1.7.1
>From e3b0caf863c1214e4d6a477a42f30ea1edccdb02 Mon Sep 17 00:00:00 2001
From: Diego Escalante Urrelo <descalante igalia com>
Date: Sun, 19 Sep 2010 18:08:00 -0500
Subject: [PATCH] Don't use deprecated gtk_dialog_set_has_separator

This is deprecated in GTK+ 2.22

Bug #630107
---
 libempathy-gtk/empathy-contact-dialogs.c           |    4 ----
 libempathy-gtk/empathy-contact-selector-dialog.c   |    2 --
 libempathy-gtk/empathy-individual-dialogs.c        |    1 -
 libempathy-gtk/empathy-individual-edit-dialog.c    |    1 -
 .../empathy-individual-information-dialog.c        |    1 -
 libempathy-gtk/empathy-linking-dialog.c            |    1 -
 libempathy-gtk/empathy-status-preset-dialog.c      |    1 -
 libempathy-gtk/empathy-ui-utils.h                  |   16 ----------------
 src/empathy-accounts-dialog.c                      |    5 -----
 src/empathy-import-dialog.c                        |    5 -----
 src/empathy-preferences.c                          |    5 -----
 11 files changed, 0 insertions(+), 42 deletions(-)

diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c
index 6da1810..9189d41 100644
--- a/libempathy-gtk/empathy-contact-dialogs.c
+++ b/libempathy-gtk/empathy-contact-dialogs.c
@@ -178,7 +178,6 @@ empathy_contact_information_dialog_show (EmpathyContact *contact,
 
 	/* Create dialog */
 	dialog = gtk_dialog_new ();
-	empathy_dialog_remove_separator (GTK_DIALOG (dialog));
 	gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
 	gtk_window_set_title (GTK_WINDOW (dialog),
 		empathy_contact_get_alias (contact));
@@ -238,7 +237,6 @@ empathy_contact_edit_dialog_show (EmpathyContact *contact,
 
 	/* Create dialog */
 	dialog = gtk_dialog_new ();
-	empathy_dialog_remove_separator (GTK_DIALOG (dialog));
 	gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
 	gtk_window_set_title (GTK_WINDOW (dialog), _("Edit Contact Information"));
 
@@ -290,7 +288,6 @@ empathy_contact_personal_dialog_show (GtkWindow *parent)
 
 	/* Create dialog */
 	personal_dialog = gtk_dialog_new ();
-	empathy_dialog_remove_separator (GTK_DIALOG (personal_dialog));
 	gtk_window_set_resizable (GTK_WINDOW (personal_dialog), FALSE);
 	gtk_window_set_title (GTK_WINDOW (personal_dialog), _("Personal Information"));
 
@@ -396,7 +393,6 @@ empathy_new_contact_dialog_show_with_contact (GtkWindow *parent,
 
 	/* Create dialog */
 	dialog = gtk_dialog_new ();
-	empathy_dialog_remove_separator (GTK_DIALOG (dialog));
 	gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
 	gtk_window_set_title (GTK_WINDOW (dialog), _("New Contact"));
 
diff --git a/libempathy-gtk/empathy-contact-selector-dialog.c b/libempathy-gtk/empathy-contact-selector-dialog.c
index 7989e9c..62b9027 100644
--- a/libempathy-gtk/empathy-contact-selector-dialog.c
+++ b/libempathy-gtk/empathy-contact-selector-dialog.c
@@ -316,8 +316,6 @@ empathy_contact_selector_dialog_init (EmpathyContactSelectorDialog *dialog)
     GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
 
   /* Tweak the dialog */
-  empathy_dialog_remove_separator (GTK_DIALOG (dialog));
-
   gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
   gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ON_PARENT);
   gtk_window_set_type_hint (GTK_WINDOW (dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
diff --git a/libempathy-gtk/empathy-individual-dialogs.c b/libempathy-gtk/empathy-individual-dialogs.c
index 5568281..edfb3fd 100644
--- a/libempathy-gtk/empathy-individual-dialogs.c
+++ b/libempathy-gtk/empathy-individual-dialogs.c
@@ -107,7 +107,6 @@ empathy_new_individual_dialog_show_with_individual (GtkWindow *parent,
 
   /* Create dialog */
   dialog = gtk_dialog_new ();
-  empathy_dialog_remove_separator (GTK_DIALOG (dialog));
   gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
   gtk_window_set_title (GTK_WINDOW (dialog), _("New Contact"));
 
diff --git a/libempathy-gtk/empathy-individual-edit-dialog.c b/libempathy-gtk/empathy-individual-edit-dialog.c
index 30ca1cc..b49e29f 100644
--- a/libempathy-gtk/empathy-individual-edit-dialog.c
+++ b/libempathy-gtk/empathy-individual-edit-dialog.c
@@ -243,7 +243,6 @@ empathy_individual_edit_dialog_init (
   dialog->priv = priv;
   priv->individual = NULL;
 
-  empathy_dialog_remove_separator (GTK_DIALOG (dialog));
   gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
   gtk_window_set_title (GTK_WINDOW (dialog), _("Edit Contact Information"));
 
diff --git a/libempathy-gtk/empathy-individual-information-dialog.c b/libempathy-gtk/empathy-individual-information-dialog.c
index e6d4a90..bb52e7d 100644
--- a/libempathy-gtk/empathy-individual-information-dialog.c
+++ b/libempathy-gtk/empathy-individual-information-dialog.c
@@ -273,7 +273,6 @@ empathy_individual_information_dialog_init (
   dialog->priv = priv;
   priv->individual = NULL;
 
-  empathy_dialog_remove_separator (GTK_DIALOG (dialog));
   gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
 
   content_area = GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog)));
diff --git a/libempathy-gtk/empathy-linking-dialog.c b/libempathy-gtk/empathy-linking-dialog.c
index 2e62e5d..d0a0910 100644
--- a/libempathy-gtk/empathy-linking-dialog.c
+++ b/libempathy-gtk/empathy-linking-dialog.c
@@ -108,7 +108,6 @@ empathy_linking_dialog_init (EmpathyLinkingDialog *self)
   dialog = GTK_DIALOG (self);
 
   /* Set up dialog */
-  empathy_dialog_remove_separator (GTK_DIALOG (dialog));
   gtk_window_set_resizable (GTK_WINDOW (self), TRUE);
   /* Translators: this is the title of the linking dialogue (reached by
    * right-clicking on a contact and selecting "Link…"). "Link" in this title
diff --git a/libempathy-gtk/empathy-status-preset-dialog.c b/libempathy-gtk/empathy-status-preset-dialog.c
index 2a5904b..2d7ecfe 100644
--- a/libempathy-gtk/empathy-status-preset-dialog.c
+++ b/libempathy-gtk/empathy-status-preset-dialog.c
@@ -521,7 +521,6 @@ empathy_status_preset_dialog_init (EmpathyStatusPresetDialog *self)
 
 	gtk_window_set_title (GTK_WINDOW (self),
 			_("Edit Custom Messages"));
-	empathy_dialog_remove_separator (GTK_DIALOG (self));
 	gtk_dialog_add_button (GTK_DIALOG (self),
 			GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
 
diff --git a/libempathy-gtk/empathy-ui-utils.h b/libempathy-gtk/empathy-ui-utils.h
index 43da188..0b76d09 100644
--- a/libempathy-gtk/empathy-ui-utils.h
+++ b/libempathy-gtk/empathy-ui-utils.h
@@ -129,22 +129,6 @@ void        empathy_window_iconify                      (GtkWindow        *windo
 							 GtkStatusIcon    *status_icon);
 GtkWindow * empathy_get_toplevel_window                 (GtkWidget        *widget);
 
-/**
- * empathy_dialog_remove_separator:
- * @d: a #GtkDialog
- *
- * Replacement for gtk_dialog_set_has_separator(), which was removed for GTK+ 3.
- * This is a no-op for GTK+ 3, and expands to a call to
- * gtk_dialog_set_has_separator() with %FALSE for GTK+ 2.
- *
- * FIXME: Once we depend on GTK+ 3 unconditionally, this macro can be removed.
- */
-#ifndef HAVE_GTK3
-#define empathy_dialog_remove_separator(d) gtk_dialog_set_has_separator(d, FALSE);
-#else
-#define empathy_dialog_remove_separator(d)
-#endif
-
 /* URL */
 gchar *     empathy_make_absolute_url                   (const gchar      *url);
 
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index 98301a4..35bea08 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -2161,11 +2161,6 @@ accounts_dialog_build_ui (EmpathyAccountsDialog *dialog)
 
   gtk_window_set_type_hint (GTK_WINDOW (dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
 
-  /* FIXME: Remove this once we unconditionally depend on GTK+ 3 */
-#ifndef HAVE_GTK3
-  gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
-#endif
-
   /* add dialog buttons */
   gtk_button_box_set_layout (GTK_BUTTON_BOX (action_area), GTK_BUTTONBOX_END);
 
diff --git a/src/empathy-import-dialog.c b/src/empathy-import-dialog.c
index 1fc00c0..da0c9d3 100644
--- a/src/empathy-import-dialog.c
+++ b/src/empathy-import-dialog.c
@@ -198,11 +198,6 @@ empathy_import_dialog_init (EmpathyImportDialog *self)
   gtk_container_set_border_width (GTK_CONTAINER (self), 5);
   gtk_window_set_title (GTK_WINDOW (self), _("Import Accounts"));
   gtk_window_set_modal (GTK_WINDOW (self), TRUE);
-
-  /* FIXME: Remove this once we unconditionally depend on GTK+ 3 */
-#ifndef HAVE_GTK3
-  gtk_dialog_set_has_separator (GTK_DIALOG (self), FALSE);
-#endif
 }
 
 static void
diff --git a/src/empathy-preferences.c b/src/empathy-preferences.c
index edc4059..89133ed 100644
--- a/src/empathy-preferences.c
+++ b/src/empathy-preferences.c
@@ -885,11 +885,6 @@ empathy_preferences_init (EmpathyPreferences *preferences)
 				 GTK_WIN_POS_CENTER_ON_PARENT);
 	gtk_window_set_icon_name (GTK_WINDOW (preferences), "gtk-preferences");
 
-	/* FIXME: Remove this once we unconditionally depend on GTK+ 3 */
-#ifndef HAVE_GTK3
-	gtk_dialog_set_has_separator (GTK_DIALOG (preferences), FALSE);
-#endif
-
 	filename = empathy_file_lookup ("empathy-preferences.ui", "src");
 	gui = empathy_builder_get_file (filename,
 		"notebook", &priv->notebook,
-- 
1.7.1
>From ad621e40f62b17afa69dc085d849653c4b34aeda Mon Sep 17 00:00:00 2001
From: Diego Escalante Urrelo <descalante igalia com>
Date: Sun, 19 Sep 2010 18:10:20 -0500
Subject: [PATCH] empathy-chat: update GDK_ defines to GDK_KEY_

This change works in both GTK+ 2.22 and GTK+ 3.0

Bug #630107
---
 libempathy-gtk/empathy-chat.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 1669448..c14e315 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -59,7 +59,7 @@
 
 #define CHAT_DIR_CREATE_MODE  (S_IRUSR | S_IWUSR | S_IXUSR)
 #define CHAT_FILE_CREATE_MODE (S_IRUSR | S_IWUSR)
-#define IS_ENTER(v) (v == GDK_Return || v == GDK_ISO_Enter || v == GDK_KP_Enter)
+#define IS_ENTER(v) (v == GDK_KEY_Return || v == GDK_KEY_ISO_Enter || v == GDK_KEY_KP_Enter)
 #define MAX_INPUT_HEIGHT 150
 #define COMPOSING_STOP_TIMEOUT 5
 
@@ -1483,15 +1483,15 @@ chat_input_key_press_event_cb (GtkWidget   *widget,
 
 	/* Catch ctrl+up/down so we can traverse messages we sent */
 	if ((event->state & GDK_CONTROL_MASK) &&
-	    (event->keyval == GDK_Up ||
-	     event->keyval == GDK_Down)) {
+	    (event->keyval == GDK_KEY_Up ||
+	     event->keyval == GDK_KEY_Down)) {
 		GtkTextBuffer *buffer;
 		const gchar   *str;
 
 		buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (chat->input_text_view));
 		chat_input_history_update (chat, buffer);
 
-		if (event->keyval == GDK_Up) {
+		if (event->keyval == GDK_KEY_Up) {
 			str = chat_input_history_get_next (chat);
 		} else {
 			str = chat_input_history_get_prev (chat);
@@ -1537,24 +1537,24 @@ chat_input_key_press_event_cb (GtkWidget   *widget,
 		return FALSE;
 	}
 	if (!(event->state & GDK_CONTROL_MASK) &&
-	    event->keyval == GDK_Page_Up) {
+	    event->keyval == GDK_KEY_Page_Up) {
 		adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (text_view_sw));
 		gtk_adjustment_set_value (adj, gtk_adjustment_get_value (adj) - gtk_adjustment_get_page_size (adj));
 		return TRUE;
 	}
 	if ((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK &&
-	    event->keyval == GDK_Page_Down) {
+	    event->keyval == GDK_KEY_Page_Down) {
 		adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (text_view_sw));
 		val = MIN (gtk_adjustment_get_value (adj) + gtk_adjustment_get_page_size (adj),
 			   gtk_adjustment_get_upper (adj) - gtk_adjustment_get_page_size (adj));
 		gtk_adjustment_set_value (adj, val);
 		return TRUE;
 	}
-	if (event->keyval == GDK_Escape) {
+	if (event->keyval == GDK_KEY_Escape) {
 		empathy_search_bar_hide (EMPATHY_SEARCH_BAR (priv->search_bar));
 	}
 	if (!(event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) &&
-	    event->keyval == GDK_Tab) {
+	    event->keyval == GDK_KEY_Tab) {
 		GtkTextBuffer *buffer;
 		GtkTextIter    start, current;
 		gchar         *nick, *completed;
-- 
1.7.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]