~didrocks/notify-osd/bootstrap

« back to all changes in this revision

Viewing changes to src/display.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:
60
60
static gboolean
61
61
stack_is_at_top_corner (Stack *self, Bubble *bubble)
62
62
{
 
63
  GdkScreen* screen;
63
64
        gint x, y1, y2;
64
65
 
65
66
        g_assert (IS_STACK (self));
66
67
        g_assert (IS_BUBBLE (bubble));
67
68
 
68
 
        defaults_get_top_corner (self->defaults, &x, &y1);
 
69
        defaults_get_top_corner (self->defaults, &screen, &x, &y1);
69
70
        bubble_get_position (bubble, &x, &y2);
70
71
 
71
72
        return y1 == y2;
74
75
static void
75
76
stack_display_position_sync_bubble (Stack *self, Bubble *bubble)
76
77
{
77
 
        Defaults* d = self->defaults;
78
 
        gint      y = 0;
79
 
        gint      x = 0;
 
78
        Defaults*  d = self->defaults;
 
79
  GdkScreen* screen;
 
80
        gint       y = 0;
 
81
        gint       x = 0;
80
82
 
81
 
        defaults_get_top_corner (d, &x, &y);
 
83
        defaults_get_top_corner (d, &screen, &x, &y);
82
84
 
83
85
        // TODO: with multi-head, in focus follow mode, there may be enough
84
86
        // space left on the top monitor
279
281
static void
280
282
stack_layout (Stack* self)
281
283
{
282
 
        Bubble*   bubble = NULL;
283
 
        Defaults* d;
284
 
        gint      y      = 0;
285
 
        gint      x      = 0;
 
284
        Bubble*    bubble = NULL;
 
285
        Defaults*  d;
 
286
  GdkScreen* screen;
 
287
        gint       y      = 0;
 
288
        gint       x      = 0;
286
289
 
287
290
        g_return_if_fail (self != NULL);
288
291
 
313
316
        bubble_set_timeout (bubble,
314
317
                            defaults_get_on_screen_timeout (self->defaults));
315
318
 
316
 
        defaults_get_top_corner (self->defaults, &x, &y);
 
319
        defaults_get_top_corner (self->defaults, &screen, &x, &y);
317
320
 
318
321
        d = self->defaults;
319
322