lib: remove public functions for accessing InputArea, fix input area assignment

Rename now internal InputArea.HOTCORNER to DEFAULT for a more fitting description since
it is used by plugins as well and not just HOTCORNERS in the "default" mode.
Fix InputArea.NONE being always assigned when no hotcorners are configured.
Plugins won't need access to the InputArea functions since they're all handled within
the wm and reconfigured when the plugin changes its area or the wm's modal mode.
This commit is contained in:
Tom Beckmann 2014-08-31 19:09:38 +02:00
parent 95330478f5
commit cc244921f9
4 changed files with 17 additions and 25 deletions

View File

@ -29,13 +29,6 @@ namespace Gala
WINDOW_OVERVIEW_ALL
}
public enum InputArea
{
NONE,
FULLSCREEN,
HOT_CORNER
}
public interface WindowManager : Meta.Plugin
{
public abstract Clutter.Actor ui_group { get; protected set; }
@ -52,7 +45,6 @@ namespace Gala
public abstract void end_modal ();
public abstract bool is_modal ();
public abstract void perform_action (ActionType type);
public abstract void update_input_area ();
public abstract void move_window (Meta.Window? window, Meta.MotionDirection direction);
public abstract void switch_to_next_workspace (Meta.MotionDirection direction);
}

View File

@ -19,6 +19,13 @@ using Meta;
namespace Gala
{
public enum InputArea
{
NONE,
FULLSCREEN,
DEFAULT
}
public class InternalUtils
{
/**
@ -113,7 +120,7 @@ namespace Gala
X.Xrectangle rect = {0, 0, (ushort)width, (ushort)height};
rects = {rect};
break;
case InputArea.HOT_CORNER:
case InputArea.DEFAULT:
var schema = BehaviorSettings.get_default ().schema;
// if ActionType is NONE make it 0 sized
@ -128,6 +135,13 @@ namespace Gala
X.Xrectangle bottomright = {(short)(geometry.x + geometry.width - 1), (short)(geometry.y + geometry.height - 1), br_size, br_size};
rects = {topleft, topright, bottomleft, bottomright};
// add plugin's requested areas
if (area == InputArea.FULLSCREEN || area == InputArea.DEFAULT) {
foreach (var rect in PluginManager.get_default ().regions) {
rects += rect;
}
}
break;
case InputArea.NONE:
default:
@ -135,13 +149,6 @@ namespace Gala
return;
}
// add plugin's requested areas
if (area == InputArea.FULLSCREEN || area == InputArea.HOT_CORNER) {
foreach (var rect in PluginManager.get_default ().regions) {
rects += rect;
}
}
var xregion = X.Fixes.create_region (display.get_xdisplay (), rects);
Util.set_stage_input_region (screen, xregion);
}

View File

@ -266,7 +266,6 @@ namespace Gala
wm.end_modal ();
wm.block_keybindings_in_modal = true;
wm.update_input_area ();
foreach (var child in get_children ()) {
((WindowCloneContainer) child).close ();

View File

@ -330,9 +330,8 @@ namespace Gala
ui_group.add_transition ("nudge", nudge);
}
public void update_input_area ()
void update_input_area ()
{
var schema = BehaviorSettings.get_default ().schema;
var screen = get_screen ();
if (screensaver != null) {
@ -351,13 +350,8 @@ namespace Gala
if (modal_count > 0)
InternalUtils.set_input_area (screen, InputArea.FULLSCREEN);
else if (schema.get_enum ("hotcorner-topleft") != ActionType.NONE ||
schema.get_enum ("hotcorner-topright") != ActionType.NONE ||
schema.get_enum ("hotcorner-bottomleft") != ActionType.NONE ||
schema.get_enum ("hotcorner-bottomright") != ActionType.NONE)
InternalUtils.set_input_area (screen, InputArea.HOT_CORNER);
else
InternalUtils.set_input_area (screen, InputArea.NONE);
InternalUtils.set_input_area (screen, InputArea.DEFAULT);
}
public uint32[] get_all_xids ()