~ubuntu-branches/ubuntu/oneiric/gnome-panel/oneiric

« back to all changes in this revision

Viewing changes to gnome-panel/panel-struts.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-05-30 11:04:49 UTC
  • mfrom: (1.3.4 upstream)
  • mto: This revision was merged to the branch mainline in revision 204.
  • Revision ID: james.westby@ubuntu.com-20110530110449-ut1tc5t61rpvf9e3
Tags: upstream-3.0.2
ImportĀ upstreamĀ versionĀ 3.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
345
345
        }
346
346
}
347
347
 
348
 
static inline int
349
 
get_toplevel_depth (PanelToplevel *toplevel)
350
 
{
351
 
        int depth = 0;
352
 
 
353
 
        while ((toplevel = panel_toplevel_get_attach_toplevel (toplevel)))
354
 
                depth++;
355
 
 
356
 
        return depth;
357
 
}
358
 
 
359
348
/* Sort in order of
360
349
 *   1) screen
361
350
 *   2) monitor
362
 
 *   3) depth (for drawers)
363
 
 *   4) top, bottom, left, right
364
 
 *   5) strut_start ascending
365
 
 *   6) strut_end descending
 
351
 *   3) top, bottom, left, right
 
352
 *   4) strut_start ascending
 
353
 *   5) strut_end descending
366
354
 */
367
355
static int
368
356
panel_struts_compare (const PanelStrut *s1,
369
357
                      const PanelStrut *s2)
370
358
{
371
 
        int s1_depth;
372
 
        int s2_depth;
373
 
 
374
359
        if (s1->screen != s2->screen)
375
360
                return gdk_screen_get_number (s1->screen) -
376
361
                        gdk_screen_get_number (s2->screen);
378
363
        if (s1->monitor != s2->monitor)
379
364
                return s1->monitor - s2->monitor;
380
365
 
381
 
        s1_depth = get_toplevel_depth (s1->toplevel);
382
 
        s2_depth = get_toplevel_depth (s2->toplevel);
383
 
        if (s1_depth != s2_depth)
384
 
                return s2_depth - s1_depth;
385
 
 
386
366
        if (s1->orientation != s2->orientation)
387
367
                return orientation_to_order (s1->orientation) -
388
368
                        orientation_to_order (s2->orientation);