~ubuntu-branches/ubuntu/utopic/xfdesktop4/utopic

« back to all changes in this revision

Viewing changes to .pc/xubuntu_set-accountsservice-user-bg.patch/src/xfce-desktop.c

  • Committer: Package Import Robot
  • Author(s): Jackson Doak
  • Date: 2014-02-20 15:59:49 UTC
  • mfrom: (3.1.12 experimental)
  • Revision ID: package-import@ubuntu.com-20140220155949-otru8spst206sai0
Tags: 4.11.3-1ubuntu1
* Merge from debian. Remaining changes:
  - debian/patches/xubuntu_improve-nautilus-interactions.patch: added,
    should prevent nautilus from taking over the desktop if xfdesktop is
    running (and vice-versa).
  - debian/patches/xubuntu_set-accountsservice-user-bg.patch: update the
    user background property of Accountsservice on backdrop change.

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
    gboolean icons_font_size_set;
115
115
    guint icons_font_size;
116
116
    guint icons_size;
 
117
    gint  style_refresh_timer;
117
118
    GtkWidget *icon_view;
118
119
    gdouble system_font_size;
119
120
#endif
533
534
    if(current_workspace < 0)
534
535
        return;
535
536
 
 
537
    /* release the bg_pixmap since the dimensions may have changed */
 
538
    if(desktop->priv->bg_pixmap) {
 
539
        g_object_unref(desktop->priv->bg_pixmap);
 
540
        desktop->priv->bg_pixmap = NULL;
 
541
    }
 
542
 
536
543
    /* special case for 1 backdrop to handle xinerama stretching */
537
544
    if(xfce_workspace_get_xinerama_stretch(desktop->priv->workspaces[current_workspace])) {
538
545
       backdrop_changed_cb(xfce_workspace_get_backdrop(desktop->priv->workspaces[current_workspace], 0), desktop);
597
604
{
598
605
    XfceDesktop *desktop = XFCE_DESKTOP(user_data);
599
606
    gint current_workspace, new_workspace, i;
600
 
    XfceBackdrop *current_backdrop, *new_backdrop;
 
607
    XfceBackdrop *new_backdrop;
601
608
 
602
609
    TRACE("entering");
603
610
 
618
625
        current_workspace, new_workspace);
619
626
 
620
627
    for(i = 0; i < xfce_desktop_get_n_monitors(desktop); i++) {
621
 
        /* We want to compare the current workspace backdrop with the new one
622
 
         * and see if we can avoid changing them if they are the same image/style */
 
628
        /* Sanity check */
623
629
        if(current_workspace < desktop->priv->nworkspaces && current_workspace >= 0) {
624
 
            current_backdrop = xfce_workspace_get_backdrop(desktop->priv->workspaces[current_workspace], i);
 
630
            /* update! */
625
631
            new_backdrop = xfce_workspace_get_backdrop(desktop->priv->workspaces[new_workspace], i);
626
 
 
627
 
            if(!xfce_backdrop_compare_backdrops(current_backdrop, new_backdrop) || !desktop->priv->bg_pixmap) {
628
 
                /* only update monitors that require it */
629
 
                backdrop_changed_cb(new_backdrop, user_data);
630
 
            }
 
632
            backdrop_changed_cb(new_backdrop, user_data);
631
633
        } else {
632
634
            /* If current_workspace was removed or never existed, get the new
633
635
             * backdrop and apply it */
889
891
    g_object_unref(G_OBJECT(desktop->priv->channel));
890
892
    g_free(desktop->priv->property_prefix);
891
893
 
 
894
    if(desktop->priv->style_refresh_timer != 0)
 
895
        g_source_remove(desktop->priv->style_refresh_timer);
 
896
 
892
897
    G_OBJECT_CLASS(xfce_desktop_parent_class)->finalize(object);
893
898
}
894
899
 
1248
1253
    return TRUE;
1249
1254
}
1250
1255
 
 
1256
static gboolean
 
1257
style_refresh_cb(gpointer *w)
 
1258
{
 
1259
    XfceDesktop *desktop = XFCE_DESKTOP(w);
 
1260
 
 
1261
    xfce_desktop_refresh(desktop);
 
1262
    desktop->priv->style_refresh_timer = 0;
 
1263
 
 
1264
    return FALSE;
 
1265
}
 
1266
 
1251
1267
static void
1252
 
xfce_desktop_style_set(GtkWidget *w,
1253
 
                       GtkStyle *old_style)
 
1268
xfce_desktop_style_set(GtkWidget *w, GtkStyle *old_style)
1254
1269
{
1255
1270
    XfceDesktop *desktop = XFCE_DESKTOP(w);
1256
 
#ifdef ENABLE_DESKTOP_ICONS
1257
 
    gdouble old_font_size;
1258
 
#endif
1259
 
    
1260
 
    if(GDK_IS_WINDOW(desktop->priv->bg_pixmap))
1261
 
        gdk_window_set_back_pixmap(gtk_widget_get_window(w), desktop->priv->bg_pixmap, FALSE);
1262
 
    gtk_widget_queue_draw(w);
1263
 
 
1264
 
#ifdef ENABLE_DESKTOP_ICONS
1265
 
    old_font_size = desktop->priv->system_font_size;
1266
 
    if(xfce_desktop_ensure_system_font_size(desktop) != old_font_size
1267
 
       && desktop->priv->icon_view && !desktop->priv->icons_font_size_set)
1268
 
    {
1269
 
        xfdesktop_icon_view_set_font_size(XFDESKTOP_ICON_VIEW(desktop->priv->icon_view),
1270
 
                                          desktop->priv->system_font_size);
1271
 
    }
1272
 
#endif
 
1271
 
 
1272
    if(desktop->priv->style_refresh_timer != 0)
 
1273
        g_source_remove(desktop->priv->style_refresh_timer);
 
1274
 
 
1275
    desktop->priv->style_refresh_timer = g_timeout_add_seconds(1, (GSourceFunc)style_refresh_cb, w);
1273
1276
}
1274
1277
 
1275
1278
static void