~ubuntu-branches/ubuntu/trusty/xfdesktop4/trusty

« back to all changes in this revision

Viewing changes to .pc/xubuntu_improve-nautilus-interactions.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:
115
115
    gboolean icons_font_size_set;
116
116
    guint icons_font_size;
117
117
    guint icons_size;
 
118
    gint  style_refresh_timer;
118
119
    GtkWidget *icon_view;
119
120
    gdouble system_font_size;
120
121
#endif
618
619
    if(current_workspace < 0)
619
620
        return;
620
621
 
 
622
    /* release the bg_pixmap since the dimensions may have changed */
 
623
    if(desktop->priv->bg_pixmap) {
 
624
        g_object_unref(desktop->priv->bg_pixmap);
 
625
        desktop->priv->bg_pixmap = NULL;
 
626
    }
 
627
 
621
628
    /* special case for 1 backdrop to handle xinerama stretching */
622
629
    if(xfce_workspace_get_xinerama_stretch(desktop->priv->workspaces[current_workspace])) {
623
630
       backdrop_changed_cb(xfce_workspace_get_backdrop(desktop->priv->workspaces[current_workspace], 0), desktop);
682
689
{
683
690
    XfceDesktop *desktop = XFCE_DESKTOP(user_data);
684
691
    gint current_workspace, new_workspace, i;
685
 
    XfceBackdrop *current_backdrop, *new_backdrop;
 
692
    XfceBackdrop *new_backdrop;
686
693
 
687
694
    TRACE("entering");
688
695
 
703
710
        current_workspace, new_workspace);
704
711
 
705
712
    for(i = 0; i < xfce_desktop_get_n_monitors(desktop); i++) {
706
 
        /* We want to compare the current workspace backdrop with the new one
707
 
         * and see if we can avoid changing them if they are the same image/style */
 
713
        /* Sanity check */
708
714
        if(current_workspace < desktop->priv->nworkspaces && current_workspace >= 0) {
709
 
            current_backdrop = xfce_workspace_get_backdrop(desktop->priv->workspaces[current_workspace], i);
 
715
            /* update! */
710
716
            new_backdrop = xfce_workspace_get_backdrop(desktop->priv->workspaces[new_workspace], i);
711
 
 
712
 
            if(!xfce_backdrop_compare_backdrops(current_backdrop, new_backdrop) || !desktop->priv->bg_pixmap) {
713
 
                /* only update monitors that require it */
714
 
                backdrop_changed_cb(new_backdrop, user_data);
715
 
            }
 
717
            backdrop_changed_cb(new_backdrop, user_data);
716
718
        } else {
717
719
            /* If current_workspace was removed or never existed, get the new
718
720
             * backdrop and apply it */
974
976
    g_object_unref(G_OBJECT(desktop->priv->channel));
975
977
    g_free(desktop->priv->property_prefix);
976
978
 
 
979
    if(desktop->priv->style_refresh_timer != 0)
 
980
        g_source_remove(desktop->priv->style_refresh_timer);
 
981
 
977
982
    G_OBJECT_CLASS(xfce_desktop_parent_class)->finalize(object);
978
983
}
979
984
 
1333
1338
    return TRUE;
1334
1339
}
1335
1340
 
 
1341
static gboolean
 
1342
style_refresh_cb(gpointer *w)
 
1343
{
 
1344
    XfceDesktop *desktop = XFCE_DESKTOP(w);
 
1345
 
 
1346
    xfce_desktop_refresh(desktop);
 
1347
    desktop->priv->style_refresh_timer = 0;
 
1348
 
 
1349
    return FALSE;
 
1350
}
 
1351
 
1336
1352
static void
1337
 
xfce_desktop_style_set(GtkWidget *w,
1338
 
                       GtkStyle *old_style)
 
1353
xfce_desktop_style_set(GtkWidget *w, GtkStyle *old_style)
1339
1354
{
1340
1355
    XfceDesktop *desktop = XFCE_DESKTOP(w);
1341
 
#ifdef ENABLE_DESKTOP_ICONS
1342
 
    gdouble old_font_size;
1343
 
#endif
1344
 
    
1345
 
    if(GDK_IS_WINDOW(desktop->priv->bg_pixmap))
1346
 
        gdk_window_set_back_pixmap(gtk_widget_get_window(w), desktop->priv->bg_pixmap, FALSE);
1347
 
    gtk_widget_queue_draw(w);
1348
 
 
1349
 
#ifdef ENABLE_DESKTOP_ICONS
1350
 
    old_font_size = desktop->priv->system_font_size;
1351
 
    if(xfce_desktop_ensure_system_font_size(desktop) != old_font_size
1352
 
       && desktop->priv->icon_view && !desktop->priv->icons_font_size_set)
1353
 
    {
1354
 
        xfdesktop_icon_view_set_font_size(XFDESKTOP_ICON_VIEW(desktop->priv->icon_view),
1355
 
                                          desktop->priv->system_font_size);
1356
 
    }
1357
 
#endif
 
1356
 
 
1357
    if(desktop->priv->style_refresh_timer != 0)
 
1358
        g_source_remove(desktop->priv->style_refresh_timer);
 
1359
 
 
1360
    desktop->priv->style_refresh_timer = g_timeout_add_seconds(1, (GSourceFunc)style_refresh_cb, w);
1358
1361
}
1359
1362
 
1360
1363
static void