changeset 12505:1ee0a397157f

[gaim-migrate @ 14817] Better Gtk+ 2.0 support for the GtkComboBox backport committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Fri, 16 Dec 2005 19:40:53 +0000
parents 78e69ba4f596
children 8e60dc361a66
files src/gtkcombobox.c
diffstat 1 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkcombobox.c	Fri Dec 16 18:44:07 2005 +0000
+++ b/src/gtkcombobox.c	Fri Dec 16 19:40:53 2005 +0000
@@ -295,13 +295,12 @@
 						    gpointer          data);
 
 /* list */
-#if GTK_CHECK_VERSION(2,2,0)
 static void     gtk_combo_box_list_position        (GtkComboBox      *combo_box, 
 						    gint             *x, 
 						    gint             *y, 
 						    gint             *width,
 						    gint             *height);
-#endif
+
 static void     gtk_combo_box_list_setup           (GtkComboBox      *combo_box);
 static void     gtk_combo_box_list_destroy         (GtkComboBox      *combo_box);
 
@@ -1090,6 +1089,7 @@
     }
 
 }
+#endif /* Gtk 2.2 */
 
 static void
 gtk_combo_box_list_position (GtkComboBox *combo_box, 
@@ -1099,10 +1099,12 @@
 			     gint        *height)
 {
   GtkWidget *sample;
+  GtkRequisition popup_req;
+#if GTK_CHECK_VERSION(2,2,0)
   GdkScreen *screen;
   gint monitor_num;
   GdkRectangle monitor;
-  GtkRequisition popup_req;
+#endif
   
   sample = GTK_BIN (combo_box)->child;
 
@@ -1126,6 +1128,7 @@
       *y += sample->allocation.y;
     }
   
+#if GTK_CHECK_VERSION(2,2,0)
   screen = gtk_widget_get_screen (GTK_WIDGET (combo_box));
   monitor_num = gdk_screen_get_monitor_at_window (screen, 
 						  GTK_WIDGET (combo_box)->window);
@@ -1140,8 +1143,8 @@
     *y += sample->allocation.height;
   else
     *y -= *height;
+#endif /* Gtk 2.2 */
 } 
-#endif /* Gtk 2.2 */
 
 /**
  * gtk_combo_box_popup:
@@ -1157,10 +1160,7 @@
 void
 gtk_combo_box_popup (GtkComboBox *combo_box)
 {
-  gint x, y, width;
-#if GTK_CHECK_VERSION(2,2,0)
-  gint height;
-#endif
+  gint x, y, width, height;
   
   g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
 
@@ -1195,9 +1195,7 @@
     }
 
   gtk_widget_show_all (combo_box->priv->popup_frame);
-#if GTK_CHECK_VERSION(2,2,0)
   gtk_combo_box_list_position (combo_box, &x, &y, &width, &height);
-#endif
 
   gtk_widget_set_size_request (combo_box->priv->popup_window, width, -1);  
   gtk_window_move (GTK_WINDOW (combo_box->priv->popup_window), x, y);