Avoid making field moving public accessible

This commit is contained in:
Rico Tzschichholz 2012-07-19 12:56:12 +02:00
parent f02b705965
commit 2fb7f4e34c
2 changed files with 7 additions and 3 deletions

View File

@ -25,7 +25,7 @@ namespace Gala
WindowSwitcher winswitcher; WindowSwitcher winswitcher;
WorkspaceView workspace_view; WorkspaceView workspace_view;
internal Window? moving; //place for the window that is being moved over Window? moving; //place for the window that is being moved over
int modal_count = 0; //count of modal modes overlaying each other int modal_count = 0; //count of modal modes overlaying each other
@ -148,6 +148,10 @@ namespace Gala
if (window == null) if (window == null)
return; return;
// if there is still an unfinished window-move don't be silly and use it
if (moving != null)
window = moving
var screen = get_screen (); var screen = get_screen ();
var display = screen.get_display (); var display = screen.get_display ();

View File

@ -211,13 +211,13 @@ namespace Gala
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 ((plugin.moving == null)?screen.get_display ().get_focus_window ():plugin.moving, true); plugin.move_window (screen.get_display ().get_focus_window (), true);
else else
switch_to_next_workspace (true); switch_to_next_workspace (true);
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 ((plugin.moving == null)?screen.get_display ().get_focus_window ():plugin.moving, false); plugin.move_window (screen.get_display ().get_focus_window (), false);
else else
switch_to_next_workspace (false); switch_to_next_workspace (false);
return false; return false;