~ubuntu-branches/ubuntu/natty/indicator-appmenu/natty

« back to all changes in this revision

Viewing changes to src/indicator-appmenu.c

  • Committer: Bazaar Package Importer
  • Author(s): Ken VanDine
  • Date: 2011-02-07 12:44:20 UTC
  • Revision ID: james.westby@ubuntu.com-20110207124420-oczbpa2l429bbu4p
Tags: 0.1.93-0ubuntu2
* src/indicator-appmenu.c
  - Using the destroy() function instead of just removing from the hashtable 
    as it handles more details of switching windows. Then we have to unref 
    as the destroy function does not. (LP: #714531)

Show diffs side-by-side

added added

removed removed

Lines of Context:
203
203
static void dbg_bus_get_cb                                           (GObject * object,
204
204
                                                                      GAsyncResult * res,
205
205
                                                                      gpointer user_data);
 
206
static void menus_destroyed                                          (GObject * menus,
 
207
                                                                      gpointer user_data);
206
208
 
207
209
/* Unique error codes for debug interface */
208
210
enum {
780
782
        BamfWindow * window = BAMF_WINDOW(view);
781
783
        guint32 xid = bamf_window_get_xid(window);
782
784
 
 
785
        /* See if it's in our list of desktop windows, if
 
786
           so remove it from that list. */
783
787
        if (bamf_window_get_window_type(window) == BAMF_WINDOW_DESKTOP) {
784
788
                g_hash_table_remove(iapp->desktop_windows, GUINT_TO_POINTER(xid));
785
789
        }
786
 
        else {
787
 
                g_debug("Window removed for window: %d", xid);
788
 
                g_hash_table_remove(iapp->apps, GUINT_TO_POINTER(xid));
 
790
 
 
791
        /* Now let's see if we've got a WM object for it then
 
792
           we need to mark it as destroyed and unreference to
 
793
           actually destroy it. */
 
794
        gpointer wm = g_hash_table_lookup(iapp->apps, GUINT_TO_POINTER(xid));
 
795
        if (wm != NULL) {
 
796
                GObject * wmo = G_OBJECT(wm);
 
797
 
 
798
                /* Using destroyed so that if the menus are shown
 
799
                   they'll be switch and the current window gets
 
800
                   updated as well. */
 
801
                menus_destroyed(wmo, iapp);
 
802
                g_object_unref(wmo);
789
803
        }
790
804
 
791
805
        return;