mirror of
https://github.com/elementary/gala.git
synced 2024-12-18 14:51:51 +03:00
Move all windows of an app via DnD in workspaceview
This commit is contained in:
parent
67537c93b7
commit
137052a05c
@ -24,10 +24,12 @@ namespace Gala
|
|||||||
{
|
{
|
||||||
|
|
||||||
Window window;
|
Window window;
|
||||||
|
Bamf.Application app;
|
||||||
|
|
||||||
public AppIcon (Window _window)
|
public AppIcon (Window _window, Bamf.Application _app)
|
||||||
{
|
{
|
||||||
window = _window;
|
window = _window;
|
||||||
|
app = _app;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
set_from_pixbuf (Utils.get_icon_for_window (window, WorkspaceThumb.APP_ICON_SIZE));
|
set_from_pixbuf (Utils.get_icon_for_window (window, WorkspaceThumb.APP_ICON_SIZE));
|
||||||
@ -75,6 +77,17 @@ namespace Gala
|
|||||||
|
|
||||||
icons.add_child (actor);
|
icons.add_child (actor);
|
||||||
icons.animate (AnimationMode.LINEAR, 100, x:Math.floorf (wallpaper.x + wallpaper.width / 2 - icons.width / 2));
|
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);
|
window.change_workspace ((WorkspaceThumb.destination as WorkspaceThumb).workspace);
|
||||||
|
|
||||||
if (handle != null)
|
if (handle != null)
|
||||||
|
@ -267,7 +267,7 @@ namespace Gala
|
|||||||
if (app != null)
|
if (app != null)
|
||||||
shown_applications.append (app);
|
shown_applications.append (app);
|
||||||
|
|
||||||
var icon = new AppIcon (w);
|
var icon = new AppIcon (w, app);
|
||||||
|
|
||||||
icons.add_child (icon);
|
icons.add_child (icon);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user