~ubuntu-branches/ubuntu/vivid/xfdesktop4/vivid-proposed

« back to all changes in this revision

Viewing changes to src/xfce-backdrop.c

  • Committer: Package Import Robot
  • Author(s): Sean Davis
  • Date: 2014-08-11 22:25:48 UTC
  • mfrom: (1.5.11)
  • Revision ID: package-import@ubuntu.com-20140811222548-osc1fppwc8k8r3ix
Tags: 4.11.7-0ubuntu1
* New upstream development release
* debian/patches/xubuntu_set-accountsservice-user-bg.patch: update
  patch to only update on first workspace filename change (LP: #1318307)

Show diffs side-by-side

added added

removed removed

Lines of Context:
487
487
    /* Figure out which image to display based on what time of day it is
488
488
     * and how many images we have to work with */
489
489
    epoch = (gdouble)g_date_time_get_hour(datetime) / (24.0f / MIN(n_items, 24.0f));
490
 
    DBG("epoch %d, hour %d, items %d", epoch, g_date_time_get_hour(datetime), n_items);
 
490
    XF_DEBUG("epoch %d, hour %d, items %d", epoch, g_date_time_get_hour(datetime), n_items);
491
491
 
492
492
    new_file = g_list_nth(backdrop->priv->image_files, epoch);
493
493
 
1147
1147
        /* remove old timer first */
1148
1148
        xfce_backdrop_remove_backdrop_timer(backdrop);
1149
1149
 
1150
 
        DBG("calling g_timeout_add_seconds, interval is %d", cycle_interval);
 
1150
        XF_DEBUG("calling g_timeout_add_seconds, interval is %d", cycle_interval);
1151
1151
        backdrop->priv->cycle_timer_id = g_timeout_add_seconds(cycle_interval,
1152
1152
                                                               (GSourceFunc)xfce_backdrop_timer,
1153
1153
                                                               backdrop);
1239
1239
            }
1240
1240
 
1241
1241
        if(cycle_interval != 0) {
1242
 
            DBG("calling g_timeout_add_seconds, interval is %d", cycle_interval);
 
1242
            XF_DEBUG("calling g_timeout_add_seconds, interval is %d", cycle_interval);
1243
1243
            backdrop->priv->cycle_timer_id = g_timeout_add_seconds(cycle_interval,
1244
1244
                                                                   (GSourceFunc)xfce_backdrop_timer,
1245
1245
                                                                   backdrop);
1358
1358
    return backdrop->priv->random_backdrop_order;
1359
1359
}
1360
1360
 
 
1361
void
 
1362
xfce_backdrop_force_cycle(XfceBackdrop *backdrop)
 
1363
{
 
1364
    g_return_if_fail(XFCE_IS_BACKDROP(backdrop));
 
1365
 
 
1366
    TRACE("entering");
 
1367
 
 
1368
    /* force it to update */
 
1369
    xfce_backdrop_cycle_backdrop(backdrop);
 
1370
 
 
1371
    /* Update the timer, if running */
 
1372
    xfce_backdrop_timer(backdrop);
 
1373
}
 
1374
 
1361
1375
/* Generates the background that will either be displayed or will have the
1362
1376
 * image drawn on top of */
1363
1377
static GdkPixbuf *
1410
1424
 
1411
1425
    if(image_data->loader)
1412
1426
        g_object_unref(image_data->loader);
1413
 
 
1414
 
    g_free(image_data);
1415
 
    image_data = NULL;
1416
 
 
1417
1427
}
1418
1428
 
1419
1429
/**
1478
1488
    else
1479
1489
        image_path = DEFAULT_BACKDROP;
1480
1490
 
1481
 
    DBG("loading image %s", image_path);
 
1491
    XF_DEBUG("loading image %s", image_path);
1482
1492
 
1483
1493
    file = g_file_new_for_path(image_path);
1484
1494
 
1584
1594
    /* canceled? quit now */
1585
1595
    if(g_cancellable_is_cancelled(image_data->cancellable)) {
1586
1596
        xfce_backdrop_image_data_release(image_data);
 
1597
        g_free(image_data);
1587
1598
        return;
1588
1599
    }
1589
1600
 
1628
1639
 
1629
1640
    /* no image and not canceled? return just the canvas */
1630
1641
    if(!image && !g_cancellable_is_cancelled(image_data->cancellable)) {
1631
 
        DBG("image failed to load, displaying canvas only");
 
1642
        XF_DEBUG("image failed to load, displaying canvas only");
1632
1643
        backdrop->priv->pix = final_image;
1633
1644
 
1634
1645
        g_signal_emit(G_OBJECT(backdrop), backdrop_signals[BACKDROP_READY], 0);
1635
1646
 
1636
1647
        backdrop->priv->image_data = NULL;
1637
1648
        xfce_backdrop_image_data_release(image_data);
 
1649
        g_free(image_data);
1638
1650
        return;
1639
1651
    }
1640
1652
 
1732
1744
 
1733
1745
    backdrop->priv->image_data = NULL;
1734
1746
    xfce_backdrop_image_data_release(image_data);
 
1747
    g_free(image_data);
1735
1748
}
1736
1749
 
1737
1750
static void