~allanlesage/indicator-appmenu/TDD-fixes

« back to all changes in this revision

Viewing changes to src/huddbusmenucollector.c

  • Committer: Ryan Lortie
  • Date: 2012-03-26 15:25:33 UTC
  • mto: This revision was merged to the branch mainline in revision 191.
  • Revision ID: desrt@desrt.ca-20120326152533-t1yyawkpiuws9rkq
hud: don't send duplicate OPENED events on property changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
359
359
  DbusmenuMenuitem *parent;
360
360
  HudStringList *context;
361
361
  HudDbusmenuItem *item;
 
362
  gboolean was_open;
362
363
 
363
364
  g_assert (!collector->reentrance_check);
364
365
 
374
375
  else
375
376
    context = collector->prefix;
376
377
 
 
378
  item = g_hash_table_lookup (collector->items, menuitem);
 
379
  was_open = item->is_opened;
 
380
  g_hash_table_remove (collector->items, menuitem);
 
381
 
377
382
  item = hud_dbusmenu_item_new (context, collector->application_id, collector->icon, menuitem);
378
 
  g_hash_table_remove (collector->items, menuitem);
379
383
 
380
 
  if (collector->use_count && dbusmenu_menuitem_property_exist (menuitem, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY))
 
384
  if (collector->use_count && !was_open && dbusmenu_menuitem_property_exist (menuitem, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY))
381
385
    {
382
386
      dbusmenu_menuitem_handle_event (menuitem, DBUSMENU_MENUITEM_EVENT_OPENED, NULL, 0);
383
387
      item->is_opened = TRUE;