~ubuntu-branches/ubuntu/precise/xfwm4/precise-proposed

« back to all changes in this revision

Viewing changes to src/placement.c

  • Committer: Bazaar Package Importer
  • Author(s): Gauvain Pocentek
  • Date: 2006-12-22 18:37:36 UTC
  • mto: (3.1.2 lenny) (1.1.22 upstream)
  • mto: This revision was merged to the branch mainline in revision 23.
  • Revision ID: james.westby@ubuntu.com-20061222183736-yoju2r97heo29ya1
Tags: upstream-4.3.99.2svn+r24167
ImportĀ upstreamĀ versionĀ 4.3.99.2svn+r24167

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*      $Id: placement.c 23704 2006-11-04 22:36:42Z olivier $
 
1
/*      $Id: placement.c 24050 2006-12-06 06:47:50Z olivier $
2
2
 
3
3
        This program is free software; you can redistribute it and/or modify
4
4
        it under the terms of the GNU General Public License as published by
41
41
static unsigned long overlap (int x0, int y0, int x1, int y1,
42
42
                              int tx0, int ty0, int tx1, int ty1);
43
43
 
 
44
/* Compute rectangle overlap area */
 
45
 
 
46
static unsigned long
 
47
overlapX (int x0, int x1, int tx0, int tx1)
 
48
{
 
49
    if (tx0 > x0)
 
50
    {
 
51
        x0 = tx0;
 
52
    }
 
53
    if (tx1 < x1)
 
54
    {
 
55
        x1 = tx1;
 
56
    }
 
57
    if (x1 <= x0)
 
58
    {
 
59
        return 0;
 
60
    }
 
61
    return (x1 - x0);
 
62
}
 
63
 
 
64
static unsigned long
 
65
overlapY (int y0, int y1, int ty0, int ty1)
 
66
{
 
67
    if (ty0 > y0)
 
68
    {
 
69
        y0 = ty0;
 
70
    }
 
71
    if (ty1 < y1)
 
72
    {
 
73
        y1 = ty1;
 
74
    }
 
75
    if (y1 <= y0)
 
76
    {
 
77
        return 0;
 
78
    }
 
79
    return (y1 - y0);
 
80
}
 
81
 
 
82
static unsigned long
 
83
overlap (int x0, int y0, int x1, int y1, int tx0, int ty0, int tx1, int ty1)
 
84
{
 
85
    /* Compute overlapping box */
 
86
    return (overlapX (x0, x1, tx0, tx1) * overlapY (y0, y1, ty0, ty1));
 
87
}
 
88
 
44
89
static unsigned long
45
90
clientStrutAreaOverlap (int x, int y, int w, int h, Client * c)
46
91
{
70
115
    return sigma;
71
116
}
72
117
 
73
 
/* Compute rectangle overlap area */
74
 
 
75
 
static unsigned long
76
 
overlapX (int x0, int x1, int tx0, int tx1)
77
 
{
78
 
    if (tx0 > x0)
79
 
    {
80
 
        x0 = tx0;
81
 
    }
82
 
    if (tx1 < x1)
83
 
    {
84
 
        x1 = tx1;
85
 
    }
86
 
    if (x1 <= x0)
87
 
    {
88
 
        return 0;
89
 
    }
90
 
    return (x1 - x0);
91
 
}
92
 
 
93
 
static unsigned long
94
 
overlapY (int y0, int y1, int ty0, int ty1)
95
 
{
96
 
    if (ty0 > y0)
97
 
    {
98
 
        y0 = ty0;
99
 
    }
100
 
    if (ty1 < y1)
101
 
    {
102
 
        y1 = ty1;
103
 
    }
104
 
    if (y1 <= y0)
105
 
    {
106
 
        return 0;
107
 
    }
108
 
    return (y1 - y0);
109
 
}
110
 
 
111
 
static unsigned long
112
 
overlap (int x0, int y0, int x1, int y1, int tx0, int ty0, int tx1, int ty1)
113
 
{
114
 
    /* Compute overlapping box */
115
 
    return (overlapX (x0, x1, tx0, tx1) * overlapY (y0, y1, ty0, ty1));
116
 
}
117
 
 
118
118
void
119
119
clientMaxSpace (ScreenInfo *screen_info, int *x, int *y, int *w, int *h)
120
120
{
193
193
    screen_info = c->screen_info;
194
194
    for (c2 = screen_info->clients, i = 0; i < screen_info->client_count; c2 = c2->next, i++)
195
195
    {
196
 
        if ((c2 != c) && clientStrutAreaOverlap(frame_x, frame_y, frame_width, frame_top, c2))
 
196
        if ((c2 != c) && clientStrutAreaOverlap (frame_x, frame_y, frame_width, frame_top, c2))
197
197
        {
198
198
            return FALSE;
199
199
        }
390
390
            frame_y = frameY (c);
391
391
            ret |= CLIENT_CONSTRAINED_BOTTOM;
392
392
        }
393
 
        if ((frame_y <= disp_y) && (frame_y >= disp_y - frame_top))
 
393
        if ((frame_y < disp_y) && (frame_y >= disp_y - frame_top))
394
394
        {
395
395
            c->y = disp_y + frame_top;
396
396
            frame_y = frameY (c);
701
701
        }
702
702
    }
703
703
 
704
 
    clientAutoMaximize (c, full_w, full_h);
 
704
    if (c->type & WINDOW_REGULAR_FOCUSABLE)
 
705
    {
 
706
        clientAutoMaximize (c, full_w, full_h);
 
707
    }
705
708
}