mirror of
https://github.com/elementary/gala.git
synced 2024-11-28 04:05:22 +03:00
libmutter.vapi: remove Meta.Screen.screen and Meta.Window.focus_window properties
This commit is contained in:
parent
1688545087
commit
8d4df0077a
@ -45,6 +45,8 @@ namespace Gala
|
||||
|
||||
public override void start ()
|
||||
{
|
||||
var screen = get_screen ();
|
||||
|
||||
elements = Compositor.get_stage_for_screen (screen);
|
||||
clutter_actor_reparent (Compositor.get_window_group_for_screen (screen), elements);
|
||||
clutter_actor_reparent (Compositor.get_overlay_group_for_screen (screen), elements);
|
||||
@ -162,6 +164,8 @@ namespace Gala
|
||||
|
||||
public Window get_next_window (Meta.Workspace workspace, bool backward=false)
|
||||
{
|
||||
var screen = get_screen ();
|
||||
|
||||
var window = screen.get_display ().get_tab_next (Meta.TabList.NORMAL, screen,
|
||||
screen.get_active_workspace (), null, backward);
|
||||
|
||||
@ -176,6 +180,9 @@ namespace Gala
|
||||
**/
|
||||
public void set_input_area (InputArea area)
|
||||
{
|
||||
var screen = get_screen ();
|
||||
var display = screen.get_display ();
|
||||
|
||||
X.Xrectangle rect;
|
||||
int width, height;
|
||||
screen.get_size (out width, out height);
|
||||
@ -192,7 +199,7 @@ namespace Gala
|
||||
return;
|
||||
}
|
||||
|
||||
var xregion = X.Fixes.create_region (screen.get_display ().get_xdisplay (), {rect});
|
||||
var xregion = X.Fixes.create_region (display.get_xdisplay (), {rect});
|
||||
Util.set_stage_input_region (screen, xregion);
|
||||
}
|
||||
|
||||
@ -201,21 +208,24 @@ namespace Gala
|
||||
if (window == null)
|
||||
return;
|
||||
|
||||
var screen = get_screen ();
|
||||
var display = screen.get_display ();
|
||||
|
||||
var idx = screen.get_active_workspace ().index () + ((up)?-1:1);
|
||||
|
||||
if (idx < 0 || idx >= screen.n_workspaces)
|
||||
return;
|
||||
|
||||
if (!window.is_on_all_workspaces ())
|
||||
window.change_workspace_by_index (idx, false,
|
||||
screen.get_display ().get_current_time ());
|
||||
window.change_workspace_by_index (idx, false, display.get_current_time ());
|
||||
|
||||
screen.get_workspace_by_index (idx).activate_with_focus (window,
|
||||
screen.get_display ().get_current_time ());
|
||||
screen.get_workspace_by_index (idx).activate_with_focus (window, display.get_current_time ());
|
||||
}
|
||||
|
||||
public new void begin_modal ()
|
||||
{
|
||||
var screen = get_screen ();
|
||||
|
||||
base.begin_modal (x_get_stage_window (Compositor.get_stage_for_screen (screen)), {}, 0, screen.get_display ().get_current_time ());
|
||||
}
|
||||
|
||||
@ -226,6 +236,9 @@ namespace Gala
|
||||
|
||||
public int move_workspaces (bool left)
|
||||
{
|
||||
var screen = get_screen ();
|
||||
var display = screen.get_display ();
|
||||
|
||||
var i = screen.get_active_workspace_index ();
|
||||
|
||||
if (left && i - 1 >= 0) //move left
|
||||
@ -235,7 +248,7 @@ namespace Gala
|
||||
|
||||
if (i != screen.get_active_workspace_index ()) {
|
||||
screen.get_workspace_by_index (i).
|
||||
activate (screen.get_display ().get_current_time ());
|
||||
activate (display.get_current_time ());
|
||||
}
|
||||
|
||||
return i;
|
||||
@ -285,6 +298,8 @@ namespace Gala
|
||||
|
||||
public override void map (WindowActor actor)
|
||||
{
|
||||
var screen = get_screen ();
|
||||
|
||||
unowned Rectangle rect; //some useful infos
|
||||
actor.meta_window.get_outer_rect (out rect);
|
||||
int width, height;
|
||||
@ -474,6 +489,9 @@ namespace Gala
|
||||
if (win == null || par == null)
|
||||
return;
|
||||
|
||||
var screen = get_screen ();
|
||||
var display = screen.get_display ();
|
||||
|
||||
for (var i=0;i<win.length ();i++) {
|
||||
var window = win.nth_data (i);
|
||||
if ((window as WindowActor).is_destroyed ())
|
||||
@ -500,12 +518,12 @@ namespace Gala
|
||||
|
||||
switch_workspace_completed ();
|
||||
|
||||
var focus = screen.get_display ().get_tab_current (Meta.TabList.NORMAL, screen, screen.get_active_workspace ());
|
||||
var focus = display.get_tab_current (Meta.TabList.NORMAL, screen, screen.get_active_workspace ());
|
||||
// Only switch focus to the next window if none has grabbed it already
|
||||
if (focus == null) {
|
||||
focus = get_next_window (screen.get_active_workspace ());
|
||||
if (focus != null)
|
||||
focus.activate (screen.get_display ().get_current_time ());
|
||||
focus.activate (display.get_current_time ());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ namespace Gala
|
||||
remove_child (c);
|
||||
});
|
||||
|
||||
current_window = plugin.get_next_window (plugin.screen.get_active_workspace (), backward);
|
||||
current_window = plugin.get_next_window (screen.get_active_workspace (), backward);
|
||||
if (current_window == null)
|
||||
return;
|
||||
|
||||
@ -214,7 +214,7 @@ namespace Gala
|
||||
int width, height;
|
||||
unowned Meta.Rectangle area;
|
||||
|
||||
plugin.screen.get_monitor_geometry (plugin.screen.get_primary_monitor (), out area);
|
||||
screen.get_monitor_geometry (screen.get_primary_monitor (), out area);
|
||||
width = area.width;
|
||||
height = area.height;
|
||||
|
||||
|
@ -59,7 +59,7 @@ namespace Gala
|
||||
plugin = _plugin;
|
||||
|
||||
int w, h;
|
||||
plugin.screen.get_size (out w, out h);
|
||||
plugin.get_screen ().get_size (out w, out h);
|
||||
|
||||
len = (float)w / h * HEIGHT;
|
||||
|
||||
|
@ -110,8 +110,10 @@ namespace Gala
|
||||
|
||||
tile.reactive = true;
|
||||
tile.button_release_event.connect (() => {
|
||||
var screen = plugin.get_screen ();
|
||||
|
||||
var windows = new GLib.List<Window> ();
|
||||
plugin.screen.get_active_workspace ().list_windows ().foreach ( (w) => {
|
||||
screen.get_active_workspace ().list_windows ().foreach ( (w) => {
|
||||
if (w.window_type != Meta.WindowType.NORMAL || w.minimized)
|
||||
return;
|
||||
|
||||
@ -119,15 +121,15 @@ namespace Gala
|
||||
});
|
||||
|
||||
//make sure active window is biggest
|
||||
var active_idx = windows.index (plugin.screen.get_display ().get_focus_window ());
|
||||
var active_idx = windows.index (screen.get_display ().get_focus_window ());
|
||||
if (active_idx != -1 && active_idx != 0) {
|
||||
windows.delete_link (windows.nth (active_idx));
|
||||
windows.prepend (plugin.screen.get_display ().get_focus_window ());
|
||||
windows.prepend (screen.get_display ().get_focus_window ());
|
||||
}
|
||||
|
||||
unowned Rectangle area;
|
||||
|
||||
plugin.screen.get_monitor_geometry (plugin.screen.get_primary_monitor (), out area);
|
||||
screen.get_monitor_geometry (screen.get_primary_monitor (), out area);
|
||||
|
||||
var n_wins = windows.length ();
|
||||
var index = 0;
|
||||
@ -187,7 +189,7 @@ namespace Gala
|
||||
int width, height;
|
||||
unowned Rectangle area;
|
||||
|
||||
plugin.screen.get_monitor_geometry (plugin.screen.get_primary_monitor (), out area);
|
||||
plugin.get_screen ().get_monitor_geometry (plugin.get_screen ().get_primary_monitor (), out area);
|
||||
width = area.width;
|
||||
height = area.height;
|
||||
|
||||
@ -304,12 +306,14 @@ namespace Gala
|
||||
plugin.set_input_area (Gala.InputArea.FULLSCREEN);
|
||||
plugin.begin_modal ();
|
||||
|
||||
var screen = plugin.get_screen ();
|
||||
|
||||
animating = true;
|
||||
|
||||
int width, height;
|
||||
unowned Rectangle area;
|
||||
|
||||
plugin.screen.get_monitor_geometry (plugin.screen.get_primary_monitor (), out area);
|
||||
screen.get_monitor_geometry (screen.get_primary_monitor (), out area);
|
||||
width = area.width;
|
||||
height = area.height;
|
||||
|
||||
@ -322,8 +326,8 @@ namespace Gala
|
||||
/*get the workspaces together*/
|
||||
workspaces.remove_all_children ();
|
||||
|
||||
for (var i=0;i<plugin.get_screen ().n_workspaces;i++) {
|
||||
var space = plugin.get_screen ().get_workspace_by_index (i);
|
||||
for (var i = 0; i < screen.n_workspaces; i++) {
|
||||
var space = screen.get_workspace_by_index (i);
|
||||
|
||||
var group = new Clutter.Actor ();
|
||||
var icons = new Clutter.Actor ();
|
||||
@ -351,7 +355,7 @@ namespace Gala
|
||||
|
||||
icon.reactive = true;
|
||||
icon.button_release_event.connect ( () => {
|
||||
space.activate_with_focus (w,plugin.screen.get_display ().get_current_time ());
|
||||
space.activate_with_focus (w, screen.get_display ().get_current_time ());
|
||||
hide ();
|
||||
return false;
|
||||
});
|
||||
@ -370,8 +374,8 @@ namespace Gala
|
||||
|
||||
group.reactive = true;
|
||||
group.button_release_event.connect (() => {
|
||||
space.activate (plugin.screen.get_display ().get_current_time ());
|
||||
workspace = plugin.screen.get_active_workspace ().index ();
|
||||
space.activate (plugin.get_screen ().get_display ().get_current_time ());
|
||||
workspace = plugin.get_screen ().get_active_workspace ().index ();
|
||||
hide ();
|
||||
return true;
|
||||
});
|
||||
@ -381,7 +385,7 @@ namespace Gala
|
||||
workspaces.x = this.width / 2 - workspaces.width / 2;
|
||||
workspaces.y = 25;
|
||||
|
||||
workspace = plugin.screen.get_active_workspace ().index ();
|
||||
workspace = screen.get_active_workspace ().index ();
|
||||
|
||||
current_workspace.y = workspaces.y - 5;
|
||||
|
||||
|
@ -263,7 +263,6 @@ namespace Meta {
|
||||
public void unmanage_screen (Meta.Screen screen, uint32 timestamp);
|
||||
public bool xserver_time_is_before (uint32 time1, uint32 time2);
|
||||
public bool xwindow_is_a_no_focus_window (X.Window xwindow);
|
||||
public Meta.Window focus_window { get; }
|
||||
public signal void grab_op_begin (Meta.Screen object, Meta.Window p0, Meta.GrabOp p1);
|
||||
public signal void grab_op_end (Meta.Screen object, Meta.Window p0, Meta.GrabOp p1);
|
||||
public signal void overlay_key ();
|
||||
@ -343,8 +342,6 @@ namespace Meta {
|
||||
public bool disabled { get; set; }
|
||||
[NoAccessorMethod]
|
||||
public ulong features { get; }
|
||||
[NoAccessorMethod]
|
||||
public Meta.Screen screen { owned get; set; }
|
||||
}
|
||||
[CCode (cheader_filename = "meta/boxes.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "meta_rectangle_get_type ()")]
|
||||
public struct Rectangle {
|
||||
|
Loading…
Reference in New Issue
Block a user