aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view.c
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 /calendar/gui/e-day-view.c
parentbaa7f20333a5bbb7c8cbb3cf2ce86b57aba79ef2 (diff)
downloadgsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.tar
gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.tar.gz
gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.tar.bz2
gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.tar.lz
gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.tar.xz
gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.tar.zst
gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.zip
Work around recent GTK+ deprecations.
Diffstat (limited to 'calendar/gui/e-day-view.c')
-rw-r--r--calendar/gui/e-day-view.c24
1 files changed, 24 insertions, 0 deletions
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,