~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-03-19 16:33:54 UTC
  • mfrom: (3.1.14 experimental)
  • Revision ID: package-import@ubuntu.com-20140319163354-9jismnm7xh1jrskz
Tags: 4.11.4-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;
119
118
    GtkWidget *icon_view;
120
119
    gdouble system_font_size;
121
120
#endif
448
447
    TRACE("entering");
449
448
    
450
449
    g_return_if_fail(XFCE_IS_DESKTOP(desktop));
451
 
    
 
450
 
 
451
    if(!XFCE_IS_BACKDROP(backdrop))
 
452
        return;
 
453
 
452
454
    if(desktop->priv->updates_frozen || !gtk_widget_get_realized(GTK_WIDGET(desktop)))
453
455
        return;
454
456
 
689
691
{
690
692
    XfceDesktop *desktop = XFCE_DESKTOP(user_data);
691
693
    gint current_workspace, new_workspace, i;
692
 
    XfceBackdrop *new_backdrop;
 
694
    XfceBackdrop *current_backdrop, *new_backdrop;
693
695
 
694
696
    TRACE("entering");
695
697
 
710
712
        current_workspace, new_workspace);
711
713
 
712
714
    for(i = 0; i < xfce_desktop_get_n_monitors(desktop); i++) {
713
 
        /* Sanity check */
 
715
        /* We want to compare the current workspace backdrop with the new one
 
716
         * and see if we can avoid changing them if they are the same image/style */
714
717
        if(current_workspace < desktop->priv->nworkspaces && current_workspace >= 0) {
715
 
            /* update! */
 
718
            current_backdrop = xfce_workspace_get_backdrop(desktop->priv->workspaces[current_workspace], i);
716
719
            new_backdrop = xfce_workspace_get_backdrop(desktop->priv->workspaces[new_workspace], i);
717
 
            backdrop_changed_cb(new_backdrop, user_data);
 
720
 
 
721
            if(!xfce_backdrop_compare_backdrops(current_backdrop, new_backdrop) || !desktop->priv->bg_pixmap) {
 
722
                /* only update monitors that require it */
 
723
                backdrop_changed_cb(new_backdrop, user_data);
 
724
            }
718
725
        } else {
719
726
            /* If current_workspace was removed or never existed, get the new
720
727
             * backdrop and apply it */
976
983
    g_object_unref(G_OBJECT(desktop->priv->channel));
977
984
    g_free(desktop->priv->property_prefix);
978
985
 
979
 
    if(desktop->priv->style_refresh_timer != 0)
980
 
        g_source_remove(desktop->priv->style_refresh_timer);
981
 
 
982
986
    G_OBJECT_CLASS(xfce_desktop_parent_class)->finalize(object);
983
987
}
984
988
 
1085
1089
    gtk_window_set_screen(GTK_WINDOW(desktop), desktop->priv->gscreen);
1086
1090
    sw = gdk_screen_get_width(desktop->priv->gscreen);
1087
1091
    sh = gdk_screen_get_height(desktop->priv->gscreen);
1088
 
    if(gtk_major_version > 2
1089
 
       || (gtk_major_version == 2 && gtk_minor_version >= 13))
1090
 
    {
1091
 
        g_signal_connect(G_OBJECT(desktop->priv->gscreen),
1092
 
                         "monitors-changed",
1093
 
                         G_CALLBACK(xfce_desktop_monitors_changed),
1094
 
                         desktop);
1095
 
    }
 
1092
 
 
1093
    g_signal_connect(G_OBJECT(desktop->priv->gscreen),
 
1094
                     "monitors-changed",
 
1095
                     G_CALLBACK(xfce_desktop_monitors_changed),
 
1096
                     desktop);
1096
1097
    
1097
1098
    /* chain up */
1098
1099
    GTK_WIDGET_CLASS(xfce_desktop_parent_class)->realize(widget);
1299
1300
    }
1300
1301
    
1301
1302
    xfce_desktop_popup_root_menu(XFCE_DESKTOP(w), button, etime);
1302
 
    
 
1303
 
 
1304
    gdk_event_free((GdkEvent*)evt);
1303
1305
    return TRUE;
1304
1306
}
1305
1307
 
1338
1340
    return TRUE;
1339
1341
}
1340
1342
 
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
 
 
1352
1343
static void
1353
1344
xfce_desktop_style_set(GtkWidget *w, GtkStyle *old_style)
1354
1345
{
1355
1346
    XfceDesktop *desktop = XFCE_DESKTOP(w);
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);
 
1347
#ifdef ENABLE_DESKTOP_ICONS
 
1348
    gdouble old_font_size;
 
1349
#endif
 
1350
 
 
1351
    TRACE("entering");
 
1352
 
 
1353
    g_return_if_fail(XFCE_IS_DESKTOP(desktop));
 
1354
 
 
1355
    if(!gtk_widget_get_realized(GTK_WIDGET(desktop)))
 
1356
        return;
 
1357
 
 
1358
    if(desktop->priv->workspaces == NULL)
 
1359
        return;
 
1360
 
 
1361
    if(GDK_IS_WINDOW(desktop->priv->bg_pixmap))
 
1362
        gdk_window_set_back_pixmap(gtk_widget_get_window(GTK_WIDGET(desktop)), desktop->priv->bg_pixmap, FALSE);
 
1363
 
 
1364
    gtk_widget_queue_draw(GTK_WIDGET(desktop));
 
1365
 
 
1366
#ifdef ENABLE_DESKTOP_ICONS
 
1367
    if(!desktop->priv->icon_view || !XFDESKTOP_IS_ICON_VIEW(desktop->priv->icon_view))
 
1368
        return;
 
1369
 
 
1370
    /* reset the icon view style */
 
1371
    gtk_widget_set_style(desktop->priv->icon_view, NULL);
 
1372
    gtk_widget_reset_rc_styles(desktop->priv->icon_view);
 
1373
 
 
1374
    old_font_size = desktop->priv->system_font_size;
 
1375
    if(xfce_desktop_ensure_system_font_size(desktop) != old_font_size
 
1376
       && desktop->priv->icon_view && !desktop->priv->icons_font_size_set)
 
1377
    {
 
1378
        xfdesktop_icon_view_set_font_size(XFDESKTOP_ICON_VIEW(desktop->priv->icon_view),
 
1379
                                          desktop->priv->system_font_size);
 
1380
    }
 
1381
#endif
1361
1382
}
1362
1383
 
1363
1384
static void
1742
1763
{
1743
1764
    gint i, current_workspace;
1744
1765
 
 
1766
    TRACE("entering");
 
1767
 
1745
1768
    g_return_if_fail(XFCE_IS_DESKTOP(desktop));
1746
1769
 
1747
1770
    if(!gtk_widget_get_realized(GTK_WIDGET(desktop)))
1770
1793
    }
1771
1794
    xfce_desktop_setup_icon_view(desktop);
1772
1795
#endif
 
1796
 
1773
1797
}
1774
1798
 
1775
1799
void xfce_desktop_arrange_icons(XfceDesktop *desktop)