~3v1n0/bamf/fix-window-removed-crash

« back to all changes in this revision

Viewing changes to src/bamf-window.c

  • Committer: Michal Hruby
  • Date: 2012-02-17 11:15:54 UTC
  • mfrom: (444.1.1 bamf)
  • Revision ID: michal.mhr@gmail.com-20120217111554-2pg2i1eqps0fmrry
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
}
116
116
 
117
117
guint32
 
118
bamf_window_get_pid (BamfWindow *window)
 
119
{
 
120
  g_return_val_if_fail (BAMF_IS_WINDOW (window), 0);
 
121
 
 
122
  return bamf_legacy_window_get_pid (window->priv->legacy_window);
 
123
}
 
124
 
 
125
guint32
118
126
bamf_window_get_xid (BamfWindow *window)
119
127
{
120
128
  g_return_val_if_fail (BAMF_IS_WINDOW (window), 0);
275
283
}
276
284
 
277
285
static gboolean
 
286
on_dbus_handle_get_pid (BamfDBusItemWindow *interface,
 
287
                        GDBusMethodInvocation *invocation,
 
288
                        BamfWindow *self)
 
289
{
 
290
  gint pid = bamf_window_get_pid (self);
 
291
  g_dbus_method_invocation_return_value (invocation, g_variant_new ("(u)", pid));
 
292
 
 
293
  return TRUE;
 
294
}
 
295
 
 
296
static gboolean
278
297
on_dbus_handle_get_xid (BamfDBusItemWindow *interface,
279
298
                        GDBusMethodInvocation *invocation,
280
299
                        BamfWindow *self)
493
512
  g_signal_connect (self, "monitor-changed", G_CALLBACK (on_monitor_changed), NULL);
494
513
 
495
514
  /* Registering signal callbacks to reply to dbus method calls */
 
515
  g_signal_connect (self->priv->dbus_iface, "handle-get-pid",
 
516
                    G_CALLBACK (on_dbus_handle_get_pid), self);
 
517
 
496
518
  g_signal_connect (self->priv->dbus_iface, "handle-get-xid",
497
519
                    G_CALLBACK (on_dbus_handle_get_xid), self);
498
520