mirror of
https://github.com/elementary/gala.git
synced 2024-12-25 18:24:05 +03:00
Fix some focus issues
This commit is contained in:
parent
cd9e634162
commit
1bfb1a57f3
@ -148,6 +148,17 @@ namespace Gala
|
||||
return image;
|
||||
}
|
||||
|
||||
public Window get_next_window (Meta.Workspace workspace, bool backward=false)
|
||||
{
|
||||
var window = screen.get_display ().get_tab_next (Meta.TabList.NORMAL, screen,
|
||||
screen.get_active_workspace (), null, backward);
|
||||
|
||||
if (window == null)
|
||||
window = screen.get_display ().get_tab_current (Meta.TabList.NORMAL, screen, workspace);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the area where clutter can receive events
|
||||
**/
|
||||
@ -285,6 +296,7 @@ namespace Gala
|
||||
scale_x:1.0f, scale_y:1.0f, rotation_angle_x:0.0f, opacity:255)
|
||||
.completed.connect ( () => {
|
||||
map_completed (actor);
|
||||
actor.meta_window.activate (screen.get_display ().get_current_time ());
|
||||
});
|
||||
break;
|
||||
case WindowType.MENU:
|
||||
@ -452,6 +464,10 @@ namespace Gala
|
||||
}
|
||||
|
||||
switch_workspace_completed ();
|
||||
|
||||
var focus = get_next_window (screen.get_active_workspace ());
|
||||
if (focus != null)
|
||||
focus.activate (screen.get_display ().get_current_time ());
|
||||
}
|
||||
|
||||
public override void unmaximize (Meta.WindowActor actor, int x, int y, int w, int h)
|
||||
|
@ -163,12 +163,7 @@ namespace Gala
|
||||
remove_child (c);
|
||||
});
|
||||
|
||||
current_window = display.get_tab_next (Meta.TabList.NORMAL, screen,
|
||||
screen.get_active_workspace (), null, backward);
|
||||
|
||||
if (current_window == null)
|
||||
current_window = display.get_tab_current (Meta.TabList.NORMAL, screen, screen.get_active_workspace ());
|
||||
|
||||
current_window = plugin.get_next_window (plugin.screen.get_active_workspace (), backward);
|
||||
if (current_window == null)
|
||||
return;
|
||||
|
||||
@ -185,20 +180,20 @@ namespace Gala
|
||||
return;
|
||||
|
||||
var image = plugin.get_icon_for_window (w, ICON_SIZE);
|
||||
|
||||
|
||||
var icon = new GtkClutter.Texture ();
|
||||
try {
|
||||
icon.set_from_pixbuf (image);
|
||||
} catch (Error e) {
|
||||
warning (e.message);
|
||||
}
|
||||
|
||||
|
||||
icon.x = spacing + 5 + i * (spacing + ICON_SIZE);
|
||||
icon.y = spacing + 5;
|
||||
icon.width = ICON_SIZE - 10;
|
||||
icon.height = ICON_SIZE - 10;
|
||||
add_child (icon);
|
||||
|
||||
|
||||
i++;
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user