diff -uNr xfce4-panel.orig/plugins/pager/pager.c xfce4-panel.patched/plugins/pager/pager.c --- xfce4-panel.orig/plugins/pager/pager.c 2010-04-30 09:57:40.000000000 +0400 +++ xfce4-panel.patched/plugins/pager/pager.c 2010-05-05 22:08:24.917358720 +0400 @@ -77,6 +77,7 @@ /* settings */ guint scrolling : 1; + guint wrap_workspaces : 1; guint show_names : 1; gint rows; }; @@ -85,6 +86,7 @@ { PROP_0, PROP_WORKSPACE_SCROLLING, + PROP_WRAP_WORKSPACES, PROP_SHOW_NAMES, PROP_ROWS }; @@ -125,6 +127,13 @@ EXO_PARAM_READWRITE)); g_object_class_install_property (gobject_class, + PROP_WRAP_WORKSPACES, + g_param_spec_boolean ("wrap-workspaces", + NULL, NULL, + TRUE, + EXO_PARAM_READWRITE)); + + g_object_class_install_property (gobject_class, PROP_SHOW_NAMES, g_param_spec_boolean ("show-names", NULL, NULL, @@ -149,6 +158,7 @@ /* init, draw nothing */ plugin->wnck_screen = NULL; plugin->scrolling = TRUE; + plugin->wrap_workspaces = TRUE; plugin->show_names = FALSE; plugin->rows = 1; plugin->wnck_pager = NULL; @@ -170,6 +180,10 @@ g_value_set_boolean (value, plugin->scrolling); break; + case PROP_WRAP_WORKSPACES: + g_value_set_boolean (value, plugin->wrap_workspaces); + break; + case PROP_SHOW_NAMES: g_value_set_boolean (value, plugin->show_names); break; @@ -200,6 +214,10 @@ plugin->scrolling = g_value_get_boolean (value); break; + case PROP_WRAP_WORKSPACES: + plugin->wrap_workspaces = g_value_get_boolean (value); + break; + case PROP_SHOW_NAMES: plugin->show_names = g_value_get_boolean (value); @@ -250,13 +268,20 @@ else active_n++; - /* wrap around */ n_workspaces = wnck_screen_get_workspace_count (plugin->wnck_screen) - 1; - if (active_n < 0) - active_n = n_workspaces; - else if (active_n > n_workspaces) - active_n = 0; - + if (plugin->wrap_workspaces == TRUE) + { + /* wrap around */ + if (active_n < 0) + active_n = n_workspaces; + else if (active_n > n_workspaces) + active_n = 0; + } + else if (active_n < 0 || active_n > n_workspaces ) + { + /* we do not need to do anything */ + return TRUE; + } new_ws = wnck_screen_get_workspace (plugin->wnck_screen, active_n); if (new_ws != NULL && active_ws != new_ws) wnck_workspace_activate (new_ws, event->time); @@ -334,6 +359,7 @@ const PanelProperty properties[] = { { "workspace-scrolling", G_TYPE_BOOLEAN }, + { "wrap-workspaces", G_TYPE_BOOLEAN }, { "show-names", G_TYPE_BOOLEAN }, { "rows", G_TYPE_UINT }, { NULL } @@ -492,6 +518,11 @@ exo_mutual_binding_new (G_OBJECT (plugin), "workspace-scrolling", G_OBJECT (object), "active"); + object = gtk_builder_get_object (builder, "wrap-workspaces"); + panel_return_if_fail (GTK_IS_TOGGLE_BUTTON (object)); + exo_mutual_binding_new (G_OBJECT (plugin), "wrap-workspaces", + G_OBJECT (object), "active"); + object = gtk_builder_get_object (builder, "show-names"); panel_return_if_fail (GTK_IS_TOGGLE_BUTTON (object)); exo_mutual_binding_new (G_OBJECT (plugin), "show-names", diff -uNr xfce4-panel.orig/plugins/pager/pager-dialog.glade xfce4-panel.patched/plugins/pager/pager-dialog.glade --- xfce4-panel.orig/plugins/pager/pager-dialog.glade 2010-04-30 09:57:40.000000000 +0400 +++ xfce4-panel.patched/plugins/pager/pager-dialog.glade 2010-05-05 22:08:53.270677946 +0400 @@ -134,13 +134,36 @@ 18 6 - - Switch workspaces using the mouse _wheel + True - True - False - True - True + vertical + + + Switch workspaces using the mouse _wheel + True + True + False + True + True + + + 0 + + + + + Wrap workspaces when the _first or the last workspaces is reached + True + True + False + True + True + True + + + 1 + +