~ricotz/plank/hide-small-window-list

« back to all changes in this revision

Viewing changes to lib/Services/WindowControl.vala

  • Committer: Rico Tzschichholz
  • Date: 2014-11-19 14:39:22 UTC
  • Revision ID: ricotz@ubuntu.com-20141119143922-j162344wb6l2ohr4
Fallback on "application-default-icon" icon only or use internal default

Also Wnck is returning its default window-icon ignore it and use the our
fallback chain instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
                        
91
91
                        for (var i = 0; xids != null && i < xids.length && pbuf == null; i++) {
92
92
                                unowned Wnck.Window window = Wnck.Window.@get (xids.index (i));
93
 
                                if (window != null)
94
 
                                        pbuf = window.get_icon ();
 
93
                                if (window == null)
 
94
                                        continue;
 
95
                                
 
96
                                pbuf = window.get_icon ();
 
97
                                if (window.get_icon_is_fallback ())
 
98
                                        pbuf = null;
 
99
                                
 
100
                                break;
95
101
                        }
96
102
                        
97
103
                        return pbuf;
100
106
                public static unowned Gdk.Pixbuf? get_window_icon (Bamf.Window window)
101
107
                {
102
108
                        unowned Wnck.Window w = Wnck.Window.@get (window.get_xid ());
 
109
                        unowned Gdk.Pixbuf? pbuf = null;
103
110
                        
104
111
                        warn_if_fail (w != null);
105
112
                        
106
113
                        if (w == null)
107
114
                                return null;
108
115
                        
109
 
                        return w.get_icon ();
 
116
                        pbuf = w.get_icon ();
 
117
                        if (w.get_icon_is_fallback ())
 
118
                                pbuf = null;
 
119
                        
 
120
                        return pbuf;
110
121
                }
111
122
                
112
123
                public static uint get_num_windows (Bamf.Application app)