~shnatsel/unity/old-school-dash

« back to all changes in this revision

Viewing changes to src/PlaceRemote.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2011-04-14 22:03:42 UTC
  • mfrom: (1.1.41 upstream)
  • Revision ID: james.westby@ubuntu.com-20110414220342-4kp036kzlljxxx23
Tags: 3.8.8-0ubuntu1
* New upstream release.
  - Empty desktop after login (LP: #687660)
  - compiz crashed with SIGSEGV in nux::Area::InitiateResizeLayout()
    (LP: #757709)
  - compiz crashed on initial load of Java Citrix Client/Inkscape in
    PrivateWindow::processMap() (LP: #758307)
  - Sometimes dragging down from the panel just stops working (LP: #750155)
  - Ensure Unity prioritises icon loading from Unity-icon-theme
    (LP: #750471)
  - text truncated in Dash. Empty search from Applications or Files lense
    returns “Your search did not” due to cut off label (LP: #757362)
  - should list PlacesGroup.cpp in POTFILES.in (LP: #757663)
  - Launcher intellhide stuck after edge reveal (LP: #757810)
  - unity-preferences doesn't load translations (LP: #759682)
  - dynamic quicklists are not working (LP: #729074)
  - with second monitor, first monitor does not show nautilus
    application/global menu when displaying desktop (LP: #743149)
  - Launcher - The Workspace, File Lens, App Lens and Trash Launcher icons
    need to be rendered correctly (LP: #745555)
  - the launcher background gets dimmed after icons dnd (LP: #747304)
  - Numpad 'Enter' does not work on unity launcher when navigating through
    keyboard (LP: #760003)
  - Launcher shouldn't hover when being in the dash (LP: #760770)
  - Launcher displays key shortcuts while holding Super while the dash is
    open but the shortcuts are unfunctional (LP: #760728)
  - Running/active indicators point to space between launcher icons for
    folded icons (LP: #703067)
  - user-trash.svg and user-trash-full.svg not lens grayscale versions
    (LP: #741804)
  - code-cleanup: unregistered any established ubus-interests (LP: #757588)
  - dropdown box in places search bar does not resize when font size changes
    (LP: #759763)
  - [FFE] Centered layout for expo plugin (LP: #754689)
  - Unity launcher icons tooltips do not disappear when swiching workspaces
    (LP: #744795)
  - Dash - Update Dash scroll bar (LP: #750374)
  - Letters cut off at the end in the applications window  (LP: #753083)
* debian/control:
  - build-dep on grail/geis with version bumped
* 01_dont_dep_on_latest_geis_grail.patch:
  - not needed anymore

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
  _mime_regex (NULL),
57
57
  _valid (false),
58
58
  _service_proxy (NULL),
59
 
  _activation_proxy (NULL)
 
59
  _activation_proxy (NULL),
 
60
  _conn_attempt (false)
60
61
{
61
62
  GKeyFile *key_file;
62
63
  GError   *error = NULL;
171
172
 
172
173
  _valid = true;
173
174
 
174
 
  Connect ();
175
 
    
176
175
  g_key_file_free (key_file);
177
176
}
178
177
 
213
212
void
214
213
PlaceRemote::Connect ()
215
214
{
216
 
  g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
217
 
                            G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
218
 
                            NULL,
219
 
                            _dbus_name,
220
 
                            _dbus_path,
221
 
                            PLACE_IFACE,
222
 
                            NULL,
223
 
                            on_service_proxy_ready,
224
 
                            this);
225
 
 
226
 
  if (_uri_regex || _mime_regex)
 
215
  // We do not connect the entries, or ourselves, to the the daemon automatically at startup to
 
216
  // increase the total login time of the desktop as we then reduce the number of things 
 
217
  // trashing the disk (i.e. zeitgeist/gwibber/etc) and taking CPU time
 
218
  //
 
219
  // What this means in to Unity is that it needs to make sure to have called Connect before
 
220
  // trying to do use the Place or it's PlaceEntry's
 
221
    
 
222
  if (!_conn_attempt && !G_IS_DBUS_PROXY (_service_proxy))
 
223
  {
227
224
    g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
228
225
                              G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
229
226
                              NULL,
230
227
                              _dbus_name,
231
228
                              _dbus_path,
232
 
                              ACTIVE_IFACE,
 
229
                              PLACE_IFACE,
233
230
                              NULL,
234
 
                              (GAsyncReadyCallback)PlaceRemote::OnActivationProxyReady,
 
231
                              on_service_proxy_ready,
235
232
                              this);
 
233
 
 
234
    if (_uri_regex || _mime_regex)
 
235
      g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
 
236
                                G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
 
237
                                NULL,
 
238
                                _dbus_name,
 
239
                                _dbus_path,
 
240
                                ACTIVE_IFACE,
 
241
                                NULL,
 
242
                                (GAsyncReadyCallback)PlaceRemote::OnActivationProxyReady,
 
243
                                this);
 
244
 
 
245
    std::vector<PlaceEntry *>::iterator it, eit = _entries.end ();
 
246
    for (it = _entries.begin (); it != eit; ++it)
 
247
    {
 
248
      PlaceEntryRemote *entry = static_cast<PlaceEntryRemote *> (*it);
 
249
      entry->Connect ();
 
250
    }
 
251
 
 
252
    _conn_attempt = true;
 
253
  }
236
254
}
237
255
 
238
256
std::vector<PlaceEntry *>&
271
289
      }
272
290
      else
273
291
        delete entry;
 
292
 
274
293
    }
275
294
 
276
295
    i++;
293
312
 
294
313
  _service_proxy = g_dbus_proxy_new_for_bus_finish (result, &error);
295
314
  name_owner = g_dbus_proxy_get_name_owner (_service_proxy);
 
315
  _conn_attempt = false;
296
316
 
297
317
  if (error || !name_owner)
298
318
  {
308
328
 
309
329
  g_signal_connect (_service_proxy, "g-signal",
310
330
                    G_CALLBACK (on_service_proxy_signal_received), this);
 
331
  g_signal_connect (_service_proxy, "notify::g-name-owner",
 
332
                    G_CALLBACK (PlaceRemote::OnProxyNameOwnerChanged), this);
311
333
  g_dbus_proxy_call (_service_proxy,
312
334
                     "GetEntries",
313
335
                     NULL,
321
343
}
322
344
 
323
345
void
 
346
PlaceRemote::OnProxyNameOwnerChanged (GDBusProxy  *proxy,
 
347
                                      GParamSpec  *pspec,
 
348
                                      PlaceRemote *self)
 
349
{
 
350
  gchar *name_owner  = g_dbus_proxy_get_name_owner (proxy);
 
351
 
 
352
  if (!name_owner)
 
353
  {
 
354
    // Remote proxy has died
 
355
    g_debug ("Remote PlaceRemote proxy %s no longer exists, reconnecting", self->_dbus_name);
 
356
    g_object_unref (self->_service_proxy);
 
357
    g_object_unref (self->_activation_proxy);
 
358
    self->_service_proxy = NULL;
 
359
    self->_activation_proxy = NULL;
 
360
 
 
361
    self->Connect ();
 
362
  }
 
363
  else
 
364
    g_free (name_owner);
 
365
}
 
366
 
 
367
void
324
368
PlaceRemote::OnEntriesReceived (GVariant *args)
325
369
{
326
370
  GVariantIter *iter;