diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-01-31 03:03:19 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-04-08 23:05:26 +0800 |
commit | 72797decc12602b181f69dba7c54df7a0d1b9326 (patch) | |
tree | ecd1314c92bc26b59647b351b2d47e446f4ed21d /calendar/gui/e-calendar-view.c | |
parent | 3ba0b61f9f447b01c3a83bfb78ee33a45d413700 (diff) | |
download | gsoc2013-evolution-72797decc12602b181f69dba7c54df7a0d1b9326.tar.gz gsoc2013-evolution-72797decc12602b181f69dba7c54df7a0d1b9326.tar.zst gsoc2013-evolution-72797decc12602b181f69dba7c54df7a0d1b9326.zip |
Giant leap towards GSEAL compliance.
Diffstat (limited to 'calendar/gui/e-calendar-view.c')
-rw-r--r-- | calendar/gui/e-calendar-view.c | 73 |
1 files changed, 39 insertions, 34 deletions
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index d99de8ae50..48b29337d5 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -1652,39 +1652,42 @@ get_label (struct icaltimetype *tt, icaltimezone *f_zone, icaltimezone *t_zone) void e_calendar_view_move_tip (GtkWidget *widget, gint x, gint y) { - GtkRequisition requisition; - gint w, h; - GdkScreen *screen; - GdkScreen *pointer_screen; - gint monitor_num, px, py; - GdkRectangle monitor; - - screen = gtk_widget_get_screen (widget); - - gtk_widget_size_request (widget, &requisition); - w = requisition.width; - h = requisition.height; - - gdk_display_get_pointer (gdk_screen_get_display (screen), - &pointer_screen, &px, &py, NULL); - if (pointer_screen != screen) - { - px = x; - py = y; - } - monitor_num = gdk_screen_get_monitor_at_point (screen, px, py); - gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); - - if ((x + w) > monitor.x + monitor.width) - x -= (x + w) - (monitor.x + monitor.width); - else if (x < monitor.x) - x = monitor.x; - - if ((y + h + widget->allocation.height + 4) > monitor.y + monitor.height) - y = y - h - 36; - - gtk_window_move (GTK_WINDOW (widget), x, y); - gtk_widget_show (widget); + GtkAllocation allocation; + GtkRequisition requisition; + gint w, h; + GdkScreen *screen; + GdkScreen *pointer_screen; + gint monitor_num, px, py; + GdkRectangle monitor; + + screen = gtk_widget_get_screen (widget); + + gtk_widget_size_request (widget, &requisition); + w = requisition.width; + h = requisition.height; + + gdk_display_get_pointer ( + gdk_screen_get_display (screen), + &pointer_screen, &px, &py, NULL); + if (pointer_screen != screen) { + px = x; + py = y; + } + monitor_num = gdk_screen_get_monitor_at_point (screen, px, py); + gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); + + if ((x + w) > monitor.x + monitor.width) + x -= (x + w) - (monitor.x + monitor.width); + else if (x < monitor.x) + x = monitor.x; + + gtk_widget_get_allocation (widget, &allocation); + + if ((y + h + allocation.height + 4) > monitor.y + monitor.height) + y = y - h - 36; + + gtk_window_move (GTK_WINDOW (widget), x, y); + gtk_widget_show (widget); } /** @@ -1787,6 +1790,7 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) ECalendarViewEvent *pevent; GtkStyle *style = gtk_widget_get_default_style (); GtkWidget *widget = (GtkWidget *) g_object_get_data (G_OBJECT (data->cal_view), "tooltip-window"); + GdkWindow *window; ECalComponent *newcomp = e_cal_component_new (); icaltimezone *zone, *default_zone; ECal *client = NULL; @@ -1946,7 +1950,8 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) e_calendar_view_move_tip (pevent->tooltip, pevent->x +16, pevent->y+16); - gdk_keyboard_grab (pevent->tooltip->window, FALSE, GDK_CURRENT_TIME); + window = gtk_widget_get_window (pevent->tooltip); + gdk_keyboard_grab (window, FALSE, GDK_CURRENT_TIME); g_signal_connect (pevent->tooltip, "key-press-event", G_CALLBACK (tooltip_grab), data->cal_view); pevent->timeout = -1; |