~bilalakhtar/unity/sd-card-stop-device-960910

« back to all changes in this revision

Viewing changes to launcher/LauncherHideMachine.cpp

  • Committer: Bilal Akhtar
  • Date: 2012-08-21 17:50:55 UTC
  • mfrom: (2540.2.61 unity)
  • Revision ID: bilalakhtar@ubuntu.com-20120821175055-2nyk2ne624tcd247
Merge from trunk and resolve conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
namespace
30
30
{
31
31
nux::logging::Logger logger("unity.launcher");
32
 
const unsigned int HIDE_DELAY_TIMEOUT_LENGTH = 750;
 
32
const unsigned int HIDE_DELAY_TIMEOUT_LENGTH = 400;
33
33
}
34
34
 
35
35
LauncherHideMachine::LauncherHideMachine()
83
83
}
84
84
 
85
85
/* == Quick Quirk Reference : please keep up to date ==
86
 
    LAUNCHER_HIDDEN        = 1 << 0, 1
87
 
    MOUSE_OVER_LAUNCHER    = 1 << 1, 2
88
 
    QUICKLIST_OPEN         = 1 << 4, 16  #VISIBLE_REQUIRED
89
 
    EXTERNAL_DND_ACTIVE    = 1 << 5, 32  #VISIBLE_REQUIRED
90
 
    INTERNAL_DND_ACTIVE    = 1 << 6, 64  #VISIBLE_REQUIRED
91
 
    TRIGGER_BUTTON_SHOW    = 1 << 7, 128 #VISIBLE_REQUIRED
92
 
    DND_PUSHED_OFF         = 1 << 10, 1024
93
 
    MOUSE_MOVE_POST_REVEAL = 1 << 11, 2k
94
 
    VERTICAL_SLIDE_ACTIVE  = 1 << 12, 4k  #VISIBLE_REQUIRED
95
 
    KEY_NAV_ACTIVE         = 1 << 13, 8k  #VISIBLE_REQUIRED
96
 
    PLACES_VISIBLE         = 1 << 14, 16k #VISIBLE_REQUIRED
97
 
    LAST_ACTION_ACTIVATE   = 1 << 15, 32k
98
 
    SCALE_ACTIVE           = 1 << 16, 64k  #VISIBLE_REQUIRED
99
 
    EXPO_ACTIVE            = 1 << 17, 128k #VISIBLE_REQUIRED
100
 
    MT_DRAG_OUT            = 1 << 18, 256k #VISIBLE_REQUIRED
101
 
    LAUNCHER_PULSE         = 1 << 20, 1M   #VISIBLE_REQUIRED
102
 
    LOCK_HIDE              = 1 << 21, 2M
 
86
    LAUNCHER_HIDDEN        = 1 << 0,  1
 
87
    MOUSE_OVER_LAUNCHER    = 1 << 1,  2
 
88
    QUICKLIST_OPEN         = 1 << 2,  4      #VISIBLE_REQUIRED
 
89
    EXTERNAL_DND_ACTIVE    = 1 << 3,  8      #VISIBLE_REQUIRED
 
90
    INTERNAL_DND_ACTIVE    = 1 << 4,  16     #VISIBLE_REQUIRED
 
91
    TRIGGER_BUTTON_SHOW    = 1 << 5,  32     #VISIBLE_REQUIRED
 
92
    DND_PUSHED_OFF         = 1 << 6,  64
 
93
    MOUSE_MOVE_POST_REVEAL = 1 << 7,  128
 
94
    VERTICAL_SLIDE_ACTIVE  = 1 << 8,  256   #VISIBLE_REQUIRED
 
95
    KEY_NAV_ACTIVE         = 1 << 9,  512   #VISIBLE_REQUIRED
 
96
    PLACES_VISIBLE         = 1 << 10, 1024  #VISIBLE_REQUIRED
 
97
    SCALE_ACTIVE           = 1 << 11, 2048  #VISIBLE_REQUIRED
 
98
    EXPO_ACTIVE            = 1 << 12, 4096  #VISIBLE_REQUIRED
 
99
    MT_DRAG_OUT            = 1 << 13, 8192  #VISIBLE_REQUIRED
 
100
    LAUNCHER_PULSE         = 1 << 14, 16384 #VISIBLE_REQUIRED
 
101
    LOCK_HIDE              = 1 << 15, 32768
103
102
*/
104
103
 
105
104
#define VISIBLE_REQUIRED (QUICKLIST_OPEN | EXTERNAL_DND_ACTIVE | \
116
115
    SetShouldHide(false, skip_delay);
117
116
    return;
118
117
  }
119
 
  
 
118
 
120
119
  // early check to see if we are locking to hidden - but only if we are in non HIDE_NEVER
121
120
  if (GetQuirk(LOCK_HIDE))
122
121
  {
138
137
    if (_mode == AUTOHIDE)
139
138
      hide_for_window = true;
140
139
 
141
 
    // if we activated AND we would hide because of a window, go ahead and do it
142
 
    if (!_should_hide && GetQuirk(LAST_ACTION_ACTIVATE) && hide_for_window)
143
 
    {
144
 
      should_hide = true;
145
 
      break;
146
 
    }
147
 
 
148
140
    // Is there anything holding us open?
149
141
    HideQuirk _should_show_quirk;
150
142
    if (GetQuirk(LAUNCHER_HIDDEN))
201
193
  else
202
194
    _quirks = (HideQuirk)(_quirks & ~quirk);
203
195
 
204
 
  // no skipping when last action was activate on general case
205
 
  bool skip = quirk & SKIP_DELAY_QUIRK && !GetQuirk(LAST_ACTION_ACTIVATE);
206
 
 
207
 
  // but skip on last action if we were out of the launcher/bfb
208
 
  if (GetQuirk(LAST_ACTION_ACTIVATE) && !active && (quirk & (MOUSE_OVER_LAUNCHER)))
209
 
    skip = true;
 
196
  bool skip = quirk & SKIP_DELAY_QUIRK;
210
197
 
211
198
  EnsureHideState(skip);
212
199
}