15708
|
1 |
diff -Nrup metacity-2.18.2/src/ui/frames.c ../metacity-2.18.2/src/ui/frames.c
|
|
2 |
--- metacity-2.18.2/src/ui/frames.c 2007-04-09 03:32:46.000000000 +0200
|
|
3 |
+++ ../metacity-2.18.2/src/ui/frames.c 2007-04-12 15:34:25.878227000 +0200
|
|
4 |
@@ -752,6 +752,8 @@ meta_frames_apply_shapes (MetaFrames *fr
|
|
5 |
XRectangle xrect;
|
|
6 |
Region corners_xregion;
|
|
7 |
Region window_xregion;
|
|
8 |
+ /* hack for nimbus theme */
|
|
9 |
+ gboolean nimbus_theme = (strcmp ("nimbus", meta_prefs_get_theme ()) == 0) ? TRUE : FALSE;
|
|
10 |
|
|
11 |
frame = meta_frames_lookup_window (frames, xwindow);
|
|
12 |
g_return_if_fail (frame != NULL);
|
|
13 |
@@ -788,74 +790,120 @@ meta_frames_apply_shapes (MetaFrames *fr
|
|
14 |
|
|
15 |
if (fgeom.top_left_corner_rounded_radius != 0)
|
|
16 |
{
|
|
17 |
- const int corner = fgeom.top_left_corner_rounded_radius;
|
|
18 |
- const float radius = sqrt(corner) + corner;
|
|
19 |
- int i;
|
|
20 |
-
|
|
21 |
- for (i=0; i<corner; i++)
|
|
22 |
- {
|
|
23 |
- const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
|
|
24 |
- xrect.x = 0;
|
|
25 |
- xrect.y = i;
|
|
26 |
- xrect.width = width;
|
|
27 |
- xrect.height = 1;
|
|
28 |
-
|
|
29 |
- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
|
|
30 |
- }
|
|
31 |
+ if (nimbus_theme)
|
|
32 |
+ {
|
|
33 |
+ xrect.x = 0;
|
|
34 |
+ xrect.y = 0;
|
|
35 |
+ xrect.width = 1;
|
|
36 |
+ xrect.height = 1;
|
|
37 |
+ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
|
|
38 |
+ }
|
|
39 |
+ else
|
|
40 |
+ {
|
|
41 |
+ const int corner = fgeom.top_left_corner_rounded_radius;
|
|
42 |
+ const float radius = sqrt(corner) + corner;
|
|
43 |
+ int i;
|
|
44 |
+
|
|
45 |
+ for (i=0; i<corner; i++)
|
|
46 |
+ {
|
|
47 |
+ const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
|
|
48 |
+ xrect.x = 0;
|
|
49 |
+ xrect.y = i;
|
|
50 |
+ xrect.width = width;
|
|
51 |
+ xrect.height = 1;
|
|
52 |
+
|
|
53 |
+ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
|
|
54 |
+ }
|
|
55 |
+ }
|
|
56 |
}
|
|
57 |
|
|
58 |
if (fgeom.top_right_corner_rounded_radius != 0)
|
|
59 |
{
|
|
60 |
- const int corner = fgeom.top_right_corner_rounded_radius;
|
|
61 |
- const float radius = sqrt(corner) + corner;
|
|
62 |
- int i;
|
|
63 |
+ if (nimbus_theme)
|
|
64 |
+ {
|
|
65 |
+ xrect.x = new_window_width - 1;
|
|
66 |
+ xrect.y = 0;
|
|
67 |
+ xrect.width = 1;
|
|
68 |
+ xrect.height = 1;
|
|
69 |
+ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
|
|
70 |
+ }
|
|
71 |
+ else
|
|
72 |
+ {
|
|
73 |
|
|
74 |
- for (i=0; i<corner; i++)
|
|
75 |
- {
|
|
76 |
- const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
|
|
77 |
- xrect.x = new_window_width - width;
|
|
78 |
- xrect.y = i;
|
|
79 |
- xrect.width = width;
|
|
80 |
- xrect.height = 1;
|
|
81 |
-
|
|
82 |
- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
|
|
83 |
- }
|
|
84 |
+ const int corner = fgeom.top_right_corner_rounded_radius;
|
|
85 |
+ const float radius = sqrt(corner) + corner;
|
|
86 |
+ int i;
|
|
87 |
+
|
|
88 |
+ for (i=0; i<corner; i++)
|
|
89 |
+ {
|
|
90 |
+ const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
|
|
91 |
+ xrect.x = new_window_width - width;
|
|
92 |
+ xrect.y = i;
|
|
93 |
+ xrect.width = width;
|
|
94 |
+ xrect.height = 1;
|
|
95 |
+
|
|
96 |
+ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
|
|
97 |
+ }
|
|
98 |
+ }
|
|
99 |
}
|
|
100 |
|
|
101 |
if (fgeom.bottom_left_corner_rounded_radius != 0)
|
|
102 |
{
|
|
103 |
- const int corner = fgeom.bottom_left_corner_rounded_radius;
|
|
104 |
- const float radius = sqrt(corner) + corner;
|
|
105 |
- int i;
|
|
106 |
+ if (nimbus_theme)
|
|
107 |
+ {
|
|
108 |
+ xrect.x = 0;
|
|
109 |
+ xrect.y = new_window_height - 1;
|
|
110 |
+ xrect.width = 1;
|
|
111 |
+ xrect.height = 1;
|
|
112 |
+ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
|
|
113 |
+ }
|
|
114 |
+ else
|
|
115 |
+ {
|
|
116 |
|
|
117 |
- for (i=0; i<corner; i++)
|
|
118 |
- {
|
|
119 |
- const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
|
|
120 |
- xrect.x = 0;
|
|
121 |
- xrect.y = new_window_height - i - 1;
|
|
122 |
- xrect.width = width;
|
|
123 |
- xrect.height = 1;
|
|
124 |
-
|
|
125 |
- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
|
|
126 |
- }
|
|
127 |
+ const int corner = fgeom.bottom_left_corner_rounded_radius;
|
|
128 |
+ const float radius = sqrt(corner) + corner;
|
|
129 |
+ int i;
|
|
130 |
+
|
|
131 |
+ for (i=0; i<corner; i++)
|
|
132 |
+ {
|
|
133 |
+ const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
|
|
134 |
+ xrect.x = 0;
|
|
135 |
+ xrect.y = new_window_height - i - 1;
|
|
136 |
+ xrect.width = width;
|
|
137 |
+ xrect.height = 1;
|
|
138 |
+
|
|
139 |
+ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
|
|
140 |
+ }
|
|
141 |
+ }
|
|
142 |
}
|
|
143 |
|
|
144 |
if (fgeom.bottom_right_corner_rounded_radius != 0)
|
|
145 |
{
|
|
146 |
- const int corner = fgeom.bottom_right_corner_rounded_radius;
|
|
147 |
- const float radius = sqrt(corner) + corner;
|
|
148 |
- int i;
|
|
149 |
-
|
|
150 |
- for (i=0; i<corner; i++)
|
|
151 |
- {
|
|
152 |
- const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
|
|
153 |
- xrect.x = new_window_width - width;
|
|
154 |
- xrect.y = new_window_height - i - 1;
|
|
155 |
- xrect.width = width;
|
|
156 |
- xrect.height = 1;
|
|
157 |
-
|
|
158 |
- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
|
|
159 |
- }
|
|
160 |
+ if (nimbus_theme)
|
|
161 |
+ {
|
|
162 |
+ xrect.x = new_window_width - 1;
|
|
163 |
+ xrect.y = new_window_height - 1;
|
|
164 |
+ xrect.width = 1;
|
|
165 |
+ xrect.height = 1;
|
|
166 |
+ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
|
|
167 |
+ }
|
|
168 |
+ else
|
|
169 |
+ {
|
|
170 |
+ const int corner = fgeom.bottom_right_corner_rounded_radius;
|
|
171 |
+ const float radius = sqrt(corner) + corner;
|
|
172 |
+ int i;
|
|
173 |
+
|
|
174 |
+ for (i=0; i<corner; i++)
|
|
175 |
+ {
|
|
176 |
+ const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
|
|
177 |
+ xrect.x = new_window_width - width;
|
|
178 |
+ xrect.y = new_window_height - i - 1;
|
|
179 |
+ xrect.width = width;
|
|
180 |
+ xrect.height = 1;
|
|
181 |
+
|
|
182 |
+ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
|
|
183 |
+ }
|
|
184 |
+ }
|
|
185 |
}
|
|
186 |
|
|
187 |
window_xregion = XCreateRegion ();
|
|
188 |
diff -Nrup metacity-2.18.2/src/ui/theme-parser.c ../metacity-2.18.2/src/ui/theme-parser.c
|
|
189 |
--- metacity-2.18.2/src/ui/theme-parser.c 2007-04-08 20:46:17.000000000 +0200
|
|
190 |
+++ ../metacity-2.18.2/src/ui/theme-parser.c 2007-04-12 15:23:40.286578000 +0200
|
|
191 |
@@ -913,6 +913,23 @@ parse_toplevel_element (GMarkupParseCont
|
|
192 |
return;
|
|
193 |
|
|
194 |
title_scale_val = 1.0;
|
|
195 |
+
|
|
196 |
+ { /* Hack for Nimbus theme - pretend we have rounded corners this way the theme will
|
|
197 |
+ look Ok in non-patches version of metacity */
|
|
198 |
+ gboolean nimbus_theme = (strcmp ("nimbus", info->theme_name) == 0) ? TRUE : FALSE;
|
|
199 |
+ if (nimbus_theme)
|
|
200 |
+ {
|
|
201 |
+ rounded_top_left_val = TRUE;
|
|
202 |
+ rounded_top_right_val = TRUE;
|
|
203 |
+ rounded_bottom_left_val = TRUE;
|
|
204 |
+ rounded_bottom_right_val = TRUE;
|
|
205 |
+ rounded_top_left = TRUE;
|
|
206 |
+ rounded_top_right = TRUE;
|
|
207 |
+ rounded_bottom_left = TRUE;
|
|
208 |
+ rounded_bottom_right = TRUE;
|
|
209 |
+ }
|
|
210 |
+ }
|
|
211 |
+
|
|
212 |
if (title_scale && !parse_title_scale (title_scale, &title_scale_val, context, error))
|
|
213 |
return;
|
|
214 |
|