From 2a57080756aa1daba91ad44719c7c285ac4a56a2 Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Fri, 13 Feb 2009 21:12:25 +0100 Subject: [PATCH 1/2] Add mesa-demos dependency on Mandriva for glxinfo --- tools/build/gnome-shell-build-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build/gnome-shell-build-setup.sh b/tools/build/gnome-shell-build-setup.sh index dc71cbab0..8dc6fe6d7 100755 --- a/tools/build/gnome-shell-build-setup.sh +++ b/tools/build/gnome-shell-build-setup.sh @@ -126,7 +126,7 @@ if test x$system = xMandrivaLinux ; then for pkg in ffi5-devel libxdamage-devel gtk-doc gnome-common gnome-doc-utils libxulrunner-devel \ librsvg2-devel libgnomeui2-devel xterm x11-apps x11-server-xephyr \ libwnck-1-devel libGConf2-devel readline-devel flex bison GL-devel \ - zenity intltool ; do + zenity intltool mesa-demos ; do if ! rpm -q --whatprovides $pkg > /dev/null 2>&1; then reqd="$pkg $reqd" fi From 3d152f9c17546d0a3dbe98d79e9a85824c4368cd Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 16 Feb 2009 14:32:04 -0500 Subject: [PATCH 2/2] Fix the initial workspaces setup code. #571091 mutter_plugin_get_windows() returns NULL at plugin-initialization time, so we have to wait until idle time to figure out which workspaces are being used and remove the unused ones. http://bugzilla.gnome.org/show_bug.cgi?id=571091 --- js/ui/main.js | 53 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/js/ui/main.js b/js/ui/main.js index 462e8f2a3..e61f3cffe 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -42,27 +42,6 @@ function start() { for (let i = 0; i < children.length; i++) children[i].destroy(); - // metacity-clutter currently uses the same prefs as plain metacity, - // which probably means we'll be starting out with multiple workspaces; - // remove any unused ones - let windows = global.get_windows(); - let maxWorkspace = 0; - for (let i = 0; i < windows.length; i++) { - let win = windows[i]; - - if (!win.get_meta_window().is_on_all_workspaces() && - win.get_workspace() > maxWorkspace) { - maxWorkspace = win.get_workspace(); - } - } - let screen = global.screen; - if (screen.n_workspaces > maxWorkspace) { - for (let w = screen.n_workspaces - 1; w > maxWorkspace; w--) { - let workspace = screen.get_workspace_by_index(w); - screen.remove_workspace(workspace, 0); - } - } - global.connect('panel-run-dialog', function(panel) { // Make sure not more than one run dialog is shown. if (!runDialog) { @@ -92,6 +71,38 @@ function start() { show_overlay(); } }); + + Mainloop.idle_add(_removeUnusedWorkspaces); +} + +// metacity-clutter currently uses the same prefs as plain metacity, +// which probably means we'll be starting out with multiple workspaces; +// remove any unused ones. (We do this from an idle handler, because +// global.get_windows() still returns NULL at the point when start() +// is called.) +function _removeUnusedWorkspaces() { + + let global = Shell.Global.get(); + + let windows = global.get_windows(); + let maxWorkspace = 0; + for (let i = 0; i < windows.length; i++) { + let win = windows[i]; + + if (!win.get_meta_window().is_on_all_workspaces() && + win.get_workspace() > maxWorkspace) { + maxWorkspace = win.get_workspace(); + } + } + let screen = global.screen; + if (screen.n_workspaces > maxWorkspace) { + for (let w = screen.n_workspaces - 1; w > maxWorkspace; w--) { + let workspace = screen.get_workspace_by_index(w); + screen.remove_workspace(workspace, 0); + } + } + + return false; } // Used to go into a mode where all keyboard and mouse input goes to