~sil2100/unity/ubuntu_6.8.0

« back to all changes in this revision

Viewing changes to UnityCore/GLibDBusProxy.cpp

  • Committer: Łukasz 'sil2100' Zemczak
  • Date: 2012-10-04 16:47:13 UTC
  • mfrom: (55.813.27)
  • Revision ID: lukasz.zemczak@canonical.com-20121004164713-nlpdhe3vfi7hdbuw
* New upstream release.
  - unity 6.8 candidate segfaults on "app expose" with low gfx mode 
    (LP: #1060148)
  - [regression] Dash - Left separator is missing (LP: #1057798)
  - unity-panel-service crashed with SIGSEGV in 
    panel_indicator_entry_accessible_get_n_children() from 
    atk_object_get_n_accessible_children() (LP: #913324)
  - [regression] If unity is started with maximized dash, unmaximizing the 
    dash does not wrap rows (LP: #1053116)
  - Dash lens buttons don't work after changing form factor to maximize on 
    desktop (LP: #1053316)
  - Clicking on Workspace Switcher icon when the expo is showing, not always
    closes it 1059759 convert files list deprecated keys (LP: #1059594)
  - Unity through llvmpipe is slow (LP: #1046497)
  - compiz crashed with SIGSEGV in unity::QuicklistView::Show() from 
    unity::QuicklistManager::ShowQuicklist() (LP: #1055995)
  - compiz crashed with SIGSEGV from 
    unity::dash::HomeLens::Impl::LensSearchFinished() (LP: #1054219)
  - [regression] Starting an app & then locking to launcher is not persistent
    across sessions (LP: #1054645)
  - [regression] Dash, Launcher, Menu Bar - Unintended shadows are rendered 
    for the Unity Launcher and Panel, when the dash is open (LP: #1043260)
  - [Unity 6.x] Active blur doesn't update if you disable CCSM > OpenGL > 
    Framebuffer object (LP: #1039999)
  - Alt+Tab/Alt+grave brings other window to the front but loses focus 
    entirely. (LP: #1035628)
  - Spread - Scaling all the windows is too slow (LP: #1055643)
  - Window management - Middle clicking on a window inside the spread should
    close that window (equivalent action to clicking on the close button) 
    (LP: #1052821)
  - Scale window decorations don't have properly rounded corners 
    (LP: #1055610)
  - Scale window decorations text does not match theme style (Radiance) 
    (LP: #1055609)
  - Spread window decorations does not match the theme when changed 
    (LP: #1055605)
  - scaled window decorations are sometimes wider than the window 
    (LP: #1053225)
  - Launcher should not auto-hide after dragging an icon, if mouse is still
    over it (LP: #1053978)
  - unity spread window on second click not working when ibus language panel
    is shown. (LP: #1035895)
  - windows.push_back(<uninitialized value>) in 
    BamfLauncherIcon::GetFocusableWindows (LP: #1053220)
  - Category emblems are blurry (LP: #1056874)
  - Rendering flaws of the dash previews (LP: #1055455)
  - [UIFe] Social Lens doesn't have authorised and meaningful icon 
    (LP: #1056191)
  - [dash] Preview fade out animation hangs occasionally (LP: #1058145)
  - Dash - rendering of ribbons shouldn't be relative (LP: #1057971)
  - Horizontal alignment search box and views below (LP: #1055544)
  - Compiz crashed in cairo_save() from 
    unity::UnityWindow::RenderDecoration() from 
    unity::UnityWindow::scalePaintDecoration() from 
    ScaleWindow::scalePaintDecoration() (LP: #1061396)
  - [regression] Spinner doesn't spin around its center (LP: #1061081)
  - [regression] Graphical glitches in HUD/Dash bottom left and top right 
    corner (LP: #1060532)
  - [Quantal] unity-lens-application does not start on some slow machines 
    (LP: #1058619)
  - [Dash] Rendering flaw of the dash search entry (LP: #1059562)
  - [dash] Rendering flaw of filterbar after scrolling down/scrolling up. 
    (LP: #1059607)
  - Unity launcher doesn't prompt for password to unlock the device when 
    clicking on a encrypted volume icon (LP: #713432)
  - [regression] Unable to add desktop files with spaces in their name from 
    Nautilus into the Launcher (LP: #1055552 )
  - Missing context menus for Qt apps after minimizing the window 
    (LP: #929712)
  - Music preview note image is blurry (LP: #1060195)

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 
37
37
namespace
38
38
{
 
39
const unsigned MAX_RECONNECTION_ATTEMPTS = 5;
39
40
nux::logging::Logger logger("unity.glib.dbusproxy");
40
41
}
41
42
 
55
56
       GDBusProxyFlags flags);
56
57
  ~Impl();
57
58
 
58
 
  void StartReconnectionTimeout();
 
59
  void StartReconnectionTimeout(unsigned timeout);
59
60
  void Connect();
60
61
 
61
62
  void Call(string const& method_name,
91
92
  glib::Object<GDBusProxy> proxy_;
92
93
  glib::Object<GCancellable> cancellable_;
93
94
  bool connected_;
 
95
  unsigned reconnection_attempts_;
94
96
 
95
97
  glib::Signal<void, GDBusProxy*, char*, char*, GVariant*> g_signal_connection_;
96
98
  glib::Signal<void, GDBusProxy*, GParamSpec*> name_owner_signal_;
113
115
  , flags_(flags)
114
116
  , cancellable_(g_cancellable_new())
115
117
  , connected_(false)
 
118
  , reconnection_attempts_(0)
116
119
{
117
 
  StartReconnectionTimeout();
 
120
  StartReconnectionTimeout(1);
118
121
}
119
122
 
120
123
DBusProxy::Impl::~Impl()
122
125
  g_cancellable_cancel(cancellable_);
123
126
}
124
127
 
125
 
void DBusProxy::Impl::StartReconnectionTimeout()
 
128
void DBusProxy::Impl::StartReconnectionTimeout(unsigned timeout)
126
129
{
127
130
  LOG_DEBUG(logger) << "Starting reconnection timeout for " << name_;
128
131
 
134
137
    return false;
135
138
  };
136
139
 
137
 
  reconnect_timeout_.reset(new glib::TimeoutSeconds(1, callback));
 
140
  reconnect_timeout_.reset(new glib::TimeoutSeconds(timeout, callback));
138
141
}
139
142
 
140
143
void DBusProxy::Impl::Connect()
169
172
  // therefore we should deal with the error before touching the impl pointer
170
173
  if (!proxy || error)
171
174
  {
172
 
    LOG_WARNING(logger) << "Unable to connect to proxy: " << error;
 
175
    // if the cancellable was cancelled, "self" points to destroyed object
 
176
    if (error && !g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
 
177
    {
 
178
      if (self->reconnection_attempts_++ < MAX_RECONNECTION_ATTEMPTS)
 
179
      {
 
180
        LOG_WARNING(logger) << "Unable to connect to proxy: \"" << error
 
181
          << "\"... Trying to reconnect (attempt "
 
182
          << self->reconnection_attempts_ << ")";
 
183
        self->StartReconnectionTimeout(3);
 
184
      }
 
185
      else
 
186
      {
 
187
        LOG_WARNING(logger) << "Unable to connect to proxy: " << error;
 
188
      }
 
189
    }
173
190
    return;
174
191
  }
175
192
 
176
193
  LOG_DEBUG(logger) << "Sucessfully created proxy: " << self->object_path_;
177
194
 
 
195
  self->reconnection_attempts_ = 0;
178
196
  self->proxy_ = proxy;
179
197
  self->g_signal_connection_.Connect(self->proxy_, "g-signal",
180
198
                                     sigc::mem_fun(self, &Impl::OnProxySignal));