mirror of
https://github.com/elementary/gala.git
synced 2024-12-01 03:34:04 +03:00
Hide dialogs when exposing, close on escape, update to gala trunk rev195
This commit is contained in:
commit
a5d81b1fe4
@ -29,9 +29,9 @@ configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_BINARY_DIR}/sr
|
||||
add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(DEPS REQUIRED libmutter granite clutter-1.0 clutter-gtk-1.0 libbamf3 xfixes gee-1.0)
|
||||
pkg_check_modules(DEPS REQUIRED libmutter granite clutter-1.0 clutter-gtk-1.0 libbamf3 xfixes gee-1.0 libplank)
|
||||
|
||||
pkg_check_modules(MUTTER36 libmutter>=3.5.3)
|
||||
pkg_check_modules(MUTTER36 QUIET libmutter>=3.5.3)
|
||||
if (MUTTER36_FOUND)
|
||||
set (GALAVALAFLAGS "--define=HAS_MUTTER36")
|
||||
endif (MUTTER36_FOUND)
|
||||
@ -62,12 +62,13 @@ vala_precompile(VALA_C
|
||||
${CMAKE_BINARY_DIR}/src/Config.vala
|
||||
PACKAGES
|
||||
granite
|
||||
libbamf3
|
||||
libmutter
|
||||
plank
|
||||
clutter-gtk-1.0
|
||||
gdk-x11-3.0
|
||||
gdesktopenums-3.0
|
||||
xfixes-4.0
|
||||
bamf
|
||||
OPTIONS
|
||||
-g
|
||||
--vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi/
|
||||
|
@ -43,7 +43,7 @@ namespace Gala
|
||||
public override bool key_press_event (Clutter.KeyEvent event)
|
||||
{
|
||||
//FIXME need to figure out the actual keycombo, for now leave it by default and others will close it by selecting a window!
|
||||
if (event.keyval == Clutter.Key.e) {
|
||||
if (event.keyval == Clutter.Key.e || event.keyval == Clutter.Key.Escape) {
|
||||
close (true);
|
||||
|
||||
return true;
|
||||
@ -256,11 +256,16 @@ namespace Gala
|
||||
|
||||
var used_windows = new SList<Window> ();
|
||||
|
||||
screen.get_active_workspace ().list_windows ().foreach ((w) => {
|
||||
if (w.window_type != Meta.WindowType.NORMAL || w.minimized)
|
||||
return;
|
||||
used_windows.append (w);
|
||||
});
|
||||
foreach (var window in screen.get_active_workspace ().list_windows ()) {
|
||||
if (window.window_type != WindowType.NORMAL && window.window_type != WindowType.DOCK) {
|
||||
(window.get_compositor_private () as Actor).hide ();
|
||||
continue;
|
||||
}
|
||||
if (window.window_type == WindowType.DOCK)
|
||||
continue;
|
||||
|
||||
used_windows.append (window);
|
||||
}
|
||||
|
||||
var n_windows = used_windows.length ();
|
||||
if (n_windows == 0)
|
||||
@ -330,11 +335,17 @@ namespace Gala
|
||||
visible = false;
|
||||
ready = true;
|
||||
|
||||
foreach (var window in screen.get_active_workspace ().list_windows ())
|
||||
(window.get_compositor_private () as Actor).show ();
|
||||
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
ready = true;
|
||||
visible = false;
|
||||
|
||||
foreach (var window in screen.get_active_workspace ().list_windows ())
|
||||
(window.get_compositor_private () as Actor).show ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,6 +54,8 @@ namespace Gala
|
||||
GLib.Environment.unset_variable ("NO_GAIL");
|
||||
GLib.Environment.unset_variable ("NO_AT_BRIDGE");
|
||||
|
||||
Plank.Services.Paths.initialize ("plank", Config.DATADIR + "/plank");
|
||||
|
||||
return Meta.run ();
|
||||
}
|
||||
}
|
||||
|
@ -262,15 +262,16 @@ namespace Gala
|
||||
workspace_view.show ();
|
||||
break;
|
||||
case ActionType.MAXIMIZE_CURRENT:
|
||||
if (current == null)
|
||||
if (current == null || current.window_type != WindowType.NORMAL)
|
||||
break;
|
||||
|
||||
if (current.get_maximized () == (MaximizeFlags.HORIZONTAL | MaximizeFlags.VERTICAL))
|
||||
current.unmaximize (MaximizeFlags.HORIZONTAL | MaximizeFlags.VERTICAL);
|
||||
else
|
||||
current.maximize (MaximizeFlags.HORIZONTAL | MaximizeFlags.VERTICAL);
|
||||
break;
|
||||
case ActionType.MINIMIZE_CURRENT:
|
||||
if (current != null)
|
||||
if (current != null && current.window_type == WindowType.NORMAL)
|
||||
current.minimize ();
|
||||
break;
|
||||
case ActionType.OPEN_LAUNCHER:
|
||||
@ -310,7 +311,7 @@ namespace Gala
|
||||
get_screen ().get_size (out width, out height);
|
||||
|
||||
Rectangle icon = {};
|
||||
if (false && actor.get_meta_window ().get_icon_geometry (icon)) {
|
||||
if (false && actor.get_meta_window ().get_icon_geometry (out icon)) {
|
||||
|
||||
float scale_x = (float)icon.width / actor.width;
|
||||
float scale_y = (float)icon.height / actor.height;
|
||||
@ -392,6 +393,7 @@ namespace Gala
|
||||
var display = screen.get_display ();
|
||||
var window = actor.get_meta_window ();
|
||||
|
||||
actor.detach_animation ();
|
||||
actor.show ();
|
||||
|
||||
switch (window.window_type) {
|
||||
@ -465,6 +467,7 @@ namespace Gala
|
||||
var display = screen.get_display ();
|
||||
var window = actor.get_meta_window ();
|
||||
|
||||
actor.detach_animation ();
|
||||
destroying.add (actor);
|
||||
|
||||
switch (window.window_type) {
|
||||
|
@ -73,6 +73,9 @@ namespace Gala.Utils
|
||||
image.fill (0x00000000);
|
||||
}
|
||||
|
||||
if (size != image.width || size != image.height)
|
||||
return Plank.Drawing.DrawingService.ar_scale (image, size, size);
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ using Granite.Drawing;
|
||||
|
||||
namespace Gala
|
||||
{
|
||||
public class WindowSwitcher : Clutter.Group
|
||||
public class WindowSwitcher : Clutter.Actor
|
||||
{
|
||||
Gala.Plugin plugin;
|
||||
|
||||
@ -28,11 +28,80 @@ namespace Gala
|
||||
|
||||
Meta.Window? current_window;
|
||||
|
||||
bool active; //switcher is currently running
|
||||
Meta.WindowActor? dock_window;
|
||||
Actor dock;
|
||||
CairoTexture dock_background;
|
||||
Plank.Drawing.DockSurface? dock_surface;
|
||||
Plank.Drawing.DockTheme dock_theme;
|
||||
Plank.DockPreferences dock_settings;
|
||||
BindConstraint y_constraint;
|
||||
BindConstraint h_constraint;
|
||||
|
||||
//FIXME window titles of supported docks, to be extended
|
||||
const string [] DOCK_NAMES = {"plank", "Docky"};
|
||||
|
||||
public WindowSwitcher (Gala.Plugin _plugin)
|
||||
{
|
||||
plugin = _plugin;
|
||||
|
||||
//pull drawing methods from libplank
|
||||
dock_settings = new Plank.DockPreferences.with_filename (Environment.get_user_config_dir () + "/plank/dock1/settings");
|
||||
dock_settings.changed.connect (update_dock);
|
||||
|
||||
dock_theme = new Plank.Drawing.DockTheme ();
|
||||
dock_theme.load ("dock");
|
||||
dock_theme.changed.connect (update_dock);
|
||||
|
||||
dock = new Actor ();
|
||||
dock.layout_manager = new BoxLayout ();
|
||||
dock.anchor_gravity = Clutter.Gravity.CENTER;
|
||||
|
||||
dock_background = new CairoTexture (100, dock_settings.IconSize);
|
||||
dock_background.anchor_gravity = Clutter.Gravity.CENTER;
|
||||
dock_background.auto_resize = true;
|
||||
dock_background.draw.connect (draw_dock_background);
|
||||
|
||||
y_constraint = new BindConstraint (dock, BindCoordinate.Y, 0);
|
||||
h_constraint = new BindConstraint (dock, BindCoordinate.HEIGHT, 0);
|
||||
|
||||
dock_background.add_constraint (new BindConstraint (dock, BindCoordinate.X, 0));
|
||||
dock_background.add_constraint (y_constraint);
|
||||
dock_background.add_constraint (new BindConstraint (dock, BindCoordinate.WIDTH, 0));
|
||||
dock_background.add_constraint (h_constraint);
|
||||
|
||||
add_child (dock_background);
|
||||
add_child (dock);
|
||||
|
||||
update_dock ();
|
||||
|
||||
visible = false;
|
||||
}
|
||||
|
||||
//set the values which don't get set every time and need to be updated when the theme changes
|
||||
void update_dock ()
|
||||
{
|
||||
(dock.layout_manager as BoxLayout).spacing = (uint)(dock_theme.ItemPadding / 10.0 * dock_settings.IconSize);
|
||||
dock.height = dock_settings.IconSize;
|
||||
|
||||
var top_offset = (int)(dock_theme.TopPadding / 10.0 * dock_settings.IconSize);
|
||||
var bottom_offset = (int)(dock_theme.BottomPadding / 10.0 * dock_settings.IconSize);
|
||||
|
||||
y_constraint.offset = -top_offset / 2 + bottom_offset / 2;
|
||||
h_constraint.offset = top_offset + bottom_offset;
|
||||
}
|
||||
|
||||
bool draw_dock_background (Cairo.Context cr)
|
||||
{
|
||||
if (dock_surface == null || dock_surface.Width != dock_background.width) {
|
||||
dock_surface = dock_theme.create_background ((int)dock_background.width,
|
||||
(int)dock_background.height, Gtk.PositionType.BOTTOM,
|
||||
new Plank.Drawing.DockSurface.with_surface (1, 1, cr.get_target ()));
|
||||
}
|
||||
|
||||
cr.set_source_surface (dock_surface.Internal, 0, 0);
|
||||
cr.paint ();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool key_release_event (Clutter.KeyEvent event)
|
||||
@ -59,6 +128,8 @@ namespace Gala
|
||||
meta_win.is_on_all_workspaces ())
|
||||
w.show ();
|
||||
});
|
||||
if (dock_window != null)
|
||||
dock_window.opacity = 0;
|
||||
|
||||
window_clones.clear ();
|
||||
|
||||
@ -68,17 +139,44 @@ namespace Gala
|
||||
current_window = null;
|
||||
}
|
||||
|
||||
active = false;
|
||||
var dest_width = (dock_window != null ? dock_window.width : 800.0f);
|
||||
|
||||
set_child_above_sibling (dock, null);
|
||||
dock_background.animate (AnimationMode.EASE_OUT_CUBIC, 250, opacity : 0);
|
||||
|
||||
if (dock_window != null)
|
||||
dock_window.animate (AnimationMode.LINEAR, 250, opacity : 255);
|
||||
|
||||
dock.animate (AnimationMode.EASE_OUT_CUBIC, 250, width:dest_width, opacity : 0).
|
||||
completed.connect (() => {
|
||||
dock.remove_all_children ();
|
||||
|
||||
if (dock_window != null)
|
||||
dock_window = null;
|
||||
|
||||
visible = false;
|
||||
});
|
||||
}
|
||||
|
||||
//used to figure out delays between switching when holding the tab key
|
||||
uint last_time = -1;
|
||||
bool released = false;
|
||||
public override bool captured_event (Clutter.Event event)
|
||||
{
|
||||
if (!(event.get_type () == EventType.KEY_PRESS))
|
||||
return false;
|
||||
|
||||
var screen = plugin.get_screen ();
|
||||
var display = screen.get_display ();
|
||||
|
||||
if (event.get_type () == EventType.KEY_RELEASE) {
|
||||
released = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(event.get_type () == EventType.KEY_PRESS) ||
|
||||
(!released && display.get_current_time_roundtrip () < (last_time + 300)))
|
||||
return false;
|
||||
|
||||
released = false;
|
||||
|
||||
bool backward = (event.get_state () & X.KeyMask.ShiftMask) != 0;
|
||||
var action = display.get_keybinding_action (event.get_key_code (), event.get_state ());
|
||||
|
||||
@ -88,11 +186,13 @@ namespace Gala
|
||||
case Meta.KeyBindingAction.SWITCH_WINDOWS:
|
||||
current_window = display.get_tab_next (Meta.TabList.NORMAL, screen,
|
||||
screen.get_active_workspace (), current_window, backward);
|
||||
last_time = display.get_current_time_roundtrip ();
|
||||
break;
|
||||
case Meta.KeyBindingAction.SWITCH_GROUP_BACKWARD:
|
||||
case Meta.KeyBindingAction.SWITCH_WINDOWS_BACKWARD:
|
||||
current_window = display.get_tab_next (Meta.TabList.NORMAL, screen,
|
||||
screen.get_active_workspace (), current_window, true);
|
||||
last_time = display.get_current_time_roundtrip ();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -108,20 +208,26 @@ namespace Gala
|
||||
void dim_windows ()
|
||||
{
|
||||
var current_actor = current_window.get_compositor_private () as Actor;
|
||||
var i = 0;
|
||||
foreach (var clone in window_clones) {
|
||||
if (current_actor == clone.source) {
|
||||
clone.get_parent ().set_child_above_sibling (clone, null);
|
||||
set_child_below_sibling (clone, dock_background);
|
||||
clone.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, depth : 0.0f, opacity : 255);
|
||||
|
||||
dock.get_child_at_index (i).animate (AnimationMode.LINEAR, 100, opacity : 255);
|
||||
} else {
|
||||
clone.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, depth : -200.0f, opacity : 0);
|
||||
dock.get_child_at_index (i).animate (AnimationMode.LINEAR, 100, opacity : 100);
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public void handle_switch_windows (Meta.Display display, Meta.Screen screen, Meta.Window? window,
|
||||
X.Event event, Meta.KeyBinding binding)
|
||||
{
|
||||
if (active) {
|
||||
if (visible) {
|
||||
if (window_clones.size != 0)
|
||||
close (screen.get_display ().get_current_time ());
|
||||
return;
|
||||
@ -131,10 +237,11 @@ namespace Gala
|
||||
if (metawindows.length () <= 1)
|
||||
return;
|
||||
|
||||
active = true;
|
||||
visible = true;
|
||||
|
||||
//grab the windows to be switched
|
||||
var layout = dock.layout_manager as BoxLayout;
|
||||
window_clones.clear ();
|
||||
|
||||
foreach (var win in metawindows) {
|
||||
var actor = win.get_compositor_private () as Actor;
|
||||
var clone = new Clone (actor);
|
||||
@ -143,19 +250,33 @@ namespace Gala
|
||||
|
||||
add_child (clone);
|
||||
window_clones.add (clone);
|
||||
|
||||
var icon = new GtkClutter.Texture ();
|
||||
try {
|
||||
icon.set_from_pixbuf (Utils.get_icon_for_window (win, dock_settings.IconSize));
|
||||
} catch (Error e) { warning (e.message); }
|
||||
|
||||
icon.opacity = 100;
|
||||
dock.add_child (icon);
|
||||
layout.set_expand (icon, true);
|
||||
}
|
||||
|
||||
//hide the others
|
||||
Meta.Compositor.get_window_actors (screen).foreach ((w) => {
|
||||
var type = w.get_meta_window ().window_type;
|
||||
if (type != Meta.WindowType.DOCK && type != Meta.WindowType.DESKTOP && type != Meta.WindowType.NOTIFICATION)
|
||||
w.hide ();
|
||||
|
||||
if (w.get_meta_window ().title in DOCK_NAMES && type == Meta.WindowType.DOCK) {
|
||||
dock_window = w;
|
||||
dock_window.hide ();
|
||||
}
|
||||
});
|
||||
|
||||
plugin.begin_modal ();
|
||||
|
||||
bool backward = (binding.get_name () == "switch-windows-backward");
|
||||
|
||||
/*list windows*/
|
||||
current_window = Utils.get_next_window (screen.get_active_workspace (), backward);
|
||||
if (current_window == null)
|
||||
return;
|
||||
@ -165,6 +286,30 @@ namespace Gala
|
||||
return;
|
||||
}
|
||||
|
||||
//plank type switcher thing
|
||||
var geometry = screen.get_monitor_geometry (screen.get_primary_monitor ());
|
||||
|
||||
if (dock_window != null)
|
||||
dock.width = dock_window.width;
|
||||
|
||||
var bottom_offset = (int)(dock_theme.BottomPadding / 10.0 * dock_settings.IconSize);
|
||||
dock.opacity = 255;
|
||||
dock.x = Math.ceilf (geometry.x + geometry.width / 2.0f);
|
||||
dock.y = Math.ceilf (geometry.y + geometry.height - dock.height / 2.0f) - bottom_offset;
|
||||
|
||||
//add spacing on outer most items
|
||||
var horiz_padding = (float) Math.ceil (dock_theme.HorizPadding / 10.0 * dock_settings.IconSize + layout.spacing / 2.0);
|
||||
dock.get_first_child ().margin_left = horiz_padding;
|
||||
dock.get_last_child ().margin_right = horiz_padding;
|
||||
|
||||
float dest_width;
|
||||
layout.get_preferred_width (dock, dock.height, null, out dest_width);
|
||||
|
||||
set_child_above_sibling (dock_background, null);
|
||||
dock_background.opacity = 255;
|
||||
dock.animate (AnimationMode.EASE_OUT_CUBIC, 250, width : dest_width);
|
||||
set_child_above_sibling (dock, null);
|
||||
|
||||
dim_windows ();
|
||||
grab_key_focus ();
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ namespace Gala
|
||||
internal Clone wallpaper;
|
||||
Clutter.Actor windows;
|
||||
internal Clutter.Actor icons;
|
||||
CairoTexture indicator;
|
||||
Actor indicator;
|
||||
GtkClutter.Texture close_button;
|
||||
|
||||
uint hover_timer = 0;
|
||||
@ -75,10 +75,14 @@ namespace Gala
|
||||
|
||||
reactive = true;
|
||||
|
||||
indicator = new Clutter.CairoTexture ((uint)width + 2 * INDICATOR_BORDER, (uint)THUMBNAIL_HEIGHT + 2 * INDICATOR_BORDER);
|
||||
indicator.draw.connect (draw_indicator);
|
||||
indicator.auto_resize = true;
|
||||
indicator = new Actor ();
|
||||
indicator.width = width + 2 * INDICATOR_BORDER;
|
||||
indicator.height = THUMBNAIL_HEIGHT + 2 * INDICATOR_BORDER;
|
||||
indicator.opacity = 0;
|
||||
indicator.content = new Canvas ();
|
||||
(indicator.content as Canvas).draw.connect (draw_indicator);
|
||||
(indicator.content as Canvas).set_size ((int)indicator.width, (int)indicator.height);
|
||||
|
||||
handle_workspace_switched (-1, screen.get_active_workspace_index (), MotionDirection.LEFT);
|
||||
|
||||
// FIXME find a nice way to draw a border around it, maybe combinable with the indicator using a ShaderEffect
|
||||
@ -208,7 +212,12 @@ namespace Gala
|
||||
|
||||
bool draw_indicator (Cairo.Context cr)
|
||||
{
|
||||
selector_style.render_activity (cr, 0, 0, indicator.width, indicator.height);
|
||||
cr.set_operator (Cairo.Operator.CLEAR);
|
||||
cr.paint ();
|
||||
cr.set_operator (Cairo.Operator.OVER);
|
||||
|
||||
selector_style.render_background (cr, 0, 0, indicator.width, indicator.height);
|
||||
selector_style.render_frame (cr, 0, 0, indicator.width, indicator.height);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -27,8 +27,7 @@ namespace Gala
|
||||
Screen screen;
|
||||
|
||||
Clutter.Actor thumbnails;
|
||||
Clutter.CairoTexture background;
|
||||
Clutter.CairoTexture scroll;
|
||||
Clutter.Actor scroll;
|
||||
Clutter.Actor click_catcher; //invisible plane that catches clicks outside the view
|
||||
|
||||
bool animating; // delay closing the popup
|
||||
@ -58,16 +57,13 @@ namespace Gala
|
||||
(thumbnails.layout_manager as Clutter.BoxLayout).spacing = 12;
|
||||
(thumbnails.layout_manager as Clutter.BoxLayout).homogeneous = true;
|
||||
|
||||
background = new Clutter.CairoTexture (500, (uint)height);
|
||||
background.auto_resize = true;
|
||||
background.add_constraint (new Clutter.BindConstraint (this, Clutter.BindCoordinate.WIDTH, 0));
|
||||
background.add_constraint (new Clutter.BindConstraint (this, Clutter.BindCoordinate.HEIGHT, 0));
|
||||
background.draw.connect (draw_background);
|
||||
content = new Clutter.Canvas ();
|
||||
(content as Clutter.Canvas).draw.connect (draw_background);
|
||||
|
||||
scroll = new Clutter.CairoTexture (100, 12);
|
||||
scroll = new Clutter.Actor ();
|
||||
scroll.height = 12;
|
||||
scroll.auto_resize = true;
|
||||
scroll.draw.connect (draw_scroll);
|
||||
scroll.content = new Clutter.Canvas ();
|
||||
(scroll.content as Clutter.Canvas).draw.connect (draw_scroll);
|
||||
|
||||
click_catcher = new Clutter.Actor ();
|
||||
click_catcher.reactive = true;
|
||||
@ -77,7 +73,6 @@ namespace Gala
|
||||
});
|
||||
Compositor.get_stage_for_screen (screen).add_child (click_catcher);
|
||||
|
||||
add_child (background);
|
||||
add_child (thumbnails);
|
||||
add_child (scroll);
|
||||
|
||||
@ -125,6 +120,10 @@ namespace Gala
|
||||
|
||||
bool draw_background (Cairo.Context cr)
|
||||
{
|
||||
cr.set_operator (Cairo.Operator.CLEAR);
|
||||
cr.paint ();
|
||||
cr.set_operator (Cairo.Operator.OVER);
|
||||
|
||||
background_style.render_background (cr, 0, 0, width, height);
|
||||
background_style.render_frame (cr, 0, 0, width, height);
|
||||
|
||||
@ -133,6 +132,10 @@ namespace Gala
|
||||
|
||||
bool draw_scroll (Cairo.Context cr)
|
||||
{
|
||||
cr.set_operator (Cairo.Operator.CLEAR);
|
||||
cr.paint ();
|
||||
cr.set_operator (Cairo.Operator.OVER);
|
||||
|
||||
Granite.Drawing.Utilities.cairo_rounded_rectangle (cr, 4, 4, scroll.width-32, 4, 2);
|
||||
cr.set_source_rgba (1, 1, 1, 0.8);
|
||||
cr.fill ();
|
||||
@ -192,6 +195,7 @@ namespace Gala
|
||||
if (thumbnails.x + thumbnails.width < width)
|
||||
thumbnails.x = width - thumbnails.width;
|
||||
scroll.width = width / thumbnails.width * width;
|
||||
(scroll.content as Clutter.Canvas).set_size ((int)scroll.width, 12);
|
||||
} else {
|
||||
thumbnails.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 400, x : width / 2 - thumbnails.width / 2);
|
||||
}
|
||||
@ -199,15 +203,20 @@ namespace Gala
|
||||
|
||||
void switch_to_next_workspace (MotionDirection direction)
|
||||
{
|
||||
var screen = plugin.get_screen ();
|
||||
var display = screen.get_display ();
|
||||
|
||||
var neighbor = screen.get_active_workspace ().get_neighbor (direction);
|
||||
|
||||
if (neighbor == null)
|
||||
return;
|
||||
|
||||
neighbor.activate (display.get_current_time ());
|
||||
|
||||
//if we didnt switch, show a nudge-over animation
|
||||
if (screen.get_active_workspace () == neighbor) {
|
||||
var dest = direction == MotionDirection.LEFT ? 32.0f : -32.0f;
|
||||
Compositor.get_window_group_for_screen (screen).animate (Clutter.AnimationMode.LINEAR, 100, x:dest);
|
||||
Clutter.Threads.Timeout.add (210, () => {
|
||||
Compositor.get_window_group_for_screen (screen).animate (Clutter.AnimationMode.LINEAR, 150, x:0.0f);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public override bool leave_event (Clutter.CrossingEvent event) {
|
||||
@ -217,20 +226,35 @@ namespace Gala
|
||||
return false;
|
||||
}
|
||||
|
||||
uint last_time = -1;
|
||||
bool released = false;
|
||||
public override bool key_press_event (Clutter.KeyEvent event)
|
||||
{
|
||||
var display = screen.get_display ();
|
||||
|
||||
if (!released && display.get_current_time_roundtrip () < (last_time + AnimationSettings.get_default ().workspace_switch_duration))
|
||||
return false;
|
||||
|
||||
switch (event.keyval) {
|
||||
case Clutter.Key.Left:
|
||||
if ((event.modifier_state & Clutter.ModifierType.SHIFT_MASK) == 1)
|
||||
plugin.move_window (screen.get_display ().get_focus_window (), MotionDirection.LEFT);
|
||||
plugin.move_window (display.get_focus_window (), MotionDirection.LEFT);
|
||||
else
|
||||
switch_to_next_workspace (MotionDirection.LEFT);
|
||||
|
||||
released = false;
|
||||
last_time = display.get_current_time_roundtrip ();
|
||||
|
||||
return false;
|
||||
case Clutter.Key.Right:
|
||||
if ((event.modifier_state & Clutter.ModifierType.SHIFT_MASK) == 1)
|
||||
plugin.move_window (screen.get_display ().get_focus_window (), MotionDirection.RIGHT);
|
||||
plugin.move_window (display.get_focus_window (), MotionDirection.RIGHT);
|
||||
else
|
||||
switch_to_next_workspace (MotionDirection.RIGHT);
|
||||
|
||||
released = false;
|
||||
last_time = display.get_current_time_roundtrip ();
|
||||
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
@ -241,6 +265,8 @@ namespace Gala
|
||||
|
||||
public override bool key_release_event (Clutter.KeyEvent event)
|
||||
{
|
||||
released = true;
|
||||
|
||||
if (event.keyval == Clutter.Key.Alt_L ||
|
||||
event.keyval == Clutter.Key.Super_L ||
|
||||
event.keyval == Clutter.Key.Control_L ||
|
||||
@ -316,6 +342,7 @@ namespace Gala
|
||||
y = area.height + area.y;
|
||||
x = area.x;
|
||||
width = area.width;
|
||||
(content as Clutter.Canvas).set_size ((int)width, (int)height);
|
||||
|
||||
thumbnails.get_children ().foreach ((thumb) => {
|
||||
thumb.show ();
|
||||
@ -347,8 +374,12 @@ namespace Gala
|
||||
return false;
|
||||
}); //catch hot corner hiding problem and indicator placement
|
||||
|
||||
var wins = Compositor.get_window_group_for_screen (screen);
|
||||
wins.detach_animation ();
|
||||
wins.x = 0.0f;
|
||||
|
||||
animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, y : (area.height + area.y) - height);
|
||||
Compositor.get_window_group_for_screen (plugin.get_screen ()).animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, y : -height + 1);
|
||||
wins.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, y : -height + 1);
|
||||
}
|
||||
|
||||
public new void hide ()
|
||||
@ -371,7 +402,10 @@ namespace Gala
|
||||
|
||||
click_catcher.visible = false;
|
||||
|
||||
Compositor.get_window_group_for_screen (plugin.get_screen ()).animate (Clutter.AnimationMode.EASE_OUT_EXPO, 500, y : 0.0f);
|
||||
var wins = Compositor.get_window_group_for_screen (screen);
|
||||
wins.detach_animation ();
|
||||
wins.x = 0.0f;
|
||||
wins.animate (Clutter.AnimationMode.EASE_OUT_EXPO, 500, y : 0.0f);
|
||||
}
|
||||
|
||||
public void handle_switch_to_workspace (Meta.Display display, Meta.Screen screen, Meta.Window? window,
|
||||
|
168
vapi/bamf.vapi
168
vapi/bamf.vapi
@ -1,168 +0,0 @@
|
||||
/* bamf.vapi generated by vapigen, do not modify. */
|
||||
|
||||
[CCode (cprefix = "Bamf", lower_case_cprefix = "bamf_")]
|
||||
namespace Bamf {
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", type_check_function = "BAMF_IS_APPLICATION")]
|
||||
public class Application : Bamf.View {
|
||||
[CCode (has_construct_function = false)]
|
||||
protected Application ();
|
||||
public unowned string? get_application_type ();
|
||||
public unowned string? get_desktop_file ();
|
||||
public bool get_show_menu_stubs ();
|
||||
public GLib.List<weak Bamf.View>? get_windows ();
|
||||
public GLib.Array<uint32>? get_xids ();
|
||||
public virtual signal void window_added (Bamf.View p0);
|
||||
public virtual signal void window_removed (Bamf.View p0);
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", type_check_function = "BAMF_IS_CONTROL")]
|
||||
public class Control : GLib.Object {
|
||||
[CCode (has_construct_function = false)]
|
||||
protected Control ();
|
||||
public static unowned Bamf.Control get_default ();
|
||||
public void insert_desktop_file (string desktop_file);
|
||||
public void register_application_for_pid (string application, int32 pid);
|
||||
public void register_tab_provider (string path);
|
||||
public void set_approver_behavior (int32 behavior);
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", type_check_function = "BAMF_IS_INDICATOR")]
|
||||
public class Indicator : Bamf.View {
|
||||
[CCode (has_construct_function = false)]
|
||||
protected Indicator ();
|
||||
public unowned string? get_dbus_menu_path ();
|
||||
public unowned string? get_remote_address ();
|
||||
public unowned string? get_remote_path ();
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", type_check_function = "BAMF_IS_MATCHER")]
|
||||
public class Matcher : GLib.Object {
|
||||
[CCode (has_construct_function = false)]
|
||||
protected Matcher ();
|
||||
public bool application_is_running (string application);
|
||||
public unowned Bamf.Application? get_active_application ();
|
||||
public unowned Bamf.Window? get_active_window ();
|
||||
public unowned Bamf.Application? get_application_for_desktop_file (string desktop_file_path, bool create_if_not_found);
|
||||
public unowned Bamf.Application? get_application_for_window (Bamf.Window window);
|
||||
public unowned Bamf.Application? get_application_for_xid (uint32 xid);
|
||||
public GLib.List<weak Bamf.View>? get_applications ();
|
||||
public static unowned Bamf.Matcher get_default ();
|
||||
public GLib.List<weak Bamf.View>? get_running_applications ();
|
||||
public GLib.List<weak Bamf.View>? get_tabs ();
|
||||
public GLib.List<weak Bamf.View>? get_window_stack_for_monitor (int monitor);
|
||||
public GLib.List<weak Bamf.View>? get_windows ();
|
||||
public GLib.Array<uint32>? get_xids_for_application (string application);
|
||||
public void register_favorites ([CCode (array_length = false)] string[] favorites);
|
||||
public virtual signal void active_application_changed (Bamf.View? p0, Bamf.View? p1);
|
||||
public virtual signal void active_window_changed (Bamf.View? p0, Bamf.View? p1);
|
||||
public virtual signal void stacking_order_changed ();
|
||||
public virtual signal void view_closed (Bamf.View p0);
|
||||
public virtual signal void view_opened (Bamf.View p0);
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", type_check_function = "BAMF_IS_TAB_SOURCE")]
|
||||
public class TabSource : GLib.Object {
|
||||
[CCode (has_construct_function = false)]
|
||||
protected TabSource ();
|
||||
public unowned string get_tab_ids ();
|
||||
public unowned GLib.Array get_tab_preview (string tab_id);
|
||||
public unowned string get_tab_uri (string tab_id);
|
||||
public uint32 get_tab_xid (string tab_id);
|
||||
public virtual void show_tab (string tab_id, GLib.Error error);
|
||||
[NoWrapper]
|
||||
public virtual unowned string tab_ids ();
|
||||
[NoWrapper]
|
||||
public virtual unowned GLib.Array tab_preview (string tab_id);
|
||||
[NoWrapper]
|
||||
public virtual unowned string tab_uri (string tab_id);
|
||||
[NoWrapper]
|
||||
public virtual uint32 tab_xid (string tab_id);
|
||||
[NoAccessorMethod]
|
||||
public string id { owned get; set construct; }
|
||||
public virtual signal void tab_closed (string p0);
|
||||
public virtual signal void tab_opened (string p0);
|
||||
public virtual signal void tab_uri_changed (string p0, string p1, string p2);
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", type_check_function = "BAMF_IS_VIEW")]
|
||||
public class View : GLib.InitiallyUnowned {
|
||||
[CCode (has_construct_function = false)]
|
||||
protected View ();
|
||||
[NoWrapper]
|
||||
public virtual Bamf.ClickBehavior click_behavior ();
|
||||
public virtual GLib.List<weak Bamf.View>? get_children ();
|
||||
public Bamf.ClickBehavior get_click_suggestion ();
|
||||
public virtual unowned string? get_icon ();
|
||||
public virtual unowned string? get_name ();
|
||||
public unowned string? get_view_type ();
|
||||
public virtual bool is_active ();
|
||||
public bool is_closed ();
|
||||
public virtual bool is_running ();
|
||||
public bool is_sticky ();
|
||||
public virtual bool is_urgent ();
|
||||
[CCode (cname = "bamf_view_user_visible")]
|
||||
public bool is_user_visible ();
|
||||
[NoWrapper]
|
||||
public virtual void set_path (string path);
|
||||
public void set_sticky (bool value);
|
||||
[NoWrapper]
|
||||
public virtual unowned string view_type ();
|
||||
[NoAccessorMethod]
|
||||
public bool active { get; }
|
||||
[NoAccessorMethod]
|
||||
public string path { owned get; }
|
||||
[NoAccessorMethod]
|
||||
public bool running { get; }
|
||||
[NoAccessorMethod]
|
||||
public bool urgent { get; }
|
||||
[NoAccessorMethod]
|
||||
public bool user_visible { get; }
|
||||
public virtual signal void active_changed (bool active);
|
||||
public virtual signal void child_added (Bamf.View? child);
|
||||
public virtual signal void child_removed (Bamf.View? child);
|
||||
public virtual signal void closed ();
|
||||
public virtual signal void name_changed (string old_name, string new_name);
|
||||
public virtual signal void running_changed (bool running);
|
||||
public virtual signal void urgent_changed (bool urgent);
|
||||
public virtual signal void user_visible_changed (bool user_visible);
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", type_check_function = "BAMF_IS_WINDOW")]
|
||||
public class Window : Bamf.View {
|
||||
[CCode (has_construct_function = false)]
|
||||
protected Window ();
|
||||
public int get_monitor ();
|
||||
public uint32 get_pid ();
|
||||
public unowned Bamf.Window? get_transient ();
|
||||
public unowned string? get_utf8_prop (string prop);
|
||||
public Bamf.WindowType get_window_type ();
|
||||
public uint32 get_xid ();
|
||||
public ulong last_active ();
|
||||
public Bamf.WindowMaximizationType maximized ();
|
||||
public virtual signal void maximized_changed (int old_value, int new_value);
|
||||
public virtual signal void monitor_changed (int old_value, int new_value);
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", cprefix = "BAMF_CLICK_BEHAVIOR_", has_type_id = false)]
|
||||
public enum ClickBehavior {
|
||||
NONE,
|
||||
OPEN,
|
||||
FOCUS,
|
||||
FOCUS_ALL,
|
||||
MINIMIZE,
|
||||
RESTORE,
|
||||
RESTORE_ALL,
|
||||
PICKER
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", cprefix = "BAMF_WINDOW_", has_type_id = false)]
|
||||
public enum WindowMaximizationType {
|
||||
FLOATING,
|
||||
HORIZONTAL_MAXIMIZED,
|
||||
VERTICAL_MAXIMIZED,
|
||||
MAXIMIZED
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", cprefix = "BAMF_WINDOW_", has_type_id = false)]
|
||||
public enum WindowType {
|
||||
NORMAL,
|
||||
DESKTOP,
|
||||
DOCK,
|
||||
DIALOG,
|
||||
TOOLBAR,
|
||||
MENU,
|
||||
UTILITY,
|
||||
SPLASHSCREEN
|
||||
}
|
||||
}
|
@ -2,13 +2,13 @@
|
||||
|
||||
[CCode (cprefix = "GDesktop", gir_namespace = "GDesktopEnums", gir_version = "3.0", lower_case_cprefix = "g_desktop_")]
|
||||
namespace GDesktop {
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_BACKGROUND_SHADING_")]
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_BACKGROUND_SHADING_", has_type_id = false)]
|
||||
public enum BackgroundShading {
|
||||
SOLID,
|
||||
VERTICAL,
|
||||
HORIZONTAL
|
||||
}
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_BACKGROUND_STYLE_")]
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_BACKGROUND_STYLE_", has_type_id = false)]
|
||||
public enum BackgroundStyle {
|
||||
NONE,
|
||||
WALLPAPER,
|
||||
@ -18,30 +18,30 @@ namespace GDesktop {
|
||||
ZOOM,
|
||||
SPANNED
|
||||
}
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_CLOCK_FORMAT_")]
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_CLOCK_FORMAT_", has_type_id = false)]
|
||||
public enum ClockFormat {
|
||||
@24H,
|
||||
@12H
|
||||
}
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_FOCUS_MODE_")]
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_FOCUS_MODE_", has_type_id = false)]
|
||||
public enum FocusMode {
|
||||
CLICK,
|
||||
SLOPPY,
|
||||
MOUSE
|
||||
}
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_FOCUS_NEW_WINDOWS_")]
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_FOCUS_NEW_WINDOWS_", has_type_id = false)]
|
||||
public enum FocusNewWindows {
|
||||
SMART,
|
||||
STRICT
|
||||
}
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_MOUSE_TRACKING_MODE_")]
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_MOUSE_TRACKING_MODE_", has_type_id = false)]
|
||||
public enum MagnifierMouseTrackingMode {
|
||||
NONE,
|
||||
CENTERED,
|
||||
PROPORTIONAL,
|
||||
PUSH
|
||||
}
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_SCREEN_POSITION_")]
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_SCREEN_POSITION_", has_type_id = false)]
|
||||
public enum MagnifierScreenPosition {
|
||||
NONE,
|
||||
FULL_SCREEN,
|
||||
@ -50,31 +50,31 @@ namespace GDesktop {
|
||||
LEFT_HALF,
|
||||
RIGHT_HALF
|
||||
}
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MOUSE_DWELL_DIRECTION_")]
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MOUSE_DWELL_DIRECTION_", has_type_id = false)]
|
||||
public enum MouseDwellDirection {
|
||||
LEFT,
|
||||
RIGHT,
|
||||
UP,
|
||||
DOWN
|
||||
}
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MOUSE_DWELL_MODE_")]
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MOUSE_DWELL_MODE_", has_type_id = false)]
|
||||
public enum MouseDwellMode {
|
||||
WINDOW,
|
||||
GESTURE
|
||||
}
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_PROXY_MODE_")]
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_PROXY_MODE_", has_type_id = false)]
|
||||
public enum ProxyMode {
|
||||
NONE,
|
||||
MANUAL,
|
||||
AUTO
|
||||
}
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_SCREENSAVER_MODE_")]
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_SCREENSAVER_MODE_", has_type_id = false)]
|
||||
public enum ScreensaverMode {
|
||||
BLANK_ONLY,
|
||||
RANDOM,
|
||||
SINGLE
|
||||
}
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_TITLEBAR_ACTION_")]
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_TITLEBAR_ACTION_", has_type_id = false)]
|
||||
public enum TitlebarAction {
|
||||
TOGGLE_SHADE,
|
||||
TOGGLE_MAXIMIZE,
|
||||
@ -85,19 +85,19 @@ namespace GDesktop {
|
||||
LOWER,
|
||||
MENU
|
||||
}
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_TOOLBAR_ICON_SIZE_")]
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_TOOLBAR_ICON_SIZE_", has_type_id = false)]
|
||||
public enum ToolbarIconSize {
|
||||
SMALL,
|
||||
LARGE
|
||||
}
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_TOOLBAR_STYLE_")]
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_TOOLBAR_STYLE_", has_type_id = false)]
|
||||
public enum ToolbarStyle {
|
||||
BOTH,
|
||||
BOTH_HORIZ,
|
||||
ICONS,
|
||||
TEXT
|
||||
}
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_VISUAL_BELL_")]
|
||||
[CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_VISUAL_BELL_", has_type_id = false)]
|
||||
public enum VisualBellType {
|
||||
FULLSCREEN_FLASH,
|
||||
FRAME_FLASH
|
||||
|
189
vapi/libbamf3.vapi
Normal file
189
vapi/libbamf3.vapi
Normal file
@ -0,0 +1,189 @@
|
||||
/* libbamf3.vapi generated by vapigen, do not modify. */
|
||||
|
||||
[CCode (cprefix = "Bamf", gir_namespace = "Bamf", gir_version = "0.2", lower_case_cprefix = "bamf_")]
|
||||
namespace Bamf {
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", type_id = "bamf_application_get_type ()")]
|
||||
public class Application : Bamf.View {
|
||||
[CCode (has_construct_function = false)]
|
||||
protected Application ();
|
||||
public unowned string get_application_type ();
|
||||
public unowned string get_desktop_file ();
|
||||
public bool get_show_menu_stubs ();
|
||||
public GLib.List<weak Bamf.Window> get_windows ();
|
||||
public GLib.Array<uint> get_xids ();
|
||||
public signal void window_added (Bamf.View object);
|
||||
public signal void window_removed (Bamf.View object);
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", type_id = "bamf_control_get_type ()")]
|
||||
public class Control : GLib.Object {
|
||||
[CCode (has_construct_function = false)]
|
||||
protected Control ();
|
||||
public void insert_desktop_file (string desktop_file);
|
||||
public void register_application_for_pid (string application, int32 pid);
|
||||
public void register_tab_provider (string path);
|
||||
public void set_approver_behavior (int32 behavior);
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", type_id = "bamf_factory_get_type ()")]
|
||||
public class Factory : GLib.Object {
|
||||
[CCode (has_construct_function = false)]
|
||||
protected Factory ();
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", type_id = "bamf_indicator_get_type ()")]
|
||||
public class Indicator : Bamf.View {
|
||||
[CCode (has_construct_function = false)]
|
||||
protected Indicator ();
|
||||
public unowned string get_dbus_menu_path ();
|
||||
public unowned string get_remote_address ();
|
||||
public unowned string get_remote_path ();
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", type_id = "bamf_matcher_get_type ()")]
|
||||
public class Matcher : GLib.Object {
|
||||
[CCode (has_construct_function = false)]
|
||||
protected Matcher ();
|
||||
public bool application_is_running (string application);
|
||||
public unowned Bamf.Application get_active_application ();
|
||||
public unowned Bamf.Window get_active_window ();
|
||||
public unowned Bamf.Application get_application_for_desktop_file (string desktop_file_path, bool create_if_not_found);
|
||||
public unowned Bamf.Application get_application_for_window (Bamf.Window window);
|
||||
public unowned Bamf.Application get_application_for_xid (uint32 xid);
|
||||
public GLib.List<weak Bamf.Application> get_applications ();
|
||||
public static Bamf.Matcher get_default ();
|
||||
public GLib.List<weak Bamf.Application> get_running_applications ();
|
||||
public GLib.List<weak Bamf.View> get_tabs ();
|
||||
public GLib.List<weak Bamf.View> get_window_stack_for_monitor (int monitor);
|
||||
public GLib.List<weak Bamf.View> get_windows ();
|
||||
public GLib.Array<uint32> get_xids_for_application (string application);
|
||||
public void register_favorites ([CCode (array_length = false)] string[] favorites);
|
||||
public signal void active_application_changed (Bamf.View p0, Bamf.View p1);
|
||||
public signal void active_window_changed (Bamf.View p0, Bamf.View p1);
|
||||
public signal void stacking_order_changed ();
|
||||
public signal void view_closed (Bamf.View p0);
|
||||
public signal void view_opened (Bamf.View p0);
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", type_id = "bamf_tab_get_type ()")]
|
||||
public class Tab : Bamf.View {
|
||||
[CCode (has_construct_function = false)]
|
||||
public Tab (string id, string uri);
|
||||
public string get_id ();
|
||||
public string get_preview ();
|
||||
public string get_uri ();
|
||||
public void set_preview (string uri);
|
||||
public void set_uri (string uri);
|
||||
public virtual void show ();
|
||||
[NoAccessorMethod]
|
||||
public string id { owned get; set construct; }
|
||||
public string preview { owned get; set; }
|
||||
public string uri { owned get; set construct; }
|
||||
public virtual signal void preview_updated ();
|
||||
public virtual signal void uri_changed (string new_uri, string p0);
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", type_id = "bamf_tab_source_get_type ()")]
|
||||
public class TabSource : GLib.Object {
|
||||
[CCode (has_construct_function = false)]
|
||||
protected TabSource ();
|
||||
public string get_tab_uri (string tab_id);
|
||||
public uint32 get_tab_xid (string tab_id);
|
||||
[NoWrapper]
|
||||
public virtual string tab_uri (string tab_id);
|
||||
[NoWrapper]
|
||||
public virtual uint32 tab_xid (string tab_id);
|
||||
[NoAccessorMethod]
|
||||
public string id { owned get; set construct; }
|
||||
public signal void tab_closed (string object);
|
||||
public signal void tab_opened (string object);
|
||||
public signal void tab_uri_changed (string object, string p0, string p1);
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", type_id = "bamf_view_get_type ()")]
|
||||
public class View : GLib.InitiallyUnowned {
|
||||
[CCode (has_construct_function = false)]
|
||||
protected View ();
|
||||
[NoWrapper]
|
||||
public virtual Bamf.ClickBehavior click_behavior ();
|
||||
public virtual GLib.List<weak Bamf.View> get_children ();
|
||||
public Bamf.ClickBehavior get_click_suggestion ();
|
||||
public virtual string get_icon ();
|
||||
public virtual string get_name ();
|
||||
[CCode (vfunc_name = "view_type")]
|
||||
public virtual unowned string get_view_type ();
|
||||
public virtual bool is_active ();
|
||||
public bool is_closed ();
|
||||
public virtual bool is_running ();
|
||||
public bool is_sticky ();
|
||||
public virtual bool is_urgent ();
|
||||
[CCode (cname = "bamf_view_user_visible")]
|
||||
public bool is_user_visible ();
|
||||
[NoWrapper]
|
||||
public virtual void set_path (string path);
|
||||
public void set_sticky (bool value);
|
||||
[NoAccessorMethod]
|
||||
public bool active { get; }
|
||||
[NoAccessorMethod]
|
||||
public string path { owned get; }
|
||||
[NoAccessorMethod]
|
||||
public bool running { get; }
|
||||
[NoAccessorMethod]
|
||||
public bool urgent { get; }
|
||||
[NoAccessorMethod]
|
||||
public bool user_visible { get; }
|
||||
public virtual signal void active_changed (bool active);
|
||||
public virtual signal void child_added (Bamf.View child);
|
||||
public virtual signal void child_removed (Bamf.View child);
|
||||
public virtual signal void closed ();
|
||||
public virtual signal void name_changed (string old_name, string new_name);
|
||||
public virtual signal void running_changed (bool running);
|
||||
public virtual signal void urgent_changed (bool urgent);
|
||||
public virtual signal void user_visible_changed (bool user_visible);
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", type_id = "bamf_window_get_type ()")]
|
||||
public class Window : Bamf.View {
|
||||
[CCode (has_construct_function = false)]
|
||||
protected Window ();
|
||||
public int get_monitor ();
|
||||
public uint32 get_pid ();
|
||||
public unowned Bamf.Window get_transient ();
|
||||
public string get_utf8_prop (string prop);
|
||||
public Bamf.WindowType get_window_type ();
|
||||
public uint32 get_xid ();
|
||||
public long last_active ();
|
||||
public Bamf.WindowMaximizationType maximized ();
|
||||
public virtual signal void maximized_changed (int old_value, int new_value);
|
||||
public virtual signal void monitor_changed (int old_value, int new_value);
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", cprefix = "BAMF_CLICK_BEHAVIOR_")]
|
||||
public enum ClickBehavior {
|
||||
NONE,
|
||||
OPEN,
|
||||
FOCUS,
|
||||
FOCUS_ALL,
|
||||
MINIMIZE,
|
||||
RESTORE,
|
||||
RESTORE_ALL,
|
||||
PICKER
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", cprefix = "BAMF_FACTORY_")]
|
||||
public enum FactoryViewType {
|
||||
VIEW,
|
||||
WINDOW,
|
||||
APPLICATION,
|
||||
INDICATOR,
|
||||
NONE
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", cprefix = "BAMF_WINDOW_")]
|
||||
public enum WindowMaximizationType {
|
||||
FLOATING,
|
||||
HORIZONTAL_MAXIMIZED,
|
||||
VERTICAL_MAXIMIZED,
|
||||
MAXIMIZED
|
||||
}
|
||||
[CCode (cheader_filename = "libbamf/libbamf.h", cprefix = "BAMF_WINDOW_")]
|
||||
public enum WindowType {
|
||||
NORMAL,
|
||||
DESKTOP,
|
||||
DOCK,
|
||||
DIALOG,
|
||||
TOOLBAR,
|
||||
MENU,
|
||||
UTILITY,
|
||||
SPLASHSCREEN
|
||||
}
|
||||
}
|
@ -445,7 +445,7 @@ namespace Meta {
|
||||
public unowned string get_gtk_menubar_object_path ();
|
||||
public unowned string get_gtk_unique_bus_name ();
|
||||
public unowned string get_gtk_window_object_path ();
|
||||
public bool get_icon_geometry (Meta.Rectangle rect);
|
||||
public bool get_icon_geometry (out Meta.Rectangle rect);
|
||||
public Meta.Rectangle get_input_rect ();
|
||||
public Meta.StackLayer get_layer ();
|
||||
public Meta.MaximizeFlags get_maximized ();
|
||||
@ -677,11 +677,11 @@ namespace Meta {
|
||||
public Meta.Rectangle rect;
|
||||
public Meta.Side side;
|
||||
}
|
||||
[CCode (cheader_filename = "meta/display.h", cprefix = "META_ATOM_")]
|
||||
[CCode (cheader_filename = "meta/display.h", cprefix = "META_ATOM_", type_id = "meta_atom_get_type ()")]
|
||||
public enum Atom {
|
||||
FIRST
|
||||
}
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_BUTTON_FUNCTION_")]
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_BUTTON_FUNCTION_", type_id = "meta_button_function_get_type ()")]
|
||||
public enum ButtonFunction {
|
||||
MENU,
|
||||
MINIMIZE,
|
||||
@ -695,7 +695,7 @@ namespace Meta {
|
||||
UNSTICK,
|
||||
LAST
|
||||
}
|
||||
[CCode (cheader_filename = "meta/compositor.h", cprefix = "META_COMP_EFFECT_")]
|
||||
[CCode (cheader_filename = "meta/compositor.h", cprefix = "META_COMP_EFFECT_", type_id = "meta_comp_effect_get_type ()")]
|
||||
public enum CompEffect {
|
||||
CREATE,
|
||||
UNMINIMIZE,
|
||||
@ -703,7 +703,7 @@ namespace Meta {
|
||||
MINIMIZE,
|
||||
NONE
|
||||
}
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_CURSOR_")]
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_CURSOR_", type_id = "meta_cursor_get_type ()")]
|
||||
public enum Cursor {
|
||||
DEFAULT,
|
||||
NORTH_RESIZE,
|
||||
@ -717,7 +717,7 @@ namespace Meta {
|
||||
MOVE_OR_RESIZE_WINDOW,
|
||||
BUSY
|
||||
}
|
||||
[CCode (cheader_filename = "meta/util.h", cprefix = "META_DEBUG_")]
|
||||
[CCode (cheader_filename = "meta/util.h", cprefix = "META_DEBUG_", type_id = "meta_debug_topic_get_type ()")]
|
||||
[Flags]
|
||||
public enum DebugTopic {
|
||||
VERBOSE,
|
||||
@ -744,7 +744,7 @@ namespace Meta {
|
||||
COMPOSITOR,
|
||||
EDGE_RESISTANCE
|
||||
}
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_DIRECTION_")]
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_DIRECTION_", type_id = "meta_direction_get_type ()")]
|
||||
[Flags]
|
||||
public enum Direction {
|
||||
LEFT,
|
||||
@ -756,18 +756,18 @@ namespace Meta {
|
||||
HORIZONTAL,
|
||||
VERTICAL
|
||||
}
|
||||
[CCode (cheader_filename = "meta/boxes.h", cprefix = "META_EDGE_")]
|
||||
[CCode (cheader_filename = "meta/boxes.h", cprefix = "META_EDGE_", type_id = "meta_edge_type_get_type ()")]
|
||||
public enum EdgeType {
|
||||
WINDOW,
|
||||
MONITOR,
|
||||
SCREEN
|
||||
}
|
||||
[CCode (cheader_filename = "meta/main.h", cprefix = "META_EXIT_")]
|
||||
[CCode (cheader_filename = "meta/main.h", cprefix = "META_EXIT_", type_id = "meta_exit_code_get_type ()")]
|
||||
public enum ExitCode {
|
||||
SUCCESS,
|
||||
ERROR
|
||||
}
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_FRAME_")]
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_FRAME_", type_id = "meta_frame_flags_get_type ()")]
|
||||
[Flags]
|
||||
public enum FrameFlags {
|
||||
ALLOWS_DELETE,
|
||||
@ -788,7 +788,7 @@ namespace Meta {
|
||||
TILED_LEFT,
|
||||
TILED_RIGHT
|
||||
}
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_FRAME_TYPE_")]
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_FRAME_TYPE_", type_id = "meta_frame_type_get_type ()")]
|
||||
public enum FrameType {
|
||||
NORMAL,
|
||||
DIALOG,
|
||||
@ -801,7 +801,7 @@ namespace Meta {
|
||||
[CCode (cheader_filename = "meta/main.h")]
|
||||
public static unowned string to_string (Meta.FrameType type);
|
||||
}
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_GRAB_OP_")]
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_GRAB_OP_", type_id = "meta_grab_op_get_type ()")]
|
||||
public enum GrabOp {
|
||||
NONE,
|
||||
MOVING,
|
||||
@ -843,14 +843,14 @@ namespace Meta {
|
||||
CLICKING_UNSTICK,
|
||||
COMPOSITOR
|
||||
}
|
||||
[CCode (cheader_filename = "meta/gradient.h", cprefix = "META_GRADIENT_")]
|
||||
[CCode (cheader_filename = "meta/gradient.h", cprefix = "META_GRADIENT_", type_id = "meta_gradient_type_get_type ()")]
|
||||
public enum GradientType {
|
||||
VERTICAL,
|
||||
HORIZONTAL,
|
||||
DIAGONAL,
|
||||
LAST
|
||||
}
|
||||
[CCode (cheader_filename = "meta/prefs.h", cprefix = "META_KEYBINDING_ACTION_")]
|
||||
[CCode (cheader_filename = "meta/prefs.h", cprefix = "META_KEYBINDING_ACTION_", type_id = "meta_key_binding_action_get_type ()")]
|
||||
public enum KeyBindingAction {
|
||||
NONE,
|
||||
WORKSPACE_1,
|
||||
@ -932,9 +932,10 @@ namespace Meta {
|
||||
MOVE_TO_SIDE_E,
|
||||
MOVE_TO_SIDE_W,
|
||||
MOVE_TO_CENTER,
|
||||
OVERLAY_KEY,
|
||||
LAST
|
||||
}
|
||||
[CCode (cheader_filename = "meta/prefs.h", cprefix = "META_KEY_BINDING_")]
|
||||
[CCode (cheader_filename = "meta/prefs.h", cprefix = "META_KEY_BINDING_", type_id = "meta_key_binding_flags_get_type ()")]
|
||||
[Flags]
|
||||
public enum KeyBindingFlags {
|
||||
NONE,
|
||||
@ -943,19 +944,19 @@ namespace Meta {
|
||||
REVERSES,
|
||||
IS_REVERSED
|
||||
}
|
||||
[CCode (cheader_filename = "meta/util.h", cprefix = "META_LATER_")]
|
||||
[CCode (cheader_filename = "meta/util.h", cprefix = "META_LATER_", type_id = "meta_later_type_get_type ()")]
|
||||
public enum LaterType {
|
||||
RESIZE,
|
||||
BEFORE_REDRAW,
|
||||
IDLE
|
||||
}
|
||||
[CCode (cheader_filename = "meta/window.h", cprefix = "META_MAXIMIZE_")]
|
||||
[CCode (cheader_filename = "meta/window.h", cprefix = "META_MAXIMIZE_", type_id = "meta_maximize_flags_get_type ()")]
|
||||
[Flags]
|
||||
public enum MaximizeFlags {
|
||||
HORIZONTAL,
|
||||
VERTICAL
|
||||
}
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_MENU_OP_")]
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_MENU_OP_", type_id = "meta_menu_op_get_type ()")]
|
||||
[Flags]
|
||||
public enum MenuOp {
|
||||
NONE,
|
||||
@ -978,13 +979,13 @@ namespace Meta {
|
||||
MOVE_DOWN,
|
||||
RECOVER
|
||||
}
|
||||
[CCode (cheader_filename = "meta/meta-plugin.h", cprefix = "META_MODAL_")]
|
||||
[CCode (cheader_filename = "meta/meta-plugin.h", cprefix = "META_MODAL_", type_id = "meta_modal_options_get_type ()")]
|
||||
[Flags]
|
||||
public enum ModalOptions {
|
||||
POINTER_ALREADY_GRABBED,
|
||||
KEYBOARD_ALREADY_GRABBED
|
||||
}
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_MOTION_")]
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_MOTION_", type_id = "meta_motion_direction_get_type ()")]
|
||||
public enum MotionDirection {
|
||||
UP,
|
||||
DOWN,
|
||||
@ -995,7 +996,7 @@ namespace Meta {
|
||||
DOWN_LEFT,
|
||||
DOWN_RIGHT
|
||||
}
|
||||
[CCode (cheader_filename = "meta/prefs.h", cprefix = "META_PREF_")]
|
||||
[CCode (cheader_filename = "meta/prefs.h", cprefix = "META_PREF_", type_id = "meta_preference_get_type ()")]
|
||||
public enum Preference {
|
||||
MOUSE_BUTTON_MODS,
|
||||
FOCUS_MODE,
|
||||
@ -1032,21 +1033,21 @@ namespace Meta {
|
||||
[CCode (cheader_filename = "meta/main.h")]
|
||||
public static unowned string to_string (Meta.Preference pref);
|
||||
}
|
||||
[CCode (cheader_filename = "meta/screen.h", cprefix = "META_SCREEN_")]
|
||||
[CCode (cheader_filename = "meta/screen.h", cprefix = "META_SCREEN_", type_id = "meta_screen_corner_get_type ()")]
|
||||
public enum ScreenCorner {
|
||||
TOPLEFT,
|
||||
TOPRIGHT,
|
||||
BOTTOMLEFT,
|
||||
BOTTOMRIGHT
|
||||
}
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_SIDE_")]
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_SIDE_", type_id = "meta_side_get_type ()")]
|
||||
public enum Side {
|
||||
LEFT,
|
||||
RIGHT,
|
||||
TOP,
|
||||
BOTTOM
|
||||
}
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_LAYER_")]
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_LAYER_", type_id = "meta_stack_layer_get_type ()")]
|
||||
public enum StackLayer {
|
||||
DESKTOP,
|
||||
BOTTOM,
|
||||
@ -1058,19 +1059,19 @@ namespace Meta {
|
||||
OVERRIDE_REDIRECT,
|
||||
LAST
|
||||
}
|
||||
[CCode (cheader_filename = "meta/display.h", cprefix = "META_TAB_LIST_")]
|
||||
[CCode (cheader_filename = "meta/display.h", cprefix = "META_TAB_LIST_", type_id = "meta_tab_list_get_type ()")]
|
||||
public enum TabList {
|
||||
NORMAL,
|
||||
DOCKS,
|
||||
GROUP,
|
||||
NORMAL_ALL
|
||||
}
|
||||
[CCode (cheader_filename = "meta/display.h", cprefix = "META_TAB_SHOW_")]
|
||||
[CCode (cheader_filename = "meta/display.h", cprefix = "META_TAB_SHOW_", type_id = "meta_tab_show_type_get_type ()")]
|
||||
public enum TabShowType {
|
||||
ICON,
|
||||
INSTANTLY
|
||||
}
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_VIRTUAL_")]
|
||||
[CCode (cheader_filename = "meta/common.h", cprefix = "META_VIRTUAL_", type_id = "meta_virtual_modifier_get_type ()")]
|
||||
[Flags]
|
||||
public enum VirtualModifier {
|
||||
SHIFT_MASK,
|
||||
@ -1084,7 +1085,7 @@ namespace Meta {
|
||||
MOD4_MASK,
|
||||
MOD5_MASK
|
||||
}
|
||||
[CCode (cheader_filename = "meta/window.h", cprefix = "META_WINDOW_")]
|
||||
[CCode (cheader_filename = "meta/window.h", cprefix = "META_WINDOW_", type_id = "meta_window_type_get_type ()")]
|
||||
public enum WindowType {
|
||||
NORMAL,
|
||||
DESKTOP,
|
||||
|
Loading…
Reference in New Issue
Block a user