diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2010-04-13 22:27:12 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2010-04-19 17:55:58 +0800 |
commit | d8ee766305ccac5a7df6678e09938d95f63a2583 (patch) | |
tree | 3d679342e040ddcede3e53c3b60c62ec3efd3d34 | |
parent | db806e6906469a1db633090b4a02298e4ebb4afd (diff) | |
download | gsoc2013-empathy-d8ee766305ccac5a7df6678e09938d95f63a2583.tar gsoc2013-empathy-d8ee766305ccac5a7df6678e09938d95f63a2583.tar.gz gsoc2013-empathy-d8ee766305ccac5a7df6678e09938d95f63a2583.tar.bz2 gsoc2013-empathy-d8ee766305ccac5a7df6678e09938d95f63a2583.tar.lz gsoc2013-empathy-d8ee766305ccac5a7df6678e09938d95f63a2583.tar.xz gsoc2013-empathy-d8ee766305ccac5a7df6678e09938d95f63a2583.tar.zst gsoc2013-empathy-d8ee766305ccac5a7df6678e09938d95f63a2583.zip |
Fix some build errors when GSEAL is enabled
-rw-r--r-- | configure.ac | 8 | ||||
-rw-r--r-- | libempathy-gtk/empathy-chat-text-view.c | 33 |
2 files changed, 34 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index f9db12d01..b30abc186 100644 --- a/configure.ac +++ b/configure.ac @@ -47,10 +47,14 @@ KEYRING_REQUIRED=2.22 NETWORK_MANAGER_REQUIRED=0.7.0 NAUTILUS_SENDTO_REQUIRED=2.28.1 -# Use --enable-maintainer-mode to disable deprecated symbols and single include. -# If this is not a released empathy, maintainer mode is forced +# Use --enable-maintainer-mode to disable deprecated symbols, +# disable single include and enable GSEAL. If this is not a released empathy, +# maintainer mode is forced ifelse(empathy_released, 1, [], [enable_maintainer_mode="yes"]) GNOME_MAINTAINER_MODE_DEFINES +#if test $USE_MAINTAINER_MODE = yes; then +# AC_DEFINE(GSEAL_ENABLE, [], [Seal public structs to force usage of accessors]) +#fi AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) diff --git a/libempathy-gtk/empathy-chat-text-view.c b/libempathy-gtk/empathy-chat-text-view.c index 491b61333..9e31e4987 100644 --- a/libempathy-gtk/empathy-chat-text-view.c +++ b/libempathy-gtk/empathy-chat-text-view.c @@ -493,8 +493,13 @@ chat_text_view_size_allocate (GtkWidget *widget, if (down) { GtkAdjustment *adj; + GtkWidget *sw; - adj = GTK_TEXT_VIEW (widget)->vadjustment; + sw = gtk_widget_get_parent (widget); + if (!GTK_IS_SCROLLED_WINDOW (sw)) + return; + + adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (sw)); gtk_adjustment_set_value (adj, gtk_adjustment_get_upper (adj) - gtk_adjustment_get_page_size (adj)); @@ -653,6 +658,18 @@ empathy_chat_text_view_init (EmpathyChatTextView *view) NULL); } +static void +chat_text_view_scroll_stop (EmpathyChatTextView *view) +{ + EmpathyChatTextViewPriv *priv = GET_PRIV (view); + + g_timer_destroy (priv->scroll_time); + priv->scroll_time = NULL; + + g_source_remove (priv->scroll_timeout); + priv->scroll_timeout = 0; +} + /* Code stolen from pidgin/gtkimhtml.c */ static gboolean chat_text_view_scroll_cb (EmpathyChatTextView *view) @@ -660,9 +677,17 @@ chat_text_view_scroll_cb (EmpathyChatTextView *view) EmpathyChatTextViewPriv *priv; GtkAdjustment *adj; gdouble max_val; + GtkWidget *sw; priv = GET_PRIV (view); - adj = GTK_TEXT_VIEW (view)->vadjustment; + + sw = gtk_widget_get_parent (GTK_WIDGET (view)); + if (!GTK_IS_SCROLLED_WINDOW (sw)) { + chat_text_view_scroll_stop (view); + return FALSE; + } + + adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (sw)); max_val = gtk_adjustment_get_upper (adj) - gtk_adjustment_get_page_size (adj); g_return_val_if_fail (priv->scroll_time != NULL, FALSE); @@ -670,9 +695,7 @@ chat_text_view_scroll_cb (EmpathyChatTextView *view) if (g_timer_elapsed (priv->scroll_time, NULL) > MAX_SCROLL_TIME) { /* time's up. jump to the end and kill the timer */ gtk_adjustment_set_value (adj, max_val); - g_timer_destroy (priv->scroll_time); - priv->scroll_time = NULL; - priv->scroll_timeout = 0; + chat_text_view_scroll_stop (view); return FALSE; } |