~ricotz/plank/consolidate-api

« back to all changes in this revision

Viewing changes to lib/Items/ApplicationDockItem.vala

  • Committer: Rico Tzschichholz
  • Date: 2015-07-25 07:18:12 UTC
  • Revision ID: ricotz@ubuntu.com-20150725071812-k4c40eq083tapm9y
appdockitem: Always indicate running application despite its window-count

Show diffs side-by-side

added added

removed removed

Lines of Context:
183
183
                        handle_active_changed (App.is_active ());
184
184
                        handle_urgent_changed (App.is_urgent ());
185
185
                        
186
 
                        update_indicator (WindowControl.get_num_windows (App));
 
186
                        update_indicator ();
187
187
                }
188
188
                
189
189
                public bool is_running ()
269
269
                
270
270
                void handle_window_added (Bamf.View? child)
271
271
                {
272
 
                        update_indicator (WindowControl.get_num_windows (App));
 
272
                        update_indicator ();
273
273
                        
274
274
                        app_window_added ();
275
275
                }
276
276
                
277
277
                void handle_window_removed (Bamf.View? child)
278
278
                {
279
 
                        update_indicator (WindowControl.get_num_windows (App));
 
279
                        update_indicator ();
280
280
                        
281
281
                        app_window_removed ();
282
282
                }
283
283
                
284
 
                void update_indicator (uint window_count)
 
284
                void update_indicator ()
285
285
                {
286
 
                        if (window_count == 0) {
 
286
                        //FIXME Do not be silly if the application is running
 
287
                        //  we must indicate it, same goes for the opposite.
 
288
                        
 
289
                        var is_running = is_running ();
 
290
                        
 
291
                        if (!is_running) {
287
292
                                if (Indicator != IndicatorState.NONE)
288
293
                                        Indicator = IndicatorState.NONE;
289
 
                        } else if (window_count == 1) {
 
294
                                return;
 
295
                        }
 
296
                        
 
297
                        var window_count = WindowControl.get_num_windows (App);
 
298
                        
 
299
                        if (window_count <= 1) {
290
300
                                if (Indicator != IndicatorState.SINGLE)
291
301
                                        Indicator = IndicatorState.SINGLE;
292
302
                        } else {
299
309
                {
300
310
                        handle_urgent_changed (false);
301
311
                        handle_active_changed (false);
302
 
                        update_indicator (0);
 
312
                        
 
313
                        if (Indicator != IndicatorState.NONE)
 
314
                                Indicator = IndicatorState.NONE;
303
315
                }
304
316
                
305
317
                void launch ()