~rperier/unity/command-lens-switching

« back to all changes in this revision

Viewing changes to unity-shared/StandaloneWindowManager.cpp

  • Committer: Tarmac
  • Author(s): Marco Trevisan (Treviño)
  • Date: 2013-01-24 13:26:25 UTC
  • mfrom: (2919.3.68 shortcut-WS-dynamic)
  • Revision ID: tarmac-20130124132625-y1e4xupw15pllmsi
CompizShortcutModeller: listen to WM changes, and update model accordingly, fix View resizes. Fixes: https://bugs.launchpad.net/bugs/1103561.

Approved by Andrea Azzarone, John Lea.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
  , scale_active_(false)
64
64
  , scale_active_for_group_(false)
65
65
  , current_desktop_(0)
 
66
  , viewport_size_(2, 2)
66
67
{}
67
68
 
68
69
Window StandaloneWindowManager::GetActiveWindow() const
433
434
{
434
435
}
435
436
 
 
437
void StandaloneWindowManager::SetViewportSize(unsigned horizontal, unsigned vertical)
 
438
{
 
439
  nux::Size new_size(horizontal, vertical);
 
440
 
 
441
  if (viewport_size_ == new_size)
 
442
    return;
 
443
 
 
444
  viewport_size_ = new_size;
 
445
  viewport_layout_changed.emit(new_size.width, new_size.height);
 
446
}
 
447
 
436
448
int StandaloneWindowManager::WorkspaceCount() const
437
449
{
438
 
  return 4;
 
450
  return viewport_size_.width * viewport_size_.height;
439
451
}
440
452
 
441
453
nux::Point StandaloneWindowManager::GetCurrentViewport() const
445
457
 
446
458
 int StandaloneWindowManager::GetViewportHSize() const
447
459
{
448
 
  return 2;
 
460
  return viewport_size_.width;
449
461
}
450
462
 
451
463
int StandaloneWindowManager::GetViewportVSize() const
452
464
{
453
 
  return 2;
 
465
  return viewport_size_.height;
454
466
}
455
467
 
456
468
bool StandaloneWindowManager::SaveInputFocus()