~jamalta/unity/687956-tooltip-timeout

« back to all changes in this revision

Viewing changes to src/unity.cpp

  • Committer: Gord Allott
  • Date: 2010-12-09 13:30:35 UTC
  • mfrom: (636.8.2 unity-perf)
  • mto: This revision was merged to the branch mainline in revision 687.
  • Revision ID: gord.allott@canonical.com-20101209133035-suje7kmkld6ocvy6
adds boot perf logging to unity and libunity

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
#include <core/atoms.h>
41
41
 
 
42
#include "../libunity/perf-logger-utility.h"
 
43
 
42
44
/* Set up vtable symbols */
43
45
COMPIZ_PLUGIN_20090315 (unityshell, UnityPluginVTable);
44
46
 
354
356
UnityScreen::initUnity(nux::NThread* thread, void* InitData)
355
357
{
356
358
  initLauncher(thread, InitData);
 
359
  START_FUNCTION ();
 
360
  initLauncher(thread, InitData);
357
361
 
358
362
  nux::ColorLayer background(nux::Color(0x00000000));
359
363
  static_cast<nux::WindowThread*>(thread)->SetWindowBackgroundPaintLayer(&background);
 
364
  END_FUNCTION ();
360
365
}
361
366
 
362
367
void
384
389
  }
385
390
}
386
391
 
 
392
static gboolean
 
393
write_logger_data_to_disk (gpointer data)
 
394
{
 
395
  perf_timeline_logger_write_log (perf_timeline_logger_get_default (), "/tmp/unity-perf.log");
 
396
  return FALSE;
 
397
}
 
398
 
387
399
UnityScreen::UnityScreen (CompScreen *screen) :
388
400
    PluginClassHandler <UnityScreen, CompScreen> (screen),
389
401
    screen (screen),
391
403
    gScreen (GLScreen::get (screen)),
392
404
    doShellRepaint (false)
393
405
{
 
406
  START_FUNCTION ();
394
407
  int (*old_handler) (Display *, XErrorEvent *);
395
408
  old_handler = XSetErrorHandler (NULL);
396
409
 
426
439
  optionSetLauncherFloatNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
427
440
 
428
441
  g_timeout_add (0, &UnityScreen::initPluginActions, this);
 
442
  END_FUNCTION ();
429
443
}
430
444
 
431
445
UnityScreen::~UnityScreen ()
452
466
/* Start up the launcher */
453
467
void UnityScreen::initLauncher (nux::NThread* thread, void* InitData)
454
468
{
 
469
  START_FUNCTION ();
 
470
 
455
471
  UnityScreen *self = (UnityScreen*) InitData;
456
472
 
 
473
  LOGGER_START_PROCESS ("initLauncher-Launcher");
457
474
  self->launcherWindow = new nux::BaseWindow(TEXT(""));
458
475
  self->launcher = new Launcher(self->launcherWindow, self->screen);
459
476
  self->AddChild (self->launcher);
476
493
  self->launcherWindow->InputWindowEnableStruts(true);
477
494
 
478
495
  self->launcher->SetIconSize (54, 48);
 
496
  LOGGER_END_PROCESS ("initLauncher-Launcher");
479
497
 
480
498
  /* Setup panel */
 
499
  LOGGER_START_PROCESS ("initLauncher-Panel");
481
500
  self->panelView = new PanelView ();
482
501
  self->AddChild (self->panelView);
483
502
 
498
517
  self->panelWindow->ShowWindow(true);
499
518
  self->panelWindow->EnableInputWindow(true);
500
519
  self->panelWindow->InputWindowEnableStruts(true);
501
 
 
 
520
  LOGGER_END_PROCESS ("initLauncher-Panel");
502
521
  g_timeout_add (2000, &UnityScreen::strutHackTimeout, self);
 
522
 
 
523
  END_FUNCTION ();
503
524
}
504
525
 
505
526
/* Window init */