Ticket #1930: gtk_widget_has_focus.patch

File gtk_widget_has_focus.patch, 2.1 KB (added by chiragjain1989, 13 years ago)

patch for the depreciated macro GTK_WIDGET_HAS_FOCUS

  • gtk/engine/sugar-info.c

    diff -Nur -x '*.orig' -x '*~' sugar-artwork-0.88.0/gtk/engine/sugar-info.c sugar-artwork-0.88.0.new/gtk/engine/sugar-info.c
    old new  
    7171    gdouble line_width = info->rc_style->line_width;
    7272
    7373    if (info->widget) {
    74         range_info->focused = GTK_WIDGET_HAS_FOCUS (info->widget);
     74        range_info->focused = gtk_widget_has_focus (info->widget);
    7575    } else {
    7676        /* Fall back to unfocused and orientation from the width/height. */
    7777        range_info->focused = FALSE;
  • gtk/engine/sugar-style.c

    diff -Nur -x '*.orig' -x '*~' sugar-artwork-0.88.0/gtk/engine/sugar-style.c sugar-artwork-0.88.0.new/gtk/engine/sugar-style.c
    old new  
    415415        sugar_draw_button (cr, &info);
    416416
    417417        /* Spinbutton focus hack. */
    418         if (widget && GTK_WIDGET_HAS_FOCUS (widget)) {
     418        if (widget && gtk_widget_has_focus (widget)) {
    419419            /* Draw a focus for the spinbutton */
    420420            sugar_style_draw_focus (style, window, GTK_STATE_NORMAL, area, widget, detail, x, y, width, height);
    421421        }
     
    585585{
    586586    /* Hack to change the entries background when it has the focus. */
    587587    if (DETAIL ("entry_bg")) {
    588         if (widget && GTK_WIDGET_HAS_FOCUS (widget)) {
     588        if (widget && gtk_widget_has_focus (widget)) {
    589589            state_type = GTK_STATE_ACTIVE;
    590590        }
    591591    } else if (DETAIL ("radiobutton") || DETAIL ("checkbutton")) {
     
    638638        /* XXX: This fakes an ACTIVE state for the focused entry.
    639639         *      Getting this changed in GTK+ with a style property would be cleaner
    640640         *      as that also works for the font colors. (see also draw_flat_box) */
    641         if (widget && GTK_WIDGET_HAS_FOCUS (widget)) {
     641        if (widget && gtk_widget_has_focus (widget)) {
    642642            info.state = GTK_STATE_ACTIVE;
    643643        }
    644644        if (widget && !gtk_widget_is_sensitive (widget)) {