~didrocks/notify-osd/bootstrap

« back to all changes in this revision

Viewing changes to src/bubble.c

  • Committer: Tarmac
  • Author(s): Michael Terry
  • Date: 2012-11-26 19:37:13 UTC
  • mfrom: (456.1.1 no-border)
  • Revision ID: tarmac-20121126193713-qcfs6arzuhuepwmf
When running without a compositor, there is an ugly black border.

This branch fixes that by:
1) Adding an 'is_composited' argument to defaults_get_bubble_shadow_size and defaults_get_bubble_corner_radius.  If we're not composited, they return 0.0f.
2) Adding a 'GdkScreen **screen' argument to defaults_get_top_corner
3) Using these throughout to check composited state wherever these are used.

Additionally, I had to add some oddness in bubble.c for _refresh_background.  There is a bit of code that draws a (seemingly unnecessary) image in shadow-size-units even in the uncomposited case.  But it can't use 0 because that causes a crash to create a 0-sized image.  So I used 1 for that special case.  Seems like it would be cleaner to avoid that path in uncomposited mode, but I didn't feel confident enough to make that change.

Approved by Didier Roche, jenkins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
487
487
        cairo_surface_destroy (new_surface);
488
488
}
489
489
 
 
490
static gdouble
 
491
get_shadow_size (Bubble *bubble)
 
492
{
 
493
        BubblePrivate* priv = GET_PRIVATE (bubble);
 
494
        Defaults*      d    = bubble->defaults;
 
495
        return defaults_get_bubble_shadow_size (d, priv->composited);
 
496
}
 
497
 
 
498
static gdouble
 
499
get_corner_radius (Bubble *bubble)
 
500
{
 
501
        BubblePrivate* priv = GET_PRIVATE (bubble);
 
502
        Defaults*      d    = bubble->defaults;
 
503
        return defaults_get_bubble_corner_radius (d, priv->composited);
 
504
}
 
505
 
490
506
static void
491
507
_draw_layout_grid (cairo_t* cr,
492
508
                  Bubble*  bubble)
501
517
 
502
518
        // all vertical grid lines
503
519
        cairo_move_to (cr,
504
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
505
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
506
 
        cairo_line_to (cr,
507
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
508
 
                       0.5f + (gdouble) bubble_get_height (bubble) -
509
 
                       EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
510
 
        cairo_move_to (cr,
511
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
512
 
                       EM2PIXELS (defaults_get_margin_size (d), d),
513
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
514
 
        cairo_line_to (cr,
515
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
516
 
                       EM2PIXELS (defaults_get_margin_size (d), d),
517
 
                       0.5f + (gdouble) bubble_get_height (bubble) -
518
 
                       EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
519
 
        cairo_move_to (cr,
520
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
521
 
                       EM2PIXELS (defaults_get_margin_size (d), d) +
522
 
                       EM2PIXELS (defaults_get_icon_size (d), d),
523
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
524
 
        cairo_line_to (cr,
525
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
526
 
                       EM2PIXELS (defaults_get_margin_size (d), d) +
527
 
                       EM2PIXELS (defaults_get_icon_size (d), d),
528
 
                       0.5f + (gdouble) bubble_get_height (bubble) -
529
 
                       EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
530
 
        cairo_move_to (cr,
531
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
532
 
                       EM2PIXELS (2 * defaults_get_margin_size (d), d) +
533
 
                       EM2PIXELS (defaults_get_icon_size (d), d),
534
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
535
 
        cairo_line_to (cr,
536
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
537
 
                       EM2PIXELS (2 * defaults_get_margin_size (d), d) +
538
 
                       EM2PIXELS (defaults_get_icon_size (d), d),
539
 
                       0.5f + (gdouble) bubble_get_height (bubble) -
540
 
                       EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
541
 
        cairo_move_to (cr,
542
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
543
 
                       EM2PIXELS (defaults_get_bubble_width (d), d) -
544
 
                       EM2PIXELS (defaults_get_margin_size (d), d),
545
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
546
 
        cairo_line_to (cr,
547
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
548
 
                       EM2PIXELS (defaults_get_bubble_width (d), d) -
549
 
                       EM2PIXELS (defaults_get_margin_size (d), d),
550
 
                       0.5f + (gdouble) bubble_get_height (bubble) -
551
 
                       EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
552
 
        cairo_move_to (cr,
553
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
554
 
                       EM2PIXELS (defaults_get_bubble_width (d), d),
555
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
556
 
        cairo_line_to (cr,
557
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
558
 
                       EM2PIXELS (defaults_get_bubble_width (d), d),
559
 
                       0.5f + (gdouble) bubble_get_height (bubble) -
560
 
                       EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
 
520
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d),
 
521
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d));
 
522
        cairo_line_to (cr,
 
523
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d),
 
524
                       0.5f + (gdouble) bubble_get_height (bubble) -
 
525
                       EM2PIXELS (get_shadow_size (bubble), d));
 
526
        cairo_move_to (cr,
 
527
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
528
                       EM2PIXELS (defaults_get_margin_size (d), d),
 
529
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d));
 
530
        cairo_line_to (cr,
 
531
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
532
                       EM2PIXELS (defaults_get_margin_size (d), d),
 
533
                       0.5f + (gdouble) bubble_get_height (bubble) -
 
534
                       EM2PIXELS (get_shadow_size (bubble), d));
 
535
        cairo_move_to (cr,
 
536
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
537
                       EM2PIXELS (defaults_get_margin_size (d), d) +
 
538
                       EM2PIXELS (defaults_get_icon_size (d), d),
 
539
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d));
 
540
        cairo_line_to (cr,
 
541
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
542
                       EM2PIXELS (defaults_get_margin_size (d), d) +
 
543
                       EM2PIXELS (defaults_get_icon_size (d), d),
 
544
                       0.5f + (gdouble) bubble_get_height (bubble) -
 
545
                       EM2PIXELS (get_shadow_size (bubble), d));
 
546
        cairo_move_to (cr,
 
547
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
548
                       EM2PIXELS (2 * defaults_get_margin_size (d), d) +
 
549
                       EM2PIXELS (defaults_get_icon_size (d), d),
 
550
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d));
 
551
        cairo_line_to (cr,
 
552
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
553
                       EM2PIXELS (2 * defaults_get_margin_size (d), d) +
 
554
                       EM2PIXELS (defaults_get_icon_size (d), d),
 
555
                       0.5f + (gdouble) bubble_get_height (bubble) -
 
556
                       EM2PIXELS (get_shadow_size (bubble), d));
 
557
        cairo_move_to (cr,
 
558
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
559
                       EM2PIXELS (defaults_get_bubble_width (d), d) -
 
560
                       EM2PIXELS (defaults_get_margin_size (d), d),
 
561
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d));
 
562
        cairo_line_to (cr,
 
563
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
564
                       EM2PIXELS (defaults_get_bubble_width (d), d) -
 
565
                       EM2PIXELS (defaults_get_margin_size (d), d),
 
566
                       0.5f + (gdouble) bubble_get_height (bubble) -
 
567
                       EM2PIXELS (get_shadow_size (bubble), d));
 
568
        cairo_move_to (cr,
 
569
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
570
                       EM2PIXELS (defaults_get_bubble_width (d), d),
 
571
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d));
 
572
        cairo_line_to (cr,
 
573
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
574
                       EM2PIXELS (defaults_get_bubble_width (d), d),
 
575
                       0.5f + (gdouble) bubble_get_height (bubble) -
 
576
                       EM2PIXELS (get_shadow_size (bubble), d));
561
577
 
562
578
        // all horizontal grid lines
563
579
        cairo_move_to (cr,
564
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
565
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
566
 
        cairo_line_to (cr,
567
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
568
 
                       EM2PIXELS (defaults_get_bubble_width (d), d),
569
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
570
 
        cairo_move_to (cr,
571
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
572
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
573
 
                       EM2PIXELS (defaults_get_margin_size (d), d));
574
 
        cairo_line_to (cr,
575
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
576
 
                       EM2PIXELS (defaults_get_bubble_width (d), d),
577
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
578
 
                       EM2PIXELS (defaults_get_margin_size (d), d));
579
 
        cairo_move_to (cr,
580
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
581
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
582
 
                       EM2PIXELS (defaults_get_margin_size (d), d) +
583
 
                       EM2PIXELS (defaults_get_icon_size (d), d));
584
 
        cairo_line_to (cr,
585
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
586
 
                       EM2PIXELS (defaults_get_bubble_width (d), d),
587
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
588
 
                       EM2PIXELS (defaults_get_margin_size (d), d) +
589
 
                       EM2PIXELS (defaults_get_icon_size (d), d));
590
 
        cairo_move_to (cr,
591
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
592
 
                       0.5f + (gdouble) bubble_get_height (bubble) -
593
 
                       EM2PIXELS (defaults_get_bubble_shadow_size (d), d) -
594
 
                       EM2PIXELS (defaults_get_margin_size (d), d));
595
 
        cairo_line_to (cr,
596
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
597
 
                       EM2PIXELS (defaults_get_bubble_width (d), d),
598
 
                       0.5f + (gdouble) bubble_get_height (bubble) -
599
 
                       EM2PIXELS (defaults_get_bubble_shadow_size (d), d) -
600
 
                       EM2PIXELS (defaults_get_margin_size (d), d));
601
 
        cairo_move_to (cr,
602
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
603
 
                       0.5f + (gdouble) bubble_get_height (bubble) -
604
 
                       EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
605
 
        cairo_line_to (cr,
606
 
                       0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
607
 
                       EM2PIXELS (defaults_get_bubble_width (d), d),
608
 
                       0.5f + (gdouble) bubble_get_height (bubble) -
609
 
                       EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
 
580
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d),
 
581
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d));
 
582
        cairo_line_to (cr,
 
583
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
584
                       EM2PIXELS (defaults_get_bubble_width (d), d),
 
585
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d));
 
586
        cairo_move_to (cr,
 
587
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d),
 
588
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
589
                       EM2PIXELS (defaults_get_margin_size (d), d));
 
590
        cairo_line_to (cr,
 
591
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
592
                       EM2PIXELS (defaults_get_bubble_width (d), d),
 
593
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
594
                       EM2PIXELS (defaults_get_margin_size (d), d));
 
595
        cairo_move_to (cr,
 
596
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d),
 
597
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
598
                       EM2PIXELS (defaults_get_margin_size (d), d) +
 
599
                       EM2PIXELS (defaults_get_icon_size (d), d));
 
600
        cairo_line_to (cr,
 
601
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
602
                       EM2PIXELS (defaults_get_bubble_width (d), d),
 
603
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
604
                       EM2PIXELS (defaults_get_margin_size (d), d) +
 
605
                       EM2PIXELS (defaults_get_icon_size (d), d));
 
606
        cairo_move_to (cr,
 
607
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d),
 
608
                       0.5f + (gdouble) bubble_get_height (bubble) -
 
609
                       EM2PIXELS (get_shadow_size (bubble), d) -
 
610
                       EM2PIXELS (defaults_get_margin_size (d), d));
 
611
        cairo_line_to (cr,
 
612
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
613
                       EM2PIXELS (defaults_get_bubble_width (d), d),
 
614
                       0.5f + (gdouble) bubble_get_height (bubble) -
 
615
                       EM2PIXELS (get_shadow_size (bubble), d) -
 
616
                       EM2PIXELS (defaults_get_margin_size (d), d));
 
617
        cairo_move_to (cr,
 
618
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d),
 
619
                       0.5f + (gdouble) bubble_get_height (bubble) -
 
620
                       EM2PIXELS (get_shadow_size (bubble), d));
 
621
        cairo_line_to (cr,
 
622
                       0.5f + EM2PIXELS (get_shadow_size (bubble), d) +
 
623
                       EM2PIXELS (defaults_get_bubble_width (d), d),
 
624
                       0.5f + (gdouble) bubble_get_height (bubble) -
 
625
                       EM2PIXELS (get_shadow_size (bubble), d));
610
626
 
611
627
        cairo_stroke (cr);
612
628
}
625
641
        raico_blur_t*    blur       = NULL;
626
642
        gint             width;
627
643
        gint             height;
 
644
        gint             scratch_shadow_size;
628
645
 
629
646
        bubble_get_size (self, &width, &height);
630
647
 
631
648
        // create temp. scratch surface for top-left shadow/background part
632
649
        if (priv->composited)
 
650
        {
 
651
                scratch_shadow_size = EM2PIXELS (get_shadow_size (self), d);
633
652
                scratch = cairo_image_surface_create (
634
653
                        CAIRO_FORMAT_ARGB32,
635
 
                        3 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
636
 
                        3 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
 
654
                        3 * scratch_shadow_size,
 
655
                        3 * scratch_shadow_size);
 
656
        }
637
657
        else
 
658
        {
 
659
                // We must have at least some width to this scratch surface.
 
660
                scratch_shadow_size = 1;
638
661
                scratch = cairo_image_surface_create (
639
662
                        CAIRO_FORMAT_RGB24,
640
 
                        3 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
641
 
                        3 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
 
663
                        3 * scratch_shadow_size,
 
664
                        3 * scratch_shadow_size);
 
665
        }
642
666
 
643
667
        g_return_if_fail (scratch);
644
668
 
680
704
                        cr,
681
705
                        width,
682
706
                        height,
683
 
                        EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
684
 
                        EM2PIXELS (defaults_get_bubble_corner_radius (d), d));
 
707
                        EM2PIXELS (get_shadow_size (self), d),
 
708
                        EM2PIXELS (get_corner_radius (self), d));
685
709
                cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
686
710
                draw_round_rect (
687
711
                        cr,
688
712
                        1.0f,
689
 
                        EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
690
 
                        EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
691
 
                        EM2PIXELS (defaults_get_bubble_corner_radius (d), d),
 
713
                        EM2PIXELS (get_shadow_size (self), d),
 
714
                        EM2PIXELS (get_shadow_size (self), d),
 
715
                        EM2PIXELS (get_corner_radius (self), d),
692
716
                        EM2PIXELS (defaults_get_bubble_width (d), d),
693
717
                        (gdouble) bubble_get_height (self) -
694
 
                        2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
 
718
                        2.0f * EM2PIXELS (get_shadow_size (self), d));
695
719
                cairo_fill (cr);
696
720
                cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
697
721
                cairo_set_source_rgba (cr,
709
733
        draw_round_rect (
710
734
                cr,
711
735
                1.0f,
712
 
                EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
713
 
                EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
714
 
                EM2PIXELS (defaults_get_bubble_corner_radius (d), d),
 
736
                EM2PIXELS (get_shadow_size (self), d),
 
737
                EM2PIXELS (get_shadow_size (self), d),
 
738
                EM2PIXELS (get_corner_radius (self), d),
715
739
                EM2PIXELS (defaults_get_bubble_width (d), d),
716
740
                (gdouble) bubble_get_height (self) -
717
 
                2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
 
741
                2.0f * EM2PIXELS (get_shadow_size (self), d));
718
742
        cairo_fill (cr);
719
743
        cairo_destroy (cr);
720
744
 
722
746
        dummy = cairo_image_surface_create_for_data (
723
747
                        cairo_image_surface_get_data (scratch),
724
748
                        cairo_image_surface_get_format (scratch),
725
 
                        3 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
726
 
                        3 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
 
749
                        3 * scratch_shadow_size,
 
750
                        3 * scratch_shadow_size,
727
751
                        cairo_image_surface_get_stride (scratch));
728
752
        clone = copy_surface (dummy);
729
753
        cairo_surface_destroy (dummy);
732
756
        dummy = cairo_image_surface_create_for_data (
733
757
                        cairo_image_surface_get_data (clone),
734
758
                        cairo_image_surface_get_format (clone),
735
 
                        2 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
736
 
                        2 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
 
759
                        2 * scratch_shadow_size,
 
760
                        2 * scratch_shadow_size,
737
761
                        cairo_image_surface_get_stride (clone));
738
762
        normal = copy_surface (dummy);
739
763
        cairo_surface_destroy (dummy);
748
772
        dummy = cairo_image_surface_create_for_data (
749
773
                        cairo_image_surface_get_data (clone),
750
774
                        cairo_image_surface_get_format (clone),
751
 
                        2 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
752
 
                        2 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d),
 
775
                        2 * scratch_shadow_size,
 
776
                        2 * scratch_shadow_size,
753
777
                        cairo_image_surface_get_stride (clone));
754
778
        blurred = copy_surface (dummy);
755
779
        cairo_surface_destroy (dummy);
1265
1289
                draw_round_rect (
1266
1290
                        cr,
1267
1291
                        1.0f,
1268
 
                        EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + 2.0f,
1269
 
                        EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + 2.0f,
1270
 
                        EM2PIXELS (defaults_get_bubble_corner_radius (d), d) - 2.0f,
 
1292
                        EM2PIXELS (get_shadow_size (self), d) + 2.0f,
 
1293
                        EM2PIXELS (get_shadow_size (self), d) + 2.0f,
 
1294
                        EM2PIXELS (get_corner_radius (self), d) - 2.0f,
1271
1295
                        EM2PIXELS (defaults_get_bubble_width (d), d) - 4.0f,
1272
 
                        2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d) - 2.0f);
 
1296
                        2.0f * EM2PIXELS (get_shadow_size (self), d) - 2.0f);
1273
1297
                cairo_fill (cr);
1274
1298
 
1275
1299
                cairo_set_source_rgb (cr, 0.0f, 0.0f, 0.0f);
1279
1303
                cairo_move_to (
1280
1304
                        cr,
1281
1305
                        EM2PIXELS (defaults_get_text_body_size  (d), d) +
1282
 
                        EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
 
1306
                        EM2PIXELS (get_shadow_size (self), d) +
1283
1307
                        2.0f,
1284
1308
                        EM2PIXELS (defaults_get_text_body_size  (d), d) +
1285
 
                        EM2PIXELS (defaults_get_bubble_shadow_size (d), d) +
 
1309
                        EM2PIXELS (get_shadow_size (self), d) +
1286
1310
                        2.0f +
1287
 
                        ((2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d) - 2.0f) -
 
1311
                        ((2.0f * EM2PIXELS (get_shadow_size (self), d) - 2.0f) -
1288
1312
                        EM2PIXELS (defaults_get_text_body_size  (d), d)) / 2);
1289
1313
 
1290
1314
                switch (bubble_get_urgency (self))
1428
1452
                gdouble  alpha_blur)
1429
1453
{
1430
1454
        Defaults* d           = self->defaults;
1431
 
        gint      shadow      = EM2PIXELS (defaults_get_bubble_shadow_size (d), d);
 
1455
        gint      shadow      = EM2PIXELS (get_shadow_size (self), d);
1432
1456
        gint      icon_half   = EM2PIXELS (defaults_get_icon_size (d), d) / 2;
1433
1457
        gint      width_half  = EM2PIXELS (defaults_get_bubble_width (d), d) / 2;
1434
1458
        gint      height_half = EM2PIXELS (defaults_get_bubble_min_height (d), d) / 2;
1730
1754
 
1731
1755
        _set_bg_blur (window,
1732
1756
                      TRUE,
1733
 
                      EM2PIXELS (defaults_get_bubble_shadow_size (d), d));
 
1757
                      EM2PIXELS (get_shadow_size (bubble), d));
1734
1758
 
1735
1759
        return TRUE;
1736
1760
}
3379
3403
 
3380
3404
        new_bubble_width =
3381
3405
                EM2PIXELS (defaults_get_bubble_width (d), d) +
3382
 
                2 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d);
 
3406
                2 * EM2PIXELS (get_shadow_size (self), d);
3383
3407
 
3384
3408
        switch (priv->layout)
3385
3409
        {
3397
3421
 
3398
3422
                        new_bubble_height =
3399
3423
                                EM2PIXELS (defaults_get_bubble_min_height (d), d) +
3400
 
                                2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d);
 
3424
                                2.0f * EM2PIXELS (get_shadow_size (self), d);
3401
3425
                break;
3402
3426
 
3403
3427
                case LAYOUT_ICON_TITLE_BODY:
3446
3470
                                        new_bubble_height =
3447
3471
                                                EM2PIXELS (defaults_get_icon_size (d), d) +
3448
3472
                                                2.0f * EM2PIXELS (defaults_get_margin_size (d), d) +
3449
 
                                                2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d);
 
3473
                                                2.0f * EM2PIXELS (get_shadow_size (self), d);
3450
3474
                                }
3451
3475
                                else
3452
3476
                                {
3454
3478
                                                priv->body_height +
3455
3479
                                                priv->title_height +
3456
3480
                                                2.0f * EM2PIXELS (defaults_get_margin_size (d), d) +
3457
 
                                                2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d);
 
3481
                                                2.0f * EM2PIXELS (get_shadow_size (self), d);
3458
3482
                                }
3459
3483
                        }
3460
3484
                }
3501
3525
                                        priv->body_height +
3502
3526
                                        priv->title_height +
3503
3527
                                        2.0f * EM2PIXELS (defaults_get_margin_size (d), d) +
3504
 
                                        2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d);
 
3528
                                        2.0f * EM2PIXELS (get_shadow_size (self), d);
3505
3529
                        }
3506
3530
                }
3507
3531
                break;
3518
3542
 
3519
3543
                        new_bubble_height = priv->title_height +
3520
3544
                                2.0f * EM2PIXELS (defaults_get_margin_size (d), d) +
3521
 
                                2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d);
 
3545
                                2.0f * EM2PIXELS (get_shadow_size (self), d);
3522
3546
                }
3523
3547
                break;
3524
3548