diff options
48 files changed, 360 insertions, 2 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index d9a0e1ab86..f7c308009a 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -3375,7 +3375,11 @@ expand_phone_toggle (EContactEditor *ce) GtkWidget *phone_ext_table; phone_ext_table = e_builder_get_widget (ce->builder, "table-phone-extended"); +#if GTK_CHECK_VERSION(2,19,7) + expand_phone (ce, gtk_widget_get_visible (phone_ext_table) ? FALSE : TRUE); +#else expand_phone (ce, GTK_WIDGET_VISIBLE (phone_ext_table) ? FALSE : TRUE); +#endif } static void diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c index 7f6788bf4b..e6f9791731 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.c +++ b/addressbook/gui/widgets/e-minicard-view-widget.c @@ -420,7 +420,11 @@ e_minicard_view_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocatio if (GTK_WIDGET_CLASS(parent_class)->size_allocate) GTK_WIDGET_CLASS(parent_class)->size_allocate (widget, allocation); +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_get_realized (widget)) { +#else if (GTK_WIDGET_REALIZED(widget)) { +#endif gdouble width; EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(widget); diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.c b/calendar/gui/alarm-notify/alarm-notify-dialog.c index 7062ccb376..a6259d69ab 100644 --- a/calendar/gui/alarm-notify/alarm-notify-dialog.c +++ b/calendar/gui/alarm-notify/alarm-notify-dialog.c @@ -310,8 +310,12 @@ notified_alarms_dialog_new (void) g_signal_connect (G_OBJECT (an->dialog), "response", G_CALLBACK (dialog_response_cb), an); g_signal_connect (G_OBJECT (an->dialog), "destroy", G_CALLBACK (dialog_destroyed_cb), an); +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_get_realized (an->dialog)) +#else if (!GTK_WIDGET_REALIZED (an->dialog)) - gtk_widget_realize (an->dialog); +#endif + gtk_widget_realize (an->dialog); gtk_window_set_icon_name (GTK_WINDOW (an->dialog), "stock_alarm"); diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index bef407c8dd..7d79a2bfb7 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -2457,7 +2457,11 @@ safe_to_process_date_changed_signal (GtkWidget *dedit_widget) entry = e_date_edit_get_entry (dedit); +#if GTK_CHECK_VERSION(2,19,7) + return !entry || !gtk_widget_has_focus (entry); +#else return !entry || !GTK_WIDGET_HAS_FOCUS (entry); +#endif } /* Callback used when the start date widget change. We check that the diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index e71a3445ae..6bb9f18e28 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -900,7 +900,11 @@ fill_component (RecurrencePage *rpage, ECalComponent *comp) e_cal_component_set_exdate_list (comp, list); e_cal_component_free_exdate_list (list); +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_get_visible (priv->ending_combo) && gtk_widget_get_sensitive (priv->ending_combo) && +#else if (GTK_WIDGET_VISIBLE (priv->ending_combo) && GTK_WIDGET_IS_SENSITIVE (priv->ending_combo) && +#endif e_dialog_combo_box_get (priv->ending_combo, ending_types_map) == ENDING_UNTIL) { /* check whether the "until" date is in the future */ struct icaltimetype tt; diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c index 6c234bf3d1..11baebf67b 100644 --- a/calendar/gui/e-day-view-main-item.c +++ b/calendar/gui/e-day-view-main-item.c @@ -279,7 +279,11 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, g_object_get (G_OBJECT (event->canvas_item), "x_offset", &text_x_offset, NULL); /* Draw shadow around the event when selected */ +#if GTK_CHECK_VERSION(2,19,7) + if (is_editing && (gtk_widget_has_focus (day_view->main_canvas))) { +#else if (is_editing && (GTK_WIDGET_HAS_FOCUS (day_view->main_canvas))) { +#endif /* For embossing Item selection */ item_x -= 1; item_y -= 2; @@ -1099,7 +1103,11 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item, if (can_draw_in_region (draw_region, rect_x, rect_y, rect_width, rect_height)) { cairo_save (cr); +#if GTK_CHECK_VERSION(2,19,7) + gdk_cairo_set_source_color (cr, &day_view->colors[gtk_widget_has_focus (GTK_WIDGET (day_view)) ? E_DAY_VIEW_COLOR_BG_SELECTED : E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED]); +#else gdk_cairo_set_source_color (cr, &day_view->colors[GTK_WIDGET_HAS_FOCUS(day_view) ? E_DAY_VIEW_COLOR_BG_SELECTED : E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED]); +#endif cairo_rectangle (cr, rect_x, rect_y, rect_width, rect_height); cairo_fill (cr); cairo_restore (cr); diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c index 94f2327185..6f7b8313c0 100644 --- a/calendar/gui/e-day-view-time-item.c +++ b/calendar/gui/e-day-view-time-item.c @@ -868,7 +868,11 @@ e_day_view_time_item_on_button_press (EDayViewTimeItem *time_item, if (row == -1) return; +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_has_focus (GTK_WIDGET (day_view))) +#else if (!GTK_WIDGET_HAS_FOCUS (day_view)) +#endif gtk_widget_grab_focus (GTK_WIDGET (day_view)); if (gdk_pointer_grab (GTK_LAYOUT (canvas)->bin_window, FALSE, diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c index 6b6a6fd8f7..4012ba6289 100644 --- a/calendar/gui/e-day-view-top-item.c +++ b/calendar/gui/e-day-view-top-item.c @@ -648,7 +648,11 @@ day_view_top_item_draw (GnomeCanvasItem *canvas_item, cairo_restore (cr); /* Draw the selection background. */ +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_has_focus (GTK_WIDGET (day_view)) +#else if (GTK_WIDGET_HAS_FOCUS (day_view) +#endif && day_view->selection_start_day != -1) { gint start_col, end_col, rect_x, rect_y, rect_w, rect_h; diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 3800fd69c6..3df599f5d7 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -3161,7 +3161,11 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget, return TRUE; } +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_has_focus (GTK_WIDGET (day_view))) +#else if (!GTK_WIDGET_HAS_FOCUS (day_view)) +#endif gtk_widget_grab_focus (GTK_WIDGET (day_view)); if (gdk_pointer_grab (GTK_LAYOUT (widget)->bin_window, FALSE, @@ -3174,7 +3178,11 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget, e_day_view_start_selection (day_view, day, -1); } } else if (event->button == 3) { +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_has_focus (GTK_WIDGET (day_view))) +#else if (!GTK_WIDGET_HAS_FOCUS (day_view)) +#endif gtk_widget_grab_focus (GTK_WIDGET (day_view)); if (day < day_view->selection_start_day || day > day_view->selection_end_day) { @@ -3299,7 +3307,11 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget, return TRUE; } +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_has_focus (GTK_WIDGET (day_view)) && !gtk_widget_has_focus (GTK_WIDGET (day_view->main_canvas))) +#else if (!GTK_WIDGET_HAS_FOCUS (day_view) && !GTK_WIDGET_HAS_FOCUS (day_view->main_canvas)) +#endif gtk_widget_grab_focus (GTK_WIDGET (day_view)); if (gdk_pointer_grab (GTK_LAYOUT (widget)->bin_window, FALSE, @@ -3313,7 +3325,11 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget, g_signal_emit_by_name (day_view, "selected_time_changed"); } } else if (event->button == 3) { +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_has_focus (GTK_WIDGET (day_view))) +#else if (!GTK_WIDGET_HAS_FOCUS (day_view)) +#endif gtk_widget_grab_focus (GTK_WIDGET (day_view)); if ((day < day_view->selection_start_day || day > day_view->selection_end_day) @@ -3496,7 +3512,11 @@ e_day_view_on_long_event_click (EDayView *day_view, /* Grab the keyboard focus, so the event being edited is saved and we can use the Escape key to abort the resize. */ +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_has_focus (GTK_WIDGET (day_view))) +#else if (!GTK_WIDGET_HAS_FOCUS (day_view)) +#endif gtk_widget_grab_focus (GTK_WIDGET (day_view)); if (gdk_pointer_grab (GTK_LAYOUT (day_view->top_canvas)->bin_window, FALSE, @@ -3566,7 +3586,11 @@ e_day_view_on_event_click (EDayView *day_view, /* Grab the keyboard focus, so the event being edited is saved and we can use the Escape key to abort the resize. */ +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_has_focus (GTK_WIDGET (day_view))) +#else if (!GTK_WIDGET_HAS_FOCUS (day_view)) +#endif gtk_widget_grab_focus (GTK_WIDGET (day_view)); if (gdk_pointer_grab (GTK_LAYOUT (day_view->main_canvas)->bin_window, FALSE, diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c index 9998cb2445..19a572d6d8 100644 --- a/calendar/gui/e-meeting-time-sel.c +++ b/calendar/gui/e-meeting-time-sel.c @@ -1653,7 +1653,11 @@ e_meeting_time_selector_on_update_free_busy (GtkWidget *button, { /* Make sure the menu pops down, which doesn't happen by default if keyboard accelerators are used. */ +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_get_visible (mts->options_menu)) +#else if (GTK_WIDGET_VISIBLE (mts->options_menu)) +#endif gtk_menu_popdown (GTK_MENU (mts->options_menu)); e_meeting_time_selector_refresh_free_busy (mts, 0, TRUE); @@ -1700,7 +1704,11 @@ e_meeting_time_selector_on_autopick_option_toggled (GtkWidget *button, { /* Make sure the menu pops down, which doesn't happen by default if keyboard accelerators are used. */ +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_get_visible (mts->autopick_menu)) +#else if (GTK_WIDGET_VISIBLE (mts->autopick_menu)) +#endif gtk_menu_popdown (GTK_MENU (mts->autopick_menu)); } @@ -2100,7 +2108,11 @@ e_meeting_time_selector_on_zoomed_out_toggled (GtkWidget *menuitem, { /* Make sure the menu pops down, which doesn't happen by default if keyboard accelerators are used. */ +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_get_visible (mts->options_menu)) +#else if (GTK_WIDGET_VISIBLE (mts->options_menu)) +#endif gtk_menu_popdown (GTK_MENU (mts->options_menu)); e_meeting_time_selector_set_zoomed_out (mts, GTK_CHECK_MENU_ITEM (menuitem)->active); @@ -2113,7 +2125,11 @@ e_meeting_time_selector_on_working_hours_toggled (GtkWidget *menuitem, { /* Make sure the menu pops down, which doesn't happen by default if keyboard accelerators are used. */ +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_get_visible (mts->options_menu)) +#else if (GTK_WIDGET_VISIBLE (mts->options_menu)) +#endif gtk_menu_popdown (GTK_MENU (mts->options_menu)); e_meeting_time_selector_set_working_hours_only (mts, GTK_CHECK_MENU_ITEM (menuitem)->active); diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c index 24eded5223..3f1d8f1bb3 100644 --- a/calendar/gui/e-memo-table.c +++ b/calendar/gui/e-memo-table.c @@ -911,7 +911,11 @@ memo_table_paste_clipboard (ESelectable *selectable) /* Paste text into a cell being edited. */ if (gtk_clipboard_wait_is_text_available (clipboard) && +#if GTK_CHECK_VERSION(2,19,7) + gtk_widget_has_focus (GTK_WIDGET (table_canvas)) && +#else GTK_WIDGET_HAS_FOCUS (table_canvas) && +#endif E_IS_TABLE_ITEM (item) && E_TABLE_ITEM (item)->editing_col >= 0 && E_TABLE_ITEM (item)->editing_row >= 0) { diff --git a/calendar/gui/e-task-table.c b/calendar/gui/e-task-table.c index e9f3645b30..9a3a9af210 100644 --- a/calendar/gui/e-task-table.c +++ b/calendar/gui/e-task-table.c @@ -1132,7 +1132,11 @@ task_table_paste_clipboard (ESelectable *selectable) /* Paste text into a cell being edited. */ if (gtk_clipboard_wait_is_text_available (clipboard) && +#if GTK_CHECK_VERSION(2,19,7) + gtk_widget_has_focus (GTK_WIDGET (table_canvas)) && +#else GTK_WIDGET_HAS_FOCUS (table_canvas) && +#endif E_IS_TABLE_ITEM (item) && E_TABLE_ITEM (item)->editing_col >= 0 && E_TABLE_ITEM (item)->editing_row >= 0) { diff --git a/calendar/gui/e-timezone-entry.c b/calendar/gui/e-timezone-entry.c index a01c060491..309661a2db 100644 --- a/calendar/gui/e-timezone-entry.c +++ b/calendar/gui/e-timezone-entry.c @@ -236,20 +236,44 @@ timezone_entry_focus (GtkWidget *widget, priv = E_TIMEZONE_ENTRY_GET_PRIVATE (widget); if (direction == GTK_DIR_TAB_FORWARD) { +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_has_focus (priv->entry)) +#else if (GTK_WIDGET_HAS_FOCUS (priv->entry)) +#endif gtk_widget_grab_focus (priv->button); +#if GTK_CHECK_VERSION(2,19,7) + else if (gtk_widget_has_focus (priv->button)) +#else else if (GTK_WIDGET_HAS_FOCUS (priv->button)) +#endif return FALSE; +#if GTK_CHECK_VERSION(2,19,7) + else if (gtk_widget_get_visible (priv->entry)) +#else else if (GTK_WIDGET_VISIBLE (priv->entry)) +#endif gtk_widget_grab_focus (priv->entry); else gtk_widget_grab_focus (priv->button); } else if (direction == GTK_DIR_TAB_BACKWARD) { +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_has_focus (priv->entry)) +#else if (GTK_WIDGET_HAS_FOCUS (priv->entry)) +#endif return FALSE; +#if GTK_CHECK_VERSION(2,19,7) + else if (gtk_widget_has_focus (priv->button)) { +#else else if (GTK_WIDGET_HAS_FOCUS (priv->button)) { +#endif +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_get_visible (priv->entry)) +#else if (GTK_WIDGET_VISIBLE (priv->entry)) +#endif gtk_widget_grab_focus (priv->entry); else return FALSE; diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c index 7971ebb2a8..90d8831747 100644 --- a/calendar/gui/e-week-view-event-item.c +++ b/calendar/gui/e-week-view-event-item.c @@ -201,7 +201,11 @@ week_view_event_item_button_press (EWeekViewEventItem *event_item, return TRUE; } else if (bevent->button.button == 3) { +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_has_focus (GTK_WIDGET (week_view))) { +#else if (!GTK_WIDGET_HAS_FOCUS (week_view)) { +#endif gtk_widget_grab_focus (GTK_WIDGET (week_view)); if (week_view->event_destroyed) { week_view->event_destroyed = FALSE; diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c index 04b77311d6..eb8de3af9a 100644 --- a/calendar/gui/e-week-view-main-item.c +++ b/calendar/gui/e-week-view-main-item.c @@ -169,7 +169,11 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, || week_view->selection_end_day < day) selected = FALSE; if (selected) { +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_has_focus (GTK_WIDGET (week_view))) { +#else if (GTK_WIDGET_HAS_FOCUS (week_view)) { +#endif gdk_cairo_set_source_color (cr, &week_view->colors[E_WEEK_VIEW_COLOR_SELECTED]); } else { gdk_cairo_set_source_color (cr, &week_view->colors[E_WEEK_VIEW_COLOR_SELECTED]); diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 2c44d26458..c319520924 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -2365,7 +2365,11 @@ e_week_view_on_button_press (GtkWidget *widget, if (event->button == 1) { /* Start the selection drag. */ +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_has_focus (GTK_WIDGET (week_view)) && !gtk_widget_has_focus (GTK_WIDGET (week_view->main_canvas))) +#else if (!GTK_WIDGET_HAS_FOCUS (week_view) && !GTK_WIDGET_HAS_FOCUS (week_view->main_canvas)) +#endif gtk_widget_grab_focus (GTK_WIDGET (week_view)); if (gdk_pointer_grab (GTK_LAYOUT (widget)->bin_window, FALSE, @@ -2384,7 +2388,11 @@ e_week_view_on_button_press (GtkWidget *widget, gtk_widget_queue_draw (week_view->main_canvas); } } else if (event->button == 3) { +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_has_focus (GTK_WIDGET (week_view))) +#else if (!GTK_WIDGET_HAS_FOCUS (week_view)) +#endif gtk_widget_grab_focus (GTK_WIDGET (week_view)); if (day < week_view->selection_start_day || day > week_view->selection_end_day) { @@ -3391,7 +3399,11 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, e = &g_array_index (week_view->events, EWeekViewEvent, event_num); +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_has_focus (GTK_WIDGET (week_view))) +#else if (!GTK_WIDGET_HAS_FOCUS (week_view)) +#endif gtk_widget_grab_focus (GTK_WIDGET (week_view)); e_week_view_set_selected_time_range_visible (week_view, e->start, e->end); diff --git a/calendar/gui/ea-cal-view.c b/calendar/gui/ea-cal-view.c index 2a1c128059..ceffaa0483 100644 --- a/calendar/gui/ea-cal-view.c +++ b/calendar/gui/ea-cal-view.c @@ -331,7 +331,11 @@ action_interface_do_action (AtkAction *action, gint index) */ return FALSE; +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_get_sensitive (widget) || !gtk_widget_get_visible (widget)) +#else if (!GTK_WIDGET_IS_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget)) +#endif return FALSE; cal_view = E_CALENDAR_VIEW (widget); @@ -395,7 +399,11 @@ action_interface_get_keybinding (AtkAction *action, gint index) */ return NULL; +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_get_sensitive (widget) || !gtk_widget_get_visible (widget)) +#else if (!GTK_WIDGET_IS_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget)) +#endif return NULL; switch (index) { diff --git a/calendar/gui/ea-day-view.c b/calendar/gui/ea-day-view.c index 1d0199df3a..c75bf89f7b 100644 --- a/calendar/gui/ea-day-view.c +++ b/calendar/gui/ea-day-view.c @@ -133,7 +133,11 @@ ea_day_view_get_name (AtkObject *accessible) day_view = E_DAY_VIEW (GTK_ACCESSIBLE (accessible)->widget); gcal = e_calendar_view_get_calendar (E_CALENDAR_VIEW (day_view)); +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_get_visible (GTK_WIDGET (gcal))) +#else if (!GTK_WIDGET_VISIBLE (GTK_WIDGET (gcal))) +#endif return NULL; label_text = ea_gnome_calendar_get_label_description (gcal); diff --git a/calendar/gui/ea-week-view.c b/calendar/gui/ea-week-view.c index 6e9751eb27..c3b4658e78 100644 --- a/calendar/gui/ea-week-view.c +++ b/calendar/gui/ea-week-view.c @@ -134,7 +134,11 @@ ea_week_view_get_name (AtkObject *accessible) week_view = E_WEEK_VIEW (GTK_ACCESSIBLE (accessible)->widget); gcal = e_calendar_view_get_calendar (E_CALENDAR_VIEW (week_view)); +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_get_visible (GTK_WIDGET (gcal))) +#else if (!GTK_WIDGET_VISIBLE (GTK_WIDGET (gcal))) +#endif return NULL; label_text = ea_gnome_calendar_get_label_description (gcal); diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 987d3dad9c..8c48b8eafb 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1993,7 +1993,11 @@ gnome_calendar_update_date_navigator (GnomeCalendar *gcal) return; /* If the ECalendar isn't visible, we just return. */ +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_get_visible (GTK_WIDGET (priv->date_navigator))) +#else if (!GTK_WIDGET_VISIBLE (priv->date_navigator)) +#endif return; if (priv->current_view_type == GNOME_CAL_LIST_VIEW && !priv->lview_select_daten_range) diff --git a/calendar/gui/tag-calendar.c b/calendar/gui/tag-calendar.c index 2eddfbfec6..2d167cfa7d 100644 --- a/calendar/gui/tag-calendar.c +++ b/calendar/gui/tag-calendar.c @@ -144,7 +144,11 @@ tag_calendar_by_client (ECalendar *ecal, ECal *client) g_return_if_fail (E_IS_CAL (client)); /* If the ECalendar isn't visible, we just return. */ +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_get_visible (GTK_WIDGET (ecal))) +#else if (!GTK_WIDGET_VISIBLE (ecal)) +#endif return; if (e_cal_get_load_state (client) != E_CAL_LOAD_LOADED) @@ -213,7 +217,11 @@ tag_calendar_by_comp (ECalendar *ecal, ECalComponent *comp, ECal *client, icalti g_return_if_fail (E_IS_CAL_COMPONENT (comp)); /* If the ECalendar isn't visible, we just return. */ +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_get_visible (GTK_WIDGET (ecal))) +#else if (!GTK_WIDGET_VISIBLE (ecal)) +#endif return; if (!prepare_tag (ecal, &c, display_zone, clear_first)) diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c index 75223ad7d8..ab06db9765 100644 --- a/calendar/gui/weekday-picker.c +++ b/calendar/gui/weekday-picker.c @@ -318,7 +318,11 @@ weekday_picker_focus (GtkWidget *widget, if (!gtk_widget_get_can_focus (widget)) return FALSE; +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_has_focus (widget)) { +#else if (GTK_WIDGET_HAS_FOCUS (widget)) { +#endif priv->focus_day = -1; colorize_items (wp); return FALSE; diff --git a/mail/e-mail-attachment-bar.c b/mail/e-mail-attachment-bar.c index 8461faf0c9..88198438b7 100644 --- a/mail/e-mail-attachment-bar.c +++ b/mail/e-mail-attachment-bar.c @@ -322,7 +322,11 @@ mail_attachment_bar_size_request (GtkWidget *widget, * get a sizable gap between the headers and body when this * widget is invisible. Once we finally move to WebKit, * remove this. */ +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_get_visible (widget)) { +#else if (!GTK_WIDGET_VISIBLE (widget)) { +#endif requisition->width = 0; requisition->height = 0; return; diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 27d00f3516..ad316e1177 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -1872,7 +1872,11 @@ mail_reader_message_selected_timeout_cb (EMailReader *reader) widget = GTK_WIDGET (EM_FORMAT_HTML (html_display)->html); +#if GTK_CHECK_VERSION(2,19,7) + html_display_visible = gtk_widget_get_mapped (widget); +#else html_display_visible = GTK_WIDGET_MAPPED (widget); +#endif selected_uid_changed = g_strcmp0 (cursor_uid, format_uid); if (html_display_visible && selected_uid_changed) { diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index fd0fe783fd..a0ed73e34a 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -953,7 +953,11 @@ efhd_optional_button_show (GtkWidget *widget, GtkWidget *w) { GtkWidget *label = g_object_get_data (G_OBJECT (widget), "text-label"); +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_get_visible (w)) { +#else if (GTK_WIDGET_VISIBLE (w)) { +#endif gtk_widget_hide (w); gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("View _Unformatted")); } else { diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index 1f2ee35a84..d66f2ab508 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -977,7 +977,11 @@ mail_send_receive (GtkWindow *parent) GList *scan; if (send_recv_dialog != NULL) { +#if GTK_CHECK_VERSION(2,19,7) + if (parent != NULL && gtk_widget_get_realized (send_recv_dialog)) { +#else if (parent != NULL && GTK_WIDGET_REALIZED (send_recv_dialog)) { +#endif gdk_window_show (send_recv_dialog->window); gdk_window_raise (send_recv_dialog->window); } diff --git a/mail/message-list.c b/mail/message-list.c index 277b116019..652695065f 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -4715,7 +4715,11 @@ regen_list_done (struct _regen_list_msg *m) } } +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_get_visible (GTK_WIDGET (m->ml))) { +#else if (GTK_WIDGET_VISIBLE (GTK_WIDGET (m->ml))) { +#endif if (message_list_length (m->ml) <= 0) { /* space is used to indicate no search too */ if (m->ml->search && *m->ml->search && strcmp (m->ml->search, " ") != 0) @@ -4882,7 +4886,11 @@ mail_regen_list (MessageList *ml, const gchar *search, const gchar *hideexpr, Ca } if (message_list_length (ml) <= 0) { +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_get_visible (GTK_WIDGET (ml))) { +#else if (GTK_WIDGET_VISIBLE (GTK_WIDGET (ml))) { +#endif /* there is some info why the message list is empty, let it be something useful */ gchar *txt = g_strconcat (_("Generating message list"), "..." , NULL); diff --git a/plugins/itip-formatter/itip-view.c b/plugins/itip-formatter/itip-view.c index 0440513329..f4368dde3f 100644 --- a/plugins/itip-formatter/itip-view.c +++ b/plugins/itip-formatter/itip-view.c @@ -970,7 +970,11 @@ alarm_check_toggled_cb (GtkWidget *check1, GtkWidget *check2) g_return_if_fail (check1 != NULL); g_return_if_fail (check2 != NULL); +#if GTK_CHECK_VERSION(2,19,7) + gtk_widget_set_sensitive (check2, !(gtk_widget_get_visible (check1) && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check1)))); +#else gtk_widget_set_sensitive (check2, !(GTK_WIDGET_VISIBLE (check1) && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check1)))); +#endif } static void diff --git a/plugins/publish-calendar/url-editor-dialog.c b/plugins/publish-calendar/url-editor-dialog.c index 0ef00205ae..37910d8f47 100644 --- a/plugins/publish-calendar/url-editor-dialog.c +++ b/plugins/publish-calendar/url-editor-dialog.c @@ -116,7 +116,11 @@ check_input (UrlEditorDialog *dialog) gtk_widget_hide (dialog->fb_duration_combo); } +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_get_sensitive (dialog->events_selector)) { +#else if (GTK_WIDGET_IS_SENSITIVE (dialog->events_selector)) { +#endif sources = e_source_selector_get_selection (E_SOURCE_SELECTOR (dialog->events_selector)); n += g_slist_length (sources); } 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; |