~brandontschaefer/unity/possible-crash--fixes

« back to all changes in this revision

Viewing changes to plugins/unityshell/src/unityshell.cpp

  • Committer: Tarmac
  • Author(s): Marco Trevisan (Treviño)
  • Date: 2012-04-23 11:34:11 UTC
  • mfrom: (2199.3.11 hud-dynamic-icon-size)
  • Revision ID: tarmac-20120423113411-imr05vn2ocxhysat
Hud: update the icon size to match the launcher icon size when in auto-hide mode

Plus prevent a couple of crashes. Fixes: https://bugs.launchpad.net/bugs/921506, https://bugs.launchpad.net/bugs/983646. Approved by Tim Penhey.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2643
2643
      launcher_options->icon_size = optionGetIconSize();
2644
2644
      launcher_options->tile_size = optionGetIconSize() + 6;
2645
2645
 
 
2646
      hud_controller_->icon_size = launcher_options->icon_size();
 
2647
      hud_controller_->tile_size = launcher_options->tile_size();
 
2648
 
 
2649
      /* The launcher geometry includes 1px used to draw the right margin
 
2650
       * that must not be considered when drawing an overlay */
2646
2651
      hud_controller_->launcher_width = launcher_controller_->launcher().GetAbsoluteWidth() - 1;
2647
 
      /* The launcher geometry includes 1px used to draw the right margin
2648
 
       * that must not be considered when drawing the dash                    */
2649
2652
      dash_controller_->launcher_width = launcher_controller_->launcher().GetAbsoluteWidth() - 1;
2650
2653
 
2651
2654
      if (p)
2838
2841
  auto hide_mode = (unity::launcher::LauncherHideMode) optionGetLauncherHideMode();
2839
2842
  hud_controller_->launcher_locked_out = (hide_mode == unity::launcher::LauncherHideMode::LAUNCHER_HIDE_NEVER);
2840
2843
  hud_controller_->multiple_launchers = (optionGetNumLaunchers() == 0);
 
2844
  hud_controller_->icon_size = launcher_controller_->options()->icon_size();
 
2845
  hud_controller_->tile_size = launcher_controller_->options()->tile_size();
2841
2846
  AddChild(hud_controller_.get());
2842
2847
  LOG_INFO(logger) << "initLauncher-hud " << timer.ElapsedSeconds() << "s";
2843
2848