[Xfce4-commits] <xfdesktop:eric/wallpaper-and-settings-improvements> Update icon view frame name based on monitor count

Eric Koegel noreply at xfce.org
Fri Apr 12 13:08:01 CEST 2013


Updating branch refs/heads/eric/wallpaper-and-settings-improvements
         to 6d78e6bc921b4a4b408af0e6c94aaf682ea3c5fd (commit)
       from 8385169faa534301b7131d842c062bb9971e5f67 (commit)

commit 6d78e6bc921b4a4b408af0e6c94aaf682ea3c5fd
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Mon Apr 8 18:54:51 2013 +0300

    Update icon view frame name based on monitor count

 settings/main.c |   45 +++++++++++++++++++++++++++++++++++++--------
 1 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/settings/main.c b/settings/main.c
index 8debcb9..7c167ab 100644
--- a/settings/main.c
+++ b/settings/main.c
@@ -637,14 +637,37 @@ xfdesktop_settings_update_iconview_frame_name(AppearancePanel *panel,
 
     workspace_name = g_strdup(wnck_workspace_get_name(wnck_workspace));
 
-    if(panel->monitor_name) {
-        g_snprintf(buf, sizeof(buf),
-                   _("Wallpaper for %s on Monitor %d (%s)"),
-                   workspace_name, panel->monitor, panel->monitor_name);
-    } else
-        g_snprintf(buf, sizeof(buf),
-                   _("Wallpaper for %s on Monitor %d"),
-                   workspace_name, panel->monitor);
+    if(gdk_screen_get_n_monitors(gtk_widget_get_screen(panel->chk_apply_to_all)) > 1) {
+        if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(panel->chk_apply_to_all))) {
+            /* Multi-monitor single workspace */
+            if(panel->monitor_name) {
+                g_snprintf(buf, sizeof(buf),
+                           _("Wallpaper for Monitor %d (%s)"),
+                           panel->monitor, panel->monitor_name);
+            } else {
+                g_snprintf(buf, sizeof(buf), _("Wallpaper for Monitor %d"), panel->monitor);
+            }
+        } else {
+            /* Multi-monitor per workspace wallpaper */
+            if(panel->monitor_name) {
+                g_snprintf(buf, sizeof(buf),
+                           _("Wallpaper for %s on Monitor %d (%s)"),
+                           workspace_name, panel->monitor, panel->monitor_name);
+            } else {
+                g_snprintf(buf, sizeof(buf),
+                           _("Wallpaper for %s on Monitor %d"),
+                           workspace_name, panel->monitor);
+            }
+        }
+    } else {
+        if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(panel->chk_apply_to_all))) {
+            /* Single monitor and single workspace */
+            g_snprintf(buf, sizeof(buf), _("Wallpaper for my desktop"));
+        } else {
+            /* Single monitor and per workspace wallpaper */
+            g_snprintf(buf, sizeof(buf), _("Wallpaper for %s"), workspace_name);
+        }
+    }
 
     gtk_frame_set_label(GTK_FRAME(panel->frame_image_list), buf);
 
@@ -1153,6 +1176,9 @@ cb_monitor_changed(GdkScreen *gscreen,
 
     /* Update background because the monitor we're on may have changed */
     cb_update_background_tab(panel->wnck_window, user_data);
+
+    /* Update the frame name because we may change from/to a single monitor */
+    xfdesktop_settings_update_iconview_frame_name(panel, wnck_window_get_workspace(panel->wnck_window));
 }
 
 static void
@@ -1176,6 +1202,9 @@ cb_xfdesktop_chk_apply_to_all(GtkCheckButton *button,
     } else {
         cb_update_background_tab(panel->wnck_window, panel);
     }
+
+    /* update the frame name to since we changed to/from single workspace mode */
+    xfdesktop_settings_update_iconview_frame_name(panel, wnck_window_get_workspace(panel->wnck_window));
 }
 
 static void


More information about the Xfce4-commits mailing list