Hide dialogs when exposing, close on escape, update to gala trunk rev195

This commit is contained in:
Tom Beckmann 2012-08-23 17:07:18 +02:00
commit a5d81b1fe4
12 changed files with 489 additions and 259 deletions

View File

@ -29,9 +29,9 @@ configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_BINARY_DIR}/sr
add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\") add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
find_package(PkgConfig) 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) if (MUTTER36_FOUND)
set (GALAVALAFLAGS "--define=HAS_MUTTER36") set (GALAVALAFLAGS "--define=HAS_MUTTER36")
endif (MUTTER36_FOUND) endif (MUTTER36_FOUND)
@ -62,12 +62,13 @@ vala_precompile(VALA_C
${CMAKE_BINARY_DIR}/src/Config.vala ${CMAKE_BINARY_DIR}/src/Config.vala
PACKAGES PACKAGES
granite granite
libbamf3
libmutter libmutter
plank
clutter-gtk-1.0 clutter-gtk-1.0
gdk-x11-3.0 gdk-x11-3.0
gdesktopenums-3.0 gdesktopenums-3.0
xfixes-4.0 xfixes-4.0
bamf
OPTIONS OPTIONS
-g -g
--vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi/ --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi/

View File

@ -43,7 +43,7 @@ namespace Gala
public override bool key_press_event (Clutter.KeyEvent event) 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! //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); close (true);
return true; return true;
@ -256,11 +256,16 @@ namespace Gala
var used_windows = new SList<Window> (); var used_windows = new SList<Window> ();
screen.get_active_workspace ().list_windows ().foreach ((w) => { foreach (var window in screen.get_active_workspace ().list_windows ()) {
if (w.window_type != Meta.WindowType.NORMAL || w.minimized) if (window.window_type != WindowType.NORMAL && window.window_type != WindowType.DOCK) {
return; (window.get_compositor_private () as Actor).hide ();
used_windows.append (w); continue;
}); }
if (window.window_type == WindowType.DOCK)
continue;
used_windows.append (window);
}
var n_windows = used_windows.length (); var n_windows = used_windows.length ();
if (n_windows == 0) if (n_windows == 0)
@ -330,11 +335,17 @@ namespace Gala
visible = false; visible = false;
ready = true; ready = true;
foreach (var window in screen.get_active_workspace ().list_windows ())
(window.get_compositor_private () as Actor).show ();
return false; return false;
}); });
} else { } else {
ready = true; ready = true;
visible = false; visible = false;
foreach (var window in screen.get_active_workspace ().list_windows ())
(window.get_compositor_private () as Actor).show ();
} }
} }
} }

View File

@ -54,6 +54,8 @@ namespace Gala
GLib.Environment.unset_variable ("NO_GAIL"); GLib.Environment.unset_variable ("NO_GAIL");
GLib.Environment.unset_variable ("NO_AT_BRIDGE"); GLib.Environment.unset_variable ("NO_AT_BRIDGE");
Plank.Services.Paths.initialize ("plank", Config.DATADIR + "/plank");
return Meta.run (); return Meta.run ();
} }
} }

View File

@ -262,15 +262,16 @@ namespace Gala
workspace_view.show (); workspace_view.show ();
break; break;
case ActionType.MAXIMIZE_CURRENT: case ActionType.MAXIMIZE_CURRENT:
if (current == null) if (current == null || current.window_type != WindowType.NORMAL)
break; break;
if (current.get_maximized () == (MaximizeFlags.HORIZONTAL | MaximizeFlags.VERTICAL)) if (current.get_maximized () == (MaximizeFlags.HORIZONTAL | MaximizeFlags.VERTICAL))
current.unmaximize (MaximizeFlags.HORIZONTAL | MaximizeFlags.VERTICAL); current.unmaximize (MaximizeFlags.HORIZONTAL | MaximizeFlags.VERTICAL);
else else
current.maximize (MaximizeFlags.HORIZONTAL | MaximizeFlags.VERTICAL); current.maximize (MaximizeFlags.HORIZONTAL | MaximizeFlags.VERTICAL);
break; break;
case ActionType.MINIMIZE_CURRENT: case ActionType.MINIMIZE_CURRENT:
if (current != null) if (current != null && current.window_type == WindowType.NORMAL)
current.minimize (); current.minimize ();
break; break;
case ActionType.OPEN_LAUNCHER: case ActionType.OPEN_LAUNCHER:
@ -310,7 +311,7 @@ namespace Gala
get_screen ().get_size (out width, out height); get_screen ().get_size (out width, out height);
Rectangle icon = {}; 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_x = (float)icon.width / actor.width;
float scale_y = (float)icon.height / actor.height; float scale_y = (float)icon.height / actor.height;
@ -392,6 +393,7 @@ namespace Gala
var display = screen.get_display (); var display = screen.get_display ();
var window = actor.get_meta_window (); var window = actor.get_meta_window ();
actor.detach_animation ();
actor.show (); actor.show ();
switch (window.window_type) { switch (window.window_type) {
@ -465,6 +467,7 @@ namespace Gala
var display = screen.get_display (); var display = screen.get_display ();
var window = actor.get_meta_window (); var window = actor.get_meta_window ();
actor.detach_animation ();
destroying.add (actor); destroying.add (actor);
switch (window.window_type) { switch (window.window_type) {

View File

@ -73,6 +73,9 @@ namespace Gala.Utils
image.fill (0x00000000); image.fill (0x00000000);
} }
if (size != image.width || size != image.height)
return Plank.Drawing.DrawingService.ar_scale (image, size, size);
return image; return image;
} }

View File

@ -20,7 +20,7 @@ using Granite.Drawing;
namespace Gala namespace Gala
{ {
public class WindowSwitcher : Clutter.Group public class WindowSwitcher : Clutter.Actor
{ {
Gala.Plugin plugin; Gala.Plugin plugin;
@ -28,11 +28,80 @@ namespace Gala
Meta.Window? current_window; 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) public WindowSwitcher (Gala.Plugin _plugin)
{ {
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) public override bool key_release_event (Clutter.KeyEvent event)
@ -59,6 +128,8 @@ namespace Gala
meta_win.is_on_all_workspaces ()) meta_win.is_on_all_workspaces ())
w.show (); w.show ();
}); });
if (dock_window != null)
dock_window.opacity = 0;
window_clones.clear (); window_clones.clear ();
@ -68,17 +139,44 @@ namespace Gala
current_window = null; 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) public override bool captured_event (Clutter.Event event)
{ {
if (!(event.get_type () == EventType.KEY_PRESS))
return false;
var screen = plugin.get_screen (); var screen = plugin.get_screen ();
var display = screen.get_display (); 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; bool backward = (event.get_state () & X.KeyMask.ShiftMask) != 0;
var action = display.get_keybinding_action (event.get_key_code (), event.get_state ()); var action = display.get_keybinding_action (event.get_key_code (), event.get_state ());
@ -88,11 +186,13 @@ namespace Gala
case Meta.KeyBindingAction.SWITCH_WINDOWS: case Meta.KeyBindingAction.SWITCH_WINDOWS:
current_window = display.get_tab_next (Meta.TabList.NORMAL, screen, current_window = display.get_tab_next (Meta.TabList.NORMAL, screen,
screen.get_active_workspace (), current_window, backward); screen.get_active_workspace (), current_window, backward);
last_time = display.get_current_time_roundtrip ();
break; break;
case Meta.KeyBindingAction.SWITCH_GROUP_BACKWARD: case Meta.KeyBindingAction.SWITCH_GROUP_BACKWARD:
case Meta.KeyBindingAction.SWITCH_WINDOWS_BACKWARD: case Meta.KeyBindingAction.SWITCH_WINDOWS_BACKWARD:
current_window = display.get_tab_next (Meta.TabList.NORMAL, screen, current_window = display.get_tab_next (Meta.TabList.NORMAL, screen,
screen.get_active_workspace (), current_window, true); screen.get_active_workspace (), current_window, true);
last_time = display.get_current_time_roundtrip ();
break; break;
default: default:
break; break;
@ -108,20 +208,26 @@ namespace Gala
void dim_windows () void dim_windows ()
{ {
var current_actor = current_window.get_compositor_private () as Actor; var current_actor = current_window.get_compositor_private () as Actor;
var i = 0;
foreach (var clone in window_clones) { foreach (var clone in window_clones) {
if (current_actor == clone.source) { 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); 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 { } else {
clone.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, depth : -200.0f, opacity : 0); 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, public void handle_switch_windows (Meta.Display display, Meta.Screen screen, Meta.Window? window,
X.Event event, Meta.KeyBinding binding) X.Event event, Meta.KeyBinding binding)
{ {
if (active) { if (visible) {
if (window_clones.size != 0) if (window_clones.size != 0)
close (screen.get_display ().get_current_time ()); close (screen.get_display ().get_current_time ());
return; return;
@ -131,10 +237,11 @@ namespace Gala
if (metawindows.length () <= 1) if (metawindows.length () <= 1)
return; return;
active = true; visible = true;
//grab the windows to be switched
var layout = dock.layout_manager as BoxLayout;
window_clones.clear (); window_clones.clear ();
foreach (var win in metawindows) { foreach (var win in metawindows) {
var actor = win.get_compositor_private () as Actor; var actor = win.get_compositor_private () as Actor;
var clone = new Clone (actor); var clone = new Clone (actor);
@ -143,19 +250,33 @@ namespace Gala
add_child (clone); add_child (clone);
window_clones.add (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) => { Meta.Compositor.get_window_actors (screen).foreach ((w) => {
var type = w.get_meta_window ().window_type; var type = w.get_meta_window ().window_type;
if (type != Meta.WindowType.DOCK && type != Meta.WindowType.DESKTOP && type != Meta.WindowType.NOTIFICATION) if (type != Meta.WindowType.DOCK && type != Meta.WindowType.DESKTOP && type != Meta.WindowType.NOTIFICATION)
w.hide (); w.hide ();
if (w.get_meta_window ().title in DOCK_NAMES && type == Meta.WindowType.DOCK) {
dock_window = w;
dock_window.hide ();
}
}); });
plugin.begin_modal (); plugin.begin_modal ();
bool backward = (binding.get_name () == "switch-windows-backward"); bool backward = (binding.get_name () == "switch-windows-backward");
/*list windows*/
current_window = Utils.get_next_window (screen.get_active_workspace (), backward); current_window = Utils.get_next_window (screen.get_active_workspace (), backward);
if (current_window == null) if (current_window == null)
return; return;
@ -165,6 +286,30 @@ namespace Gala
return; 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 (); dim_windows ();
grab_key_focus (); grab_key_focus ();
} }

View File

@ -46,7 +46,7 @@ namespace Gala
internal Clone wallpaper; internal Clone wallpaper;
Clutter.Actor windows; Clutter.Actor windows;
internal Clutter.Actor icons; internal Clutter.Actor icons;
CairoTexture indicator; Actor indicator;
GtkClutter.Texture close_button; GtkClutter.Texture close_button;
uint hover_timer = 0; uint hover_timer = 0;
@ -75,10 +75,14 @@ namespace Gala
reactive = true; reactive = true;
indicator = new Clutter.CairoTexture ((uint)width + 2 * INDICATOR_BORDER, (uint)THUMBNAIL_HEIGHT + 2 * INDICATOR_BORDER); indicator = new Actor ();
indicator.draw.connect (draw_indicator); indicator.width = width + 2 * INDICATOR_BORDER;
indicator.auto_resize = true; indicator.height = THUMBNAIL_HEIGHT + 2 * INDICATOR_BORDER;
indicator.opacity = 0; 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); 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 // 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) 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; return false;
} }

View File

@ -27,8 +27,7 @@ namespace Gala
Screen screen; Screen screen;
Clutter.Actor thumbnails; Clutter.Actor thumbnails;
Clutter.CairoTexture background; Clutter.Actor scroll;
Clutter.CairoTexture scroll;
Clutter.Actor click_catcher; //invisible plane that catches clicks outside the view Clutter.Actor click_catcher; //invisible plane that catches clicks outside the view
bool animating; // delay closing the popup 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).spacing = 12;
(thumbnails.layout_manager as Clutter.BoxLayout).homogeneous = true; (thumbnails.layout_manager as Clutter.BoxLayout).homogeneous = true;
background = new Clutter.CairoTexture (500, (uint)height); content = new Clutter.Canvas ();
background.auto_resize = true; (content as Clutter.Canvas).draw.connect (draw_background);
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);
scroll = new Clutter.CairoTexture (100, 12); scroll = new Clutter.Actor ();
scroll.height = 12; scroll.height = 12;
scroll.auto_resize = true; scroll.content = new Clutter.Canvas ();
scroll.draw.connect (draw_scroll); (scroll.content as Clutter.Canvas).draw.connect (draw_scroll);
click_catcher = new Clutter.Actor (); click_catcher = new Clutter.Actor ();
click_catcher.reactive = true; click_catcher.reactive = true;
@ -77,7 +73,6 @@ namespace Gala
}); });
Compositor.get_stage_for_screen (screen).add_child (click_catcher); Compositor.get_stage_for_screen (screen).add_child (click_catcher);
add_child (background);
add_child (thumbnails); add_child (thumbnails);
add_child (scroll); add_child (scroll);
@ -125,6 +120,10 @@ namespace Gala
bool draw_background (Cairo.Context cr) 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_background (cr, 0, 0, width, height);
background_style.render_frame (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) 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); Granite.Drawing.Utilities.cairo_rounded_rectangle (cr, 4, 4, scroll.width-32, 4, 2);
cr.set_source_rgba (1, 1, 1, 0.8); cr.set_source_rgba (1, 1, 1, 0.8);
cr.fill (); cr.fill ();
@ -192,6 +195,7 @@ namespace Gala
if (thumbnails.x + thumbnails.width < width) if (thumbnails.x + thumbnails.width < width)
thumbnails.x = width - thumbnails.width; thumbnails.x = width - thumbnails.width;
scroll.width = width / thumbnails.width * width; scroll.width = width / thumbnails.width * width;
(scroll.content as Clutter.Canvas).set_size ((int)scroll.width, 12);
} else { } else {
thumbnails.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 400, x : width / 2 - thumbnails.width / 2); 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) void switch_to_next_workspace (MotionDirection direction)
{ {
var screen = plugin.get_screen ();
var display = screen.get_display (); var display = screen.get_display ();
var neighbor = screen.get_active_workspace ().get_neighbor (direction); var neighbor = screen.get_active_workspace ().get_neighbor (direction);
if (neighbor == null)
return;
neighbor.activate (display.get_current_time ()); 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) { public override bool leave_event (Clutter.CrossingEvent event) {
@ -217,20 +226,35 @@ namespace Gala
return false; return false;
} }
uint last_time = -1;
bool released = false;
public override bool key_press_event (Clutter.KeyEvent event) 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) { switch (event.keyval) {
case Clutter.Key.Left: case Clutter.Key.Left:
if ((event.modifier_state & Clutter.ModifierType.SHIFT_MASK) == 1) 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 else
switch_to_next_workspace (MotionDirection.LEFT); switch_to_next_workspace (MotionDirection.LEFT);
released = false;
last_time = display.get_current_time_roundtrip ();
return false; return false;
case Clutter.Key.Right: case Clutter.Key.Right:
if ((event.modifier_state & Clutter.ModifierType.SHIFT_MASK) == 1) 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 else
switch_to_next_workspace (MotionDirection.RIGHT); switch_to_next_workspace (MotionDirection.RIGHT);
released = false;
last_time = display.get_current_time_roundtrip ();
return false; return false;
default: default:
break; break;
@ -241,6 +265,8 @@ namespace Gala
public override bool key_release_event (Clutter.KeyEvent event) public override bool key_release_event (Clutter.KeyEvent event)
{ {
released = true;
if (event.keyval == Clutter.Key.Alt_L || if (event.keyval == Clutter.Key.Alt_L ||
event.keyval == Clutter.Key.Super_L || event.keyval == Clutter.Key.Super_L ||
event.keyval == Clutter.Key.Control_L || event.keyval == Clutter.Key.Control_L ||
@ -316,6 +342,7 @@ namespace Gala
y = area.height + area.y; y = area.height + area.y;
x = area.x; x = area.x;
width = area.width; width = area.width;
(content as Clutter.Canvas).set_size ((int)width, (int)height);
thumbnails.get_children ().foreach ((thumb) => { thumbnails.get_children ().foreach ((thumb) => {
thumb.show (); thumb.show ();
@ -347,8 +374,12 @@ namespace Gala
return false; return false;
}); //catch hot corner hiding problem and indicator placement }); //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); 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 () public new void hide ()
@ -371,7 +402,10 @@ namespace Gala
click_catcher.visible = false; 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, public void handle_switch_to_workspace (Meta.Display display, Meta.Screen screen, Meta.Window? window,

View File

@ -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
}
}

View File

@ -2,13 +2,13 @@
[CCode (cprefix = "GDesktop", gir_namespace = "GDesktopEnums", gir_version = "3.0", lower_case_cprefix = "g_desktop_")] [CCode (cprefix = "GDesktop", gir_namespace = "GDesktopEnums", gir_version = "3.0", lower_case_cprefix = "g_desktop_")]
namespace GDesktop { 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 { public enum BackgroundShading {
SOLID, SOLID,
VERTICAL, VERTICAL,
HORIZONTAL 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 { public enum BackgroundStyle {
NONE, NONE,
WALLPAPER, WALLPAPER,
@ -18,30 +18,30 @@ namespace GDesktop {
ZOOM, ZOOM,
SPANNED 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 { public enum ClockFormat {
@24H, @24H,
@12H @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 { public enum FocusMode {
CLICK, CLICK,
SLOPPY, SLOPPY,
MOUSE 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 { public enum FocusNewWindows {
SMART, SMART,
STRICT 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 { public enum MagnifierMouseTrackingMode {
NONE, NONE,
CENTERED, CENTERED,
PROPORTIONAL, PROPORTIONAL,
PUSH 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 { public enum MagnifierScreenPosition {
NONE, NONE,
FULL_SCREEN, FULL_SCREEN,
@ -50,31 +50,31 @@ namespace GDesktop {
LEFT_HALF, LEFT_HALF,
RIGHT_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 { public enum MouseDwellDirection {
LEFT, LEFT,
RIGHT, RIGHT,
UP, UP,
DOWN 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 { public enum MouseDwellMode {
WINDOW, WINDOW,
GESTURE 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 { public enum ProxyMode {
NONE, NONE,
MANUAL, MANUAL,
AUTO 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 { public enum ScreensaverMode {
BLANK_ONLY, BLANK_ONLY,
RANDOM, RANDOM,
SINGLE 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 { public enum TitlebarAction {
TOGGLE_SHADE, TOGGLE_SHADE,
TOGGLE_MAXIMIZE, TOGGLE_MAXIMIZE,
@ -85,19 +85,19 @@ namespace GDesktop {
LOWER, LOWER,
MENU 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 { public enum ToolbarIconSize {
SMALL, SMALL,
LARGE 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 { public enum ToolbarStyle {
BOTH, BOTH,
BOTH_HORIZ, BOTH_HORIZ,
ICONS, ICONS,
TEXT 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 { public enum VisualBellType {
FULLSCREEN_FLASH, FULLSCREEN_FLASH,
FRAME_FLASH FRAME_FLASH

189
vapi/libbamf3.vapi Normal file
View 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
}
}

View File

@ -445,7 +445,7 @@ namespace Meta {
public unowned string get_gtk_menubar_object_path (); public unowned string get_gtk_menubar_object_path ();
public unowned string get_gtk_unique_bus_name (); public unowned string get_gtk_unique_bus_name ();
public unowned string get_gtk_window_object_path (); 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.Rectangle get_input_rect ();
public Meta.StackLayer get_layer (); public Meta.StackLayer get_layer ();
public Meta.MaximizeFlags get_maximized (); public Meta.MaximizeFlags get_maximized ();
@ -677,11 +677,11 @@ namespace Meta {
public Meta.Rectangle rect; public Meta.Rectangle rect;
public Meta.Side side; 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 { public enum Atom {
FIRST 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 { public enum ButtonFunction {
MENU, MENU,
MINIMIZE, MINIMIZE,
@ -695,7 +695,7 @@ namespace Meta {
UNSTICK, UNSTICK,
LAST 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 { public enum CompEffect {
CREATE, CREATE,
UNMINIMIZE, UNMINIMIZE,
@ -703,7 +703,7 @@ namespace Meta {
MINIMIZE, MINIMIZE,
NONE 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 { public enum Cursor {
DEFAULT, DEFAULT,
NORTH_RESIZE, NORTH_RESIZE,
@ -717,7 +717,7 @@ namespace Meta {
MOVE_OR_RESIZE_WINDOW, MOVE_OR_RESIZE_WINDOW,
BUSY 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] [Flags]
public enum DebugTopic { public enum DebugTopic {
VERBOSE, VERBOSE,
@ -744,7 +744,7 @@ namespace Meta {
COMPOSITOR, COMPOSITOR,
EDGE_RESISTANCE 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] [Flags]
public enum Direction { public enum Direction {
LEFT, LEFT,
@ -756,18 +756,18 @@ namespace Meta {
HORIZONTAL, HORIZONTAL,
VERTICAL 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 { public enum EdgeType {
WINDOW, WINDOW,
MONITOR, MONITOR,
SCREEN 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 { public enum ExitCode {
SUCCESS, SUCCESS,
ERROR 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] [Flags]
public enum FrameFlags { public enum FrameFlags {
ALLOWS_DELETE, ALLOWS_DELETE,
@ -788,7 +788,7 @@ namespace Meta {
TILED_LEFT, TILED_LEFT,
TILED_RIGHT 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 { public enum FrameType {
NORMAL, NORMAL,
DIALOG, DIALOG,
@ -801,7 +801,7 @@ namespace Meta {
[CCode (cheader_filename = "meta/main.h")] [CCode (cheader_filename = "meta/main.h")]
public static unowned string to_string (Meta.FrameType type); 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 { public enum GrabOp {
NONE, NONE,
MOVING, MOVING,
@ -843,14 +843,14 @@ namespace Meta {
CLICKING_UNSTICK, CLICKING_UNSTICK,
COMPOSITOR 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 { public enum GradientType {
VERTICAL, VERTICAL,
HORIZONTAL, HORIZONTAL,
DIAGONAL, DIAGONAL,
LAST 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 { public enum KeyBindingAction {
NONE, NONE,
WORKSPACE_1, WORKSPACE_1,
@ -932,9 +932,10 @@ namespace Meta {
MOVE_TO_SIDE_E, MOVE_TO_SIDE_E,
MOVE_TO_SIDE_W, MOVE_TO_SIDE_W,
MOVE_TO_CENTER, MOVE_TO_CENTER,
OVERLAY_KEY,
LAST 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] [Flags]
public enum KeyBindingFlags { public enum KeyBindingFlags {
NONE, NONE,
@ -943,19 +944,19 @@ namespace Meta {
REVERSES, REVERSES,
IS_REVERSED 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 { public enum LaterType {
RESIZE, RESIZE,
BEFORE_REDRAW, BEFORE_REDRAW,
IDLE 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] [Flags]
public enum MaximizeFlags { public enum MaximizeFlags {
HORIZONTAL, HORIZONTAL,
VERTICAL 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] [Flags]
public enum MenuOp { public enum MenuOp {
NONE, NONE,
@ -978,13 +979,13 @@ namespace Meta {
MOVE_DOWN, MOVE_DOWN,
RECOVER 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] [Flags]
public enum ModalOptions { public enum ModalOptions {
POINTER_ALREADY_GRABBED, POINTER_ALREADY_GRABBED,
KEYBOARD_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 { public enum MotionDirection {
UP, UP,
DOWN, DOWN,
@ -995,7 +996,7 @@ namespace Meta {
DOWN_LEFT, DOWN_LEFT,
DOWN_RIGHT 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 { public enum Preference {
MOUSE_BUTTON_MODS, MOUSE_BUTTON_MODS,
FOCUS_MODE, FOCUS_MODE,
@ -1032,21 +1033,21 @@ namespace Meta {
[CCode (cheader_filename = "meta/main.h")] [CCode (cheader_filename = "meta/main.h")]
public static unowned string to_string (Meta.Preference pref); 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 { public enum ScreenCorner {
TOPLEFT, TOPLEFT,
TOPRIGHT, TOPRIGHT,
BOTTOMLEFT, BOTTOMLEFT,
BOTTOMRIGHT 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 { public enum Side {
LEFT, LEFT,
RIGHT, RIGHT,
TOP, TOP,
BOTTOM 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 { public enum StackLayer {
DESKTOP, DESKTOP,
BOTTOM, BOTTOM,
@ -1058,19 +1059,19 @@ namespace Meta {
OVERRIDE_REDIRECT, OVERRIDE_REDIRECT,
LAST 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 { public enum TabList {
NORMAL, NORMAL,
DOCKS, DOCKS,
GROUP, GROUP,
NORMAL_ALL 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 { public enum TabShowType {
ICON, ICON,
INSTANTLY 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] [Flags]
public enum VirtualModifier { public enum VirtualModifier {
SHIFT_MASK, SHIFT_MASK,
@ -1084,7 +1085,7 @@ namespace Meta {
MOD4_MASK, MOD4_MASK,
MOD5_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 { public enum WindowType {
NORMAL, NORMAL,
DESKTOP, DESKTOP,