Move all windows of an app via DnD in workspaceview

This commit is contained in:
Tom Beckmann 2012-07-17 17:46:39 +02:00
parent 67537c93b7
commit 137052a05c
2 changed files with 16 additions and 3 deletions

View File

@ -24,10 +24,12 @@ namespace Gala
{
Window window;
Bamf.Application app;
public AppIcon (Window _window)
public AppIcon (Window _window, Bamf.Application _app)
{
window = _window;
app = _app;
try {
set_from_pixbuf (Utils.get_icon_for_window (window, WorkspaceThumb.APP_ICON_SIZE));
@ -75,6 +77,17 @@ namespace Gala
icons.add_child (actor);
icons.animate (AnimationMode.LINEAR, 100, x:Math.floorf (wallpaper.x + wallpaper.width / 2 - icons.width / 2));
var xids = app.get_xids ();
if (xids.length > 1) { //get all the windows that belong to this app
var wins = window.get_workspace ().list_windows ();
for (var i=0;i<xids.length;i++) {
foreach (var win in wins) {
if (xids.index (i) == (uint32)win.get_xwindow ())
win.change_workspace ((WorkspaceThumb.destination as WorkspaceThumb).workspace);
}
}
} else
window.change_workspace ((WorkspaceThumb.destination as WorkspaceThumb).workspace);
if (handle != null)

View File

@ -267,7 +267,7 @@ namespace Gala
if (app != null)
shown_applications.append (app);
var icon = new AppIcon (w);
var icon = new AppIcon (w, app);
icons.add_child (icon);
});