[devhelp] Use accessor functions instead direct access. (GnomeBug:585110)
- From: Frederic Peters <fpeters src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [devhelp] Use accessor functions instead direct access. (GnomeBug:585110)
- Date: Thu, 27 Aug 2009 15:51:04 +0000 (UTC)
commit 530aeb35cd8373554ebe32e884a523bcda077b7c
Author: Javier Jardón <javierjc1982 gmail com>
Date: Wed Aug 19 02:10:39 2009 +0200
Use accessor functions instead direct access. (GnomeBug:585110)
src/dh-base.c | 4 ++++
src/dh-main.c | 4 ++++
src/dh-util.c | 4 ++++
src/dh-window.c | 4 +++-
src/eggfindbar.c | 2 +-
5 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/src/dh-base.c b/src/dh-base.c
index c6e2698..3b340a4 100644
--- a/src/dh-base.c
+++ b/src/dh-base.c
@@ -569,7 +569,11 @@ dh_base_get_window_on_current_workspace (DhBase *base)
for (l = priv->windows; l; l = l->next) {
window = l->data;
+#if GTK_CHECK_VERSION (2,14,0)
+ if (GDK_WINDOW_XID (gtk_widget_get_window (window)) == xid) {
+#else
if (GDK_WINDOW_XID (window->window) == xid) {
+#endif
return window;
}
}
diff --git a/src/dh-main.c b/src/dh-main.c
index 342d9bb..28da04a 100644
--- a/src/dh-main.c
+++ b/src/dh-main.c
@@ -139,7 +139,11 @@ message_received_cb (const gchar *message,
}
#ifdef GDK_WINDOWING_X11
+#if GTK_CHECK_VERSION (2,14,0)
+ timestamp = gdk_x11_get_server_time (gtk_widget_get_window (window));
+#else
timestamp = gdk_x11_get_server_time (window->window);
+#endif
#else
timestamp = GDK_CURRENT_TIME;
#endif
diff --git a/src/dh-util.c b/src/dh-util.c
index e6fee52..3b31d2d 100644
--- a/src/dh-util.c
+++ b/src/dh-util.c
@@ -286,7 +286,11 @@ util_state_save_window (GtkWindow *window,
gint width, height;
gint x, y;
+#if GTK_CHECK_VERSION (2,14,0)
+ state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (window)));
+#else
state = gdk_window_get_state (GTK_WIDGET (window)->window);
+#endif
if (state & GDK_WINDOW_STATE_MAXIMIZED) {
maximized = TRUE;
} else {
diff --git a/src/dh-window.c b/src/dh-window.c
index 2c9f1b3..79cca8c 100644
--- a/src/dh-window.c
+++ b/src/dh-window.c
@@ -1143,12 +1143,14 @@ tab_label_style_set_cb (GtkWidget *hbox,
PangoFontMetrics *metrics;
PangoContext *context;
GtkWidget *button;
+ GtkStyle *style;
gint char_width;
gint h, w;
context = gtk_widget_get_pango_context (hbox);
+ style = gtk_widget_get_style (hbox);
metrics = pango_context_get_metrics (context,
- hbox->style->font_desc,
+ style->font_desc,
pango_context_get_language (context));
char_width = pango_font_metrics_get_approximate_digit_width (metrics);
diff --git a/src/eggfindbar.c b/src/eggfindbar.c
index ae43ac3..f6e1dba 100644
--- a/src/eggfindbar.c
+++ b/src/eggfindbar.c
@@ -280,7 +280,7 @@ set_focus_cb (GtkWidget *window,
while (widget != NULL && widget != wbar)
{
- widget = widget->parent;
+ widget = gtk_widget_get_parent (widget);
}
/* if widget == bar, the new focus widget is in the bar, so we
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]