aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-03-05 12:38:41 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-03-05 20:36:23 +0800
commit2836a54dd6d61e35d1446f9a23a628064516a309 (patch)
treeb9cb2ab39212de803e935ed28957ee77e73c2d96 /widgets
parentbaa7f20333a5bbb7c8cbb3cf2ce86b57aba79ef2 (diff)
downloadgsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.tar.gz
gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.tar.zst
gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.zip
Work around recent GTK+ deprecations.
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-buffer-tagger.c4
-rw-r--r--widgets/misc/e-calendar-item.c4
-rw-r--r--widgets/misc/e-calendar.c17
-rw-r--r--widgets/misc/e-canvas-background.c4
-rw-r--r--widgets/misc/e-canvas.c4
-rw-r--r--widgets/misc/e-dateedit.c4
-rw-r--r--widgets/misc/e-hinted-entry.c4
-rw-r--r--widgets/misc/e-map.c43
-rw-r--r--widgets/misc/e-online-button.c4
-rw-r--r--widgets/misc/e-search-bar.c4
-rw-r--r--widgets/misc/e-spinner.c8
-rw-r--r--widgets/table/e-cell-combo.c8
-rw-r--r--widgets/table/e-cell-date-edit.c16
-rw-r--r--widgets/table/e-cell-text.c4
-rw-r--r--widgets/table/e-table-item.c12
-rw-r--r--widgets/table/e-table.c4
-rw-r--r--widgets/table/e-tree.c4
-rw-r--r--widgets/table/gal-a11y-e-table.c8
-rw-r--r--widgets/text/e-text.c12
19 files changed, 167 insertions, 1 deletions
diff --git a/widgets/misc/e-buffer-tagger.c b/widgets/misc/e-buffer-tagger.c
index 248e1c004c..9501f29d6a 100644
--- a/widgets/misc/e-buffer-tagger.c
+++ b/widgets/misc/e-buffer-tagger.c
@@ -308,7 +308,11 @@ update_mouse_cursor (GtkTextView *text_view, gint x, gint y)
if (hovering != hovering_over_link) {
update_state (buffer, E_BUFFER_TAGGER_STATE_IS_HOVERING, hovering);
+#if GTK_CHECK_VERSION(2,19,7)
+ if (hovering && gtk_widget_has_focus (GTK_WIDGET (text_view)))
+#else
if (hovering && GTK_WIDGET_HAS_FOCUS (text_view))
+#endif
gdk_window_set_cursor (gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_TEXT), hand_cursor);
else
gdk_window_set_cursor (gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_TEXT), regular_cursor);
diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c
index 84adf6185f..def7019c21 100644
--- a/widgets/misc/e-calendar-item.c
+++ b/widgets/misc/e-calendar-item.c
@@ -1552,7 +1552,11 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem,
day_style = calitem->styles[(month_offset + 1) * 32 + day_num];
/* Get the colors & style to use for the day.*/
+#if GTK_CHECK_VERSION(2,19,7)
+ if ((gtk_widget_has_focus (GTK_WIDGET (item->canvas))) &&
+#else
if ((GTK_WIDGET_HAS_FOCUS(item->canvas)) &&
+#endif
item->canvas->focused_item == item)
has_focus = TRUE;
else
diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c
index 5fb933baa6..27ac031b8d 100644
--- a/widgets/misc/e-calendar.c
+++ b/widgets/misc/e-calendar.c
@@ -266,7 +266,11 @@ e_calendar_style_set (GtkWidget *widget,
/* Set the background of the canvas window to the normal color,
or the arrow buttons are not displayed properly. */
+#if GTK_CHECK_VERSION(2,19,7)
+ if (gtk_widget_get_realized (widget)) {
+#else
if (GTK_WIDGET_REALIZED (widget)) {
+#endif
GtkStyle *style;
GdkWindow *window;
@@ -558,8 +562,13 @@ e_calendar_button_has_focus (ECalendar *cal)
prev_widget = GNOME_CANVAS_WIDGET(cal->prev_item)->widget;
next_widget = GNOME_CANVAS_WIDGET(cal->next_item)->widget;
+#if GTK_CHECK_VERSION(2,19,7)
+ ret_val = gtk_widget_has_focus (prev_widget) ||
+ gtk_widget_has_focus (next_widget);
+#else
ret_val = GTK_WIDGET_HAS_FOCUS (prev_widget) ||
GTK_WIDGET_HAS_FOCUS (next_widget);
+#endif
return ret_val;
}
@@ -586,7 +595,11 @@ e_calendar_focus (GtkWidget *widget, GtkDirectionType direction)
children[2] = cal->next_item;
/* get current focused item, if e-calendar has had focus */
+#if GTK_CHECK_VERSION(2,19,7)
+ if (gtk_widget_has_focus (widget) || e_calendar_button_has_focus (cal))
+#else
if (GTK_WIDGET_HAS_FOCUS (widget) || e_calendar_button_has_focus (cal))
+#endif
for (index = 0; index < E_CALENDAR_FOCUS_CHILDREN_NUM; ++index) {
if (canvas->focused_item == NULL)
break;
@@ -636,7 +649,11 @@ e_calendar_set_focusable (ECalendar *cal, gboolean focusable)
GTK_WIDGET_SET_FLAGS (next_widget, GTK_CAN_FOCUS);
}
else {
+#if GTK_CHECK_VERSION(2,19,7)
+ if (gtk_widget_has_focus (GTK_WIDGET (cal)) || e_calendar_button_has_focus (cal)) {
+#else
if (GTK_WIDGET_HAS_FOCUS (cal) || e_calendar_button_has_focus (cal)) {
+#endif
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (cal));
if (toplevel)
gtk_widget_grab_focus (toplevel);
diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c
index ab70082e95..3b4cbadd20 100644
--- a/widgets/misc/e-canvas-background.c
+++ b/widgets/misc/e-canvas-background.c
@@ -437,7 +437,11 @@ ecb_style_set (ECanvasBackground *ecb,
style = gtk_widget_get_style (GTK_WIDGET (item->canvas));
+#if GTK_CHECK_VERSION(2,19,7)
+ if (gtk_widget_get_realized (GTK_WIDGET (item->canvas))) {
+#else
if (GTK_WIDGET_REALIZED (item->canvas)) {
+#endif
gdk_gc_set_foreground (
ecb->priv->gc, &style->base[GTK_STATE_NORMAL]);
gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ecb));
diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c
index 8b1a6d2409..db187b6e13 100644
--- a/widgets/misc/e-canvas.c
+++ b/widgets/misc/e-canvas.c
@@ -568,7 +568,11 @@ e_canvas_item_grab_focus (GnomeCanvasItem *item, gboolean widget_too)
item->canvas->focused_item = item;
+#if GTK_CHECK_VERSION(2,19,7)
+ if (widget_too && !gtk_widget_has_focus (GTK_WIDGET(item->canvas))) {
+#else
if (widget_too && !GTK_WIDGET_HAS_FOCUS (GTK_WIDGET(item->canvas))) {
+#endif
gtk_widget_grab_focus (GTK_WIDGET (item->canvas));
}
diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c
index acc4cb353d..db63ffaaf8 100644
--- a/widgets/misc/e-dateedit.c
+++ b/widgets/misc/e-dateedit.c
@@ -1720,7 +1720,11 @@ on_date_edit_time_selected (GtkComboBox *combo,
if (gtk_combo_box_get_active (combo) == -1)
return;
+#if GTK_CHECK_VERSION(2,19,7)
+ if (!gtk_widget_get_mapped (child))
+#else
if (!GTK_WIDGET_MAPPED (child))
+#endif
return;
e_date_edit_check_time_changed (dedit);
diff --git a/widgets/misc/e-hinted-entry.c b/widgets/misc/e-hinted-entry.c
index 0b9708ab60..24bac0087c 100644
--- a/widgets/misc/e-hinted-entry.c
+++ b/widgets/misc/e-hinted-entry.c
@@ -290,7 +290,11 @@ e_hinted_entry_set_text (EHintedEntry *entry,
if (text == NULL)
text = "";
+#if GTK_CHECK_VERSION(2,19,7)
+ if (*text == '\0' && !gtk_widget_has_focus (GTK_WIDGET (entry)))
+#else
if (*text == '\0' && !GTK_WIDGET_HAS_FOCUS (entry))
+#endif
hinted_entry_show_hint (entry);
else {
hinted_entry_hide_hint (entry);
diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c
index 809841b114..f59e33d5cd 100644
--- a/widgets/misc/e-map.c
+++ b/widgets/misc/e-map.c
@@ -382,7 +382,11 @@ e_map_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
gtk_widget_set_allocation (widget, allocation);
+#if GTK_CHECK_VERSION(2,19,7)
+ if (gtk_widget_get_realized (widget)) {
+#else
if (GTK_WIDGET_REALIZED (widget)) {
+#endif
GdkWindow *window;
window = gtk_widget_get_window (widget);
@@ -406,8 +410,12 @@ e_map_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
static gint
e_map_button_press (GtkWidget *widget, GdkEventButton *event)
{
+#if GTK_CHECK_VERSION(2,19,7)
+ if (!gtk_widget_has_focus (widget)) gtk_widget_grab_focus (widget);
+#else
if (!GTK_WIDGET_HAS_FOCUS (widget)) gtk_widget_grab_focus (widget);
- return TRUE;
+#endif
+ return TRUE;
}
/* Button release handler for the map view */
@@ -641,7 +649,11 @@ e_map_window_to_world (EMap *map, gdouble win_x, gdouble win_y, gdouble *world_l
g_return_if_fail (map);
priv = map->priv;
+#if GTK_CHECK_VERSION(2,19,7)
+ g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (map)));
+#else
g_return_if_fail (GTK_WIDGET_REALIZED (GTK_WIDGET (map)));
+#endif
width = gdk_pixbuf_get_width (priv->map_render_pixbuf);
height = gdk_pixbuf_get_height (priv->map_render_pixbuf);
@@ -694,7 +706,11 @@ e_map_zoom_to_location (EMap *map, gdouble longitude, gdouble latitude)
EMapPrivate *priv;
g_return_if_fail (map);
+#if GTK_CHECK_VERSION(2,19,7)
+ g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (map)));
+#else
g_return_if_fail (GTK_WIDGET_REALIZED (GTK_WIDGET (map)));
+#endif
priv = map->priv;
@@ -714,7 +730,11 @@ e_map_zoom_out (EMap *map)
EMapPrivate *priv;
g_return_if_fail (map);
+#if GTK_CHECK_VERSION(2,19,7)
+ g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (map)));
+#else
g_return_if_fail (GTK_WIDGET_REALIZED (GTK_WIDGET (map)));
+#endif
priv = map->priv;
@@ -950,7 +970,11 @@ update_render_pixbuf (EMap *map,
gdouble zoom;
gint i;
+#if GTK_CHECK_VERSION(2,19,7)
+ if (!gtk_widget_get_realized (GTK_WIDGET (map)))
+#else
if (!GTK_WIDGET_REALIZED (map))
+#endif
return;
gtk_widget_get_allocation (GTK_WIDGET (map), &allocation);
@@ -1015,8 +1039,13 @@ request_paint_area (EMap *view, GdkRectangle *area)
EMapPrivate *priv;
gint width, height;
+#if GTK_CHECK_VERSION(2,19,7)
+ if (!gtk_widget_is_drawable (GTK_WIDGET (view)) ||
+ !gtk_widget_get_realized (GTK_WIDGET (view))) return;
+#else
if (!GTK_WIDGET_DRAWABLE (GTK_WIDGET (view)) ||
!GTK_WIDGET_REALIZED (GTK_WIDGET (view))) return;
+#endif
priv = view->priv;
if (!priv->map_render_pixbuf) return;
@@ -1226,7 +1255,11 @@ scroll_to (EMap *view, gint x, gint y)
priv->xofs = x;
priv->yofs = y;
+#if GTK_CHECK_VERSION(2,19,7)
+ if (!gtk_widget_is_drawable (GTK_WIDGET (view)))
+#else
if (!GTK_WIDGET_DRAWABLE (view))
+#endif
return;
gtk_widget_get_allocation (GTK_WIDGET (view), &allocation);
@@ -1540,7 +1573,11 @@ zoom_in_smooth (EMap *map)
gdouble x, y;
g_return_if_fail (map);
+#if GTK_CHECK_VERSION(2,19,7)
+ g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (map)));
+#else
g_return_if_fail (GTK_WIDGET_REALIZED (GTK_WIDGET (map)));
+#endif
gtk_widget_get_allocation (GTK_WIDGET (map), &allocation);
@@ -1707,7 +1744,11 @@ set_scroll_area (EMap *view)
priv = view->priv;
+#if GTK_CHECK_VERSION(2,19,7)
+ if (!gtk_widget_get_realized (GTK_WIDGET (view))) return;
+#else
if (!GTK_WIDGET_REALIZED (GTK_WIDGET (view))) return;
+#endif
if (!priv->hadj || !priv->vadj) return;
g_object_freeze_notify (G_OBJECT (priv->hadj));
diff --git a/widgets/misc/e-online-button.c b/widgets/misc/e-online-button.c
index 444296dcef..601aaa4117 100644
--- a/widgets/misc/e-online-button.c
+++ b/widgets/misc/e-online-button.c
@@ -51,7 +51,11 @@ online_button_update_tooltip (EOnlineButton *button)
if (e_online_button_get_online (button))
tooltip = ONLINE_TOOLTIP;
+#if GTK_CHECK_VERSION(2,19,7)
+ else if (gtk_widget_get_sensitive (GTK_WIDGET (button)))
+#else
else if (GTK_WIDGET_SENSITIVE (button))
+#endif
tooltip = OFFLINE_TOOLTIP;
else
tooltip = NETWORK_UNAVAILABLE_TOOLTIP;
diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c
index 120f114bb8..06b9ef6e78 100644
--- a/widgets/misc/e-search-bar.c
+++ b/widgets/misc/e-search-bar.c
@@ -92,7 +92,11 @@ search_bar_update_tokenizer (ESearchBar *search_bar)
tokenizer = e_search_bar_get_tokenizer (search_bar);
case_sensitive = e_search_bar_get_case_sensitive (search_bar);
+#if GTK_CHECK_VERSION(2,19,7)
+ if (gtk_widget_get_visible (GTK_WIDGET (search_bar)))
+#else
if (GTK_WIDGET_VISIBLE (search_bar))
+#endif
active_search = search_bar->priv->active_search;
else
active_search = NULL;
diff --git a/widgets/misc/e-spinner.c b/widgets/misc/e-spinner.c
index c95f26b0a7..5e7833b34f 100644
--- a/widgets/misc/e-spinner.c
+++ b/widgets/misc/e-spinner.c
@@ -647,7 +647,11 @@ e_spinner_expose (GtkWidget *widget,
gint x_offset, y_offset, width, height;
GdkRectangle pix_area, dest;
+#if GTK_CHECK_VERSION(2,19,7)
+ if (!gtk_widget_is_drawable (GTK_WIDGET (spinner)))
+#else
if (!GTK_WIDGET_DRAWABLE (spinner))
+#endif
{
return FALSE;
}
@@ -738,7 +742,11 @@ e_spinner_start (ESpinner *spinner)
details->spinning = TRUE;
+#if GTK_CHECK_VERSION(2,19,7)
+ if (gtk_widget_get_mapped (GTK_WIDGET (spinner)) &&
+#else
if (GTK_WIDGET_MAPPED (GTK_WIDGET (spinner)) &&
+#endif
details->timer_task == 0 &&
e_spinner_load_images (spinner))
{
diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c
index fe9b90717f..31e6c29b99 100644
--- a/widgets/table/e-cell-combo.c
+++ b/widgets/table/e-cell-combo.c
@@ -494,7 +494,11 @@ e_cell_combo_selection_changed (GtkTreeSelection *selection, ECellCombo *ecc)
GtkTreeIter iter;
GtkTreeModel *model;
+#if GTK_CHECK_VERSION(2,19,7)
+ if (!gtk_widget_get_realized (ecc->popup_window) || !gtk_tree_selection_get_selected (selection, &model, &iter))
+#else
if (!GTK_WIDGET_REALIZED (ecc->popup_window) || !gtk_tree_selection_get_selected (selection, &model, &iter))
+#endif
return;
e_cell_combo_update_cell (ecc);
@@ -597,7 +601,11 @@ e_cell_combo_key_press (GtkWidget *popup_window,
&& event->keyval != GDK_3270_Enter)
return FALSE;
+#if GTK_CHECK_VERSION(2,19,7)
+ if (event->keyval == GDK_Escape && (!ecc->popup_window||!gtk_widget_get_visible (ecc->popup_window)))
+#else
if (event->keyval == GDK_Escape && (!ecc->popup_window||!GTK_WIDGET_VISIBLE (ecc->popup_window)))
+#endif
return FALSE;
gtk_grab_remove (ecc->popup_window);
diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c
index 1d27b292d0..692614ff14 100644
--- a/widgets/table/e-cell-date-edit.c
+++ b/widgets/table/e-cell-date-edit.c
@@ -383,16 +383,32 @@ e_cell_date_edit_get_property (GObject *object,
switch (property_id) {
case PROP_SHOW_TIME:
+#if GTK_CHECK_VERSION(2,19,7)
+ g_value_set_boolean (value, gtk_widget_get_visible (ecde->time_entry));
+#else
g_value_set_boolean (value, GTK_WIDGET_VISIBLE (ecde->time_entry));
+#endif
return;
case PROP_SHOW_NOW_BUTTON:
+#if GTK_CHECK_VERSION(2,19,7)
+ g_value_set_boolean (value, gtk_widget_get_visible (ecde->now_button));
+#else
g_value_set_boolean (value, GTK_WIDGET_VISIBLE (ecde->now_button));
+#endif
return;
case PROP_SHOW_TODAY_BUTTON:
+#if GTK_CHECK_VERSION(2,19,7)
+ g_value_set_boolean (value, gtk_widget_get_visible (ecde->today_button));
+#else
g_value_set_boolean (value, GTK_WIDGET_VISIBLE (ecde->today_button));
+#endif
return;
case PROP_ALLOW_NO_DATE_SET:
+#if GTK_CHECK_VERSION(2,19,7)
+ g_value_set_boolean (value, gtk_widget_get_visible (ecde->none_button));
+#else
g_value_set_boolean (value, GTK_WIDGET_VISIBLE (ecde->none_button));
+#endif
return;
case PROP_USE_24_HOUR_FORMAT:
g_value_set_boolean (value, ecde->use_24_hour_format);
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index 57dd88e17d..f9d3441d6f 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -735,7 +735,11 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable,
selected = flags & E_CELL_SELECTED;
if (selected) {
+#if GTK_CHECK_VERSION(2,19,7)
+ if (gtk_widget_has_focus (canvas))
+#else
if (GTK_WIDGET_HAS_FOCUS (canvas))
+#endif
foreground = &canvas->style->fg [GTK_STATE_SELECTED];
else
foreground = &canvas->style->fg [GTK_STATE_ACTIVE];
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 06e847f40e..22a0848d7f 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -251,7 +251,11 @@ eti_get_cell_background_color (ETableItem *eti, gint row, gint col, gboolean sel
gboolean allocated = FALSE;
if (selected) {
+#if GTK_CHECK_VERSION(2,19,7)
+ if (gtk_widget_has_focus (canvas))
+#else
if (GTK_WIDGET_HAS_FOCUS(canvas))
+#endif
background = &canvas->style->bg [GTK_STATE_SELECTED];
else
background = &canvas->style->bg [GTK_STATE_ACTIVE];
@@ -299,7 +303,11 @@ eti_get_cell_foreground_color (ETableItem *eti, gint row, gint col, gboolean sel
*allocated = FALSE;
if (selected) {
+#if GTK_CHECK_VERSION(2,19,7)
+ if (gtk_widget_has_focus (canvas))
+#else
if (GTK_WIDGET_HAS_FOCUS (canvas))
+#endif
foreground = &canvas->style->fg [GTK_STATE_SELECTED];
else
foreground = &canvas->style->fg [GTK_STATE_ACTIVE];
@@ -1925,7 +1933,11 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid
gdk_color_free (background);
flags = col_selected ? E_CELL_SELECTED : 0;
+#if GTK_CHECK_VERSION(2,19,7)
+ flags |= gtk_widget_has_focus (canvas) ? E_CELL_FOCUSED : 0;
+#else
flags |= GTK_WIDGET_HAS_FOCUS(canvas) ? E_CELL_FOCUSED : 0;
+#endif
flags |= cursor ? E_CELL_CURSOR : 0;
switch (ecol->justification) {
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index fcf56da531..8110732e2c 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -1052,7 +1052,11 @@ et_eti_leave_edit (ETable *et)
{
GnomeCanvas *canvas = et->table_canvas;
+#if GTK_CHECK_VERSION(2,19,7)
+ if (gtk_widget_has_focus (GTK_WIDGET (canvas))) {
+#else
if (GTK_WIDGET_HAS_FOCUS(canvas)) {
+#endif
GnomeCanvasItem *item = GNOME_CANVAS(canvas)->focused_item;
if (E_IS_TABLE_ITEM(item)) {
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index af1d15a1c4..ac1fcdd2d7 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -1053,7 +1053,11 @@ et_canvas_root_event (GnomeCanvasItem *root, GdkEvent *event, ETree *e_tree)
case GDK_2BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
if (event->button.button != 4 && event->button.button != 5) {
+#if GTK_CHECK_VERSION(2,19,7)
+ if (gtk_widget_has_focus (GTK_WIDGET (root->canvas))) {
+#else
if (GTK_WIDGET_HAS_FOCUS(root->canvas)) {
+#endif
GnomeCanvasItem *item = GNOME_CANVAS(root->canvas)->focused_item;
if (E_IS_TABLE_ITEM(item)) {
diff --git a/widgets/table/gal-a11y-e-table.c b/widgets/table/gal-a11y-e-table.c
index bf75227af4..37e5b892d2 100644
--- a/widgets/table/gal-a11y-e-table.c
+++ b/widgets/table/gal-a11y-e-table.c
@@ -90,7 +90,11 @@ init_child_item (GalA11yETable *a11y)
return FALSE;
table = E_TABLE (GTK_ACCESSIBLE (a11y)->widget);
+#if GTK_CHECK_VERSION(2,19,7)
+ if (table && gtk_widget_get_mapped (GTK_WIDGET (table)) && table->group && E_IS_TABLE_GROUP_CONTAINER(table->group)) {
+#else
if (table && GTK_WIDGET_MAPPED (GTK_WIDGET (table)) && table->group && E_IS_TABLE_GROUP_CONTAINER(table->group)) {
+#endif
ETableGroupContainer *etgc = (ETableGroupContainer *)table->group;
GList *list;
@@ -284,7 +288,11 @@ gal_a11y_e_table_new (GObject *widget)
GTK_ACCESSIBLE (a11y)->widget = GTK_WIDGET (widget);
/* we need to init all the children for multiple table items */
+#if GTK_CHECK_VERSION(2,19,7)
+ if (table && gtk_widget_get_mapped (GTK_WIDGET (table)) && table->group && E_IS_TABLE_GROUP_CONTAINER (table->group)) {
+#else
if (table && GTK_WIDGET_MAPPED (GTK_WIDGET (table)) && table->group && E_IS_TABLE_GROUP_CONTAINER (table->group)) {
+#endif
/* Ref it here so that it is still valid in the idle function */
/* It will be unrefed in the idle function */
g_object_ref (a11y);
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c
index e31b3e519b..f964ae9bb1 100644
--- a/widgets/text/e-text.c
+++ b/widgets/text/e-text.c
@@ -1439,7 +1439,11 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
widget = gtk_widget_get_parent (widget);
while (widget && !GTK_IS_BUTTON(widget)) {
+#if GTK_CHECK_VERSION(2,19,7)
+ if (gtk_widget_get_has_window (widget)) {
+#else
if (!GTK_WIDGET_NO_WINDOW (widget)) {
+#endif
widget = NULL;
break;
}
@@ -1494,7 +1498,11 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
thisy += (1 + default_spacing) / 2;
}
+#if GTK_CHECK_VERSION(2,19,7)
+ if (gtk_widget_has_focus (widget)) {
+#else
if (GTK_WIDGET_HAS_FOCUS (widget)) {
+#endif
thisx += 1;
thisy += 1;
thiswidth -= 2;
@@ -1514,7 +1522,11 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
thisx + xoff, thisy + yoff,
thiswidth, thisheight);
+#if GTK_CHECK_VERSION(2,19,7)
+ if (gtk_widget_has_focus (widget)) {
+#else
if (GTK_WIDGET_HAS_FOCUS (widget)) {
+#endif
thisx -= 1;
thisy -= 1;
thiswidth += 2;