~shippo/plank/fix-1251625

« back to all changes in this revision

Viewing changes to lib/Items/ApplicationDockItem.vala

  • Committer: Peter Feichtinger
  • Date: 2017-03-14 12:00:51 UTC
  • Revision ID: shippo@gmx.at-20170314120051-yas7d3f74tqyw2co
Fix window menu showing with only one item.

Show diffs side-by-side

added added

removed removed

Lines of Context:
399
399
                public override bool show_menu (PopupButton button, Gdk.ModifierType modifiers)
400
400
                {
401
401
                        bool useWindowMenu = get_dock ().prefs.UseWindowMenu;
402
 
                        if (button == PopupButton.LEFT && (modifiers & ANY_MODIFIER) == 0
403
 
                                && App != null && App.get_windows ().length () > 1 && useWindowMenu) {
404
 
                                return true;
 
402
                        if (button == PopupButton.LEFT && (modifiers & ANY_MODIFIER) == 0 && App != null && useWindowMenu) {
 
403
                                var count = 0;
 
404
                                foreach (var view in App.get_windows ()) {
 
405
                                        unowned Bamf.Window? window = (view as Bamf.Window);
 
406
                                        if (window != null && window.get_transient () == null && ++count > 1)
 
407
                                                return true;
 
408
                                }
405
409
                        }
406
410
                        return base.show_menu (button, modifiers);
407
411
                }