summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk/window-decorator/cairo.c3
-rw-r--r--gtk/window-decorator/decorprops.c11
-rw-r--r--gtk/window-decorator/gtk-window-decorator.h2
-rw-r--r--gtk/window-decorator/metacity.c79
-rw-r--r--gtk/window-decorator/settings.c3
5 files changed, 34 insertions, 64 deletions
diff --git a/gtk/window-decorator/cairo.c b/gtk/window-decorator/cairo.c
index fe9b857..5f29901 100644
--- a/gtk/window-decorator/cairo.c
+++ b/gtk/window-decorator/cairo.c
@@ -829,9 +829,6 @@ get_event_window_position (decor_t *d,
gint *w,
gint *h)
{
- WnckWindowType win_type = wnck_window_get_window_type (d->win);
- decor_frame_t *frame = gwd_get_decor_frame (get_frame_type (win_type));
-
if (d->frame_window)
{
*x = pos[i][j].x + pos[i][j].xw * width + d->frame->win_extents.left;
diff --git a/gtk/window-decorator/decorprops.c b/gtk/window-decorator/decorprops.c
index 5787d66..9c13edb 100644
--- a/gtk/window-decorator/decorprops.c
+++ b/gtk/window-decorator/decorprops.c
@@ -6,8 +6,7 @@ decor_update_window_property (decor_t *d)
long data[256];
Display *xdisplay =
GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
- WnckWindowType win_type = wnck_window_get_window_type (d->win);
- decor_extents_t extents = gwd_get_decor_frame (get_frame_type (win_type))->win_extents;
+ decor_extents_t extents = d->frame->win_extents;
gint nQuad;
decor_quad_t quads[N_QUADS_MAX];
int w, h;
@@ -28,7 +27,7 @@ decor_update_window_property (decor_t *d)
&d->border_layout,
stretch_offset);
- extents.top += gwd_get_decor_frame (get_frame_type (win_type))->titlebar_height;
+ extents.top += d->frame->titlebar_height;
if (d->frame_window)
{
@@ -96,12 +95,6 @@ decor_update_window_property (decor_t *d)
void
decor_update_switcher_property (decor_t *d)
{
- decor_extents_t _switcher_extents = { 6, 6, 6, 6 + SWITCHER_SPACE };
- decor_context_t switcher_context = {
- { 0, 0, 0, 0 },
- 6, 6, 6, 6 + SWITCHER_SPACE,
- 0, 0, 0, 0
- };
long data[256];
Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
gint nQuad;
diff --git a/gtk/window-decorator/gtk-window-decorator.h b/gtk/window-decorator/gtk-window-decorator.h
index c7bd040..12a4f2c 100644
--- a/gtk/window-decorator/gtk-window-decorator.h
+++ b/gtk/window-decorator/gtk-window-decorator.h
@@ -727,7 +727,7 @@ meta_get_decoration_geometry (decor_t *d,
MetaFrameFlags *flags,
MetaFrameGeometry *fgeom,
MetaButtonLayout *button_layout,
- MetaFrameType frame_type,
+ MetaFrameType frame_type,
GdkRectangle *clip);
void
diff --git a/gtk/window-decorator/metacity.c b/gtk/window-decorator/metacity.c
index e8e64b7..d781716 100644
--- a/gtk/window-decorator/metacity.c
+++ b/gtk/window-decorator/metacity.c
@@ -23,10 +23,8 @@ decor_update_meta_window_property (decor_t *d,
Display *xdisplay =
GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
gint nQuad;
- WnckWindowType win_type = wnck_window_get_window_type (d->win);
- decor_frame_t *frame = gwd_get_decor_frame (get_frame_type (win_type));
- decor_extents_t win_extents = frame->win_extents;
- decor_extents_t max_win_extents = frame->max_win_extents;
+ decor_extents_t win_extents = d->frame->win_extents;
+ decor_extents_t max_win_extents = d->frame->max_win_extents;
decor_quad_t quads[N_QUADS_MAX];
gint w, lh, rh;
gint top_stretch_offset;
@@ -62,8 +60,8 @@ decor_update_meta_window_property (decor_t *d,
top_stretch_offset,
bottom_stretch_offset);
- win_extents.top += frame->titlebar_height;
- max_win_extents.top += frame->max_titlebar_height;
+ win_extents.top += d->frame->titlebar_height;
+ max_win_extents.top += d->frame->max_titlebar_height;
if (d->frame_window)
decor_gen_window_property (data, &win_extents, &max_win_extents, 20, 20);
@@ -554,7 +552,6 @@ meta_draw_window_decoration (decor_t *d)
MetaButtonLayout button_layout;
MetaFrameGeometry fgeom;
MetaFrameFlags flags;
- WnckWindowType win_type;
MetaFrameType frame_type;
MetaTheme *theme;
GtkStyle *style;
@@ -968,8 +965,6 @@ meta_get_button_position (decor_t *d,
MetaButtonLayout button_layout;
MetaFrameGeometry fgeom;
MetaFrameFlags flags;
- decor_frame_type d_frame_type;
- MetaFrameType frame_type;
MetaTheme *theme;
GdkRectangle clip;
@@ -986,11 +981,10 @@ meta_get_button_position (decor_t *d,
}
theme = meta_theme_get_current ();
- d_frame_type = get_frame_type (wnck_window_get_window_type (d->win));
- frame_type = meta_get_frame_type_for_decor_type (d_frame_type);
meta_get_decoration_geometry (d, theme, &flags, &fgeom, &button_layout,
- frame_type, &clip);
+ meta_get_frame_type_for_decor_type (d->frame->type),
+ &clip);
switch (i) {
case BUTTON_MENU:
@@ -1083,9 +1077,8 @@ meta_get_button_position (decor_t *d,
if (d->frame_window)
{
- decor_frame_t *frame = gwd_get_decor_frame (d_frame_type);
- *x += frame->win_extents.left + 4;
- *y += frame->win_extents.top + 2;
+ *x += d->frame->win_extents.left + 4;
+ *y += d->frame->win_extents.top + 2;
}
return TRUE;
@@ -1117,38 +1110,33 @@ meta_calc_decoration_size (decor_t *d,
gint *height)
{
decor_layout_t layout;
- decor_frame_t *frame;
decor_context_t *context;
decor_shadow_t *shadow;
- WnckWindowType win_type;
-
- win_type = wnck_window_get_window_type (d->win);
- frame = gwd_get_decor_frame (get_frame_type (win_type));
if ((d->state & META_MAXIMIZED) == META_MAXIMIZED)
{
if (!d->frame_window)
{
- context = &frame->max_window_context;
- shadow = frame->max_border_shadow;
+ context = &d->frame->max_window_context;
+ shadow = d->frame->max_border_shadow;
}
else
{
- context = &frame->max_window_context_no_shadow;
- shadow = frame->max_border_no_shadow;
+ context = &d->frame->max_window_context_no_shadow;
+ shadow = d->frame->max_border_no_shadow;
}
}
else
{
if (!d->frame_window)
{
- context = &frame->window_context;
- shadow = frame->border_shadow;
+ context = &d->frame->window_context;
+ shadow = d->frame->border_shadow;
}
else
{
- context = &frame->window_context_no_shadow;
- shadow = frame->border_no_shadow;
+ context = &d->frame->window_context_no_shadow;
+ shadow = d->frame->border_no_shadow;
}
}
@@ -1175,7 +1163,7 @@ meta_calc_decoration_size (decor_t *d,
{
if ((d->state & META_MAXIMIZED) == META_MAXIMIZED)
decor_get_default_layout (context, d->client_width,
- d->client_height - frame->titlebar_height,
+ d->client_height - d->frame->titlebar_height,
&layout);
else
decor_get_default_layout (context, d->client_width,
@@ -1231,20 +1219,15 @@ meta_get_event_window_position (decor_t *d,
MetaFrameGeometry fgeom;
MetaFrameFlags flags;
MetaTheme *theme;
- MetaFrameType frame_type;
- decor_frame_type d_frame_type;
- decor_frame_t *frame;
WnckWindowType win_type;
GdkRectangle clip;
theme = meta_theme_get_current ();
win_type = wnck_window_get_window_type (d->win);
- d_frame_type = get_frame_type (win_type);
- frame_type = meta_get_frame_type_for_decor_type (d_frame_type);
- frame = gwd_get_decor_frame (frame_type);
meta_get_decoration_geometry (d, theme, &flags, &fgeom, &button_layout,
- frame_type, &clip);
+ meta_get_frame_type_for_decor_type (d->frame->type),
+ &clip);
width += fgeom.right_width + fgeom.left_width;
height += fgeom.top_height + fgeom.bottom_height;
@@ -1256,9 +1239,9 @@ meta_get_event_window_position (decor_t *d,
if (d->frame_window)
{
*x = width - fgeom.right_width - RESIZE_EXTENDS +
- frame->win_extents.left + 2;
+ d->frame->win_extents.left + 2;
*y = height - fgeom.bottom_height - RESIZE_EXTENDS +
- frame->win_extents.top + 2;
+ d->frame->win_extents.top + 2;
}
else
{
@@ -1272,7 +1255,7 @@ meta_get_event_window_position (decor_t *d,
*x = fgeom.left_width + RESIZE_EXTENDS;
*y = height - fgeom.bottom_height;
if (d->frame_window)
- *y += frame->win_extents.top + 2;
+ *y += d->frame->win_extents.top + 2;
*w = width - fgeom.left_width - fgeom.right_width -
(2 * RESIZE_EXTENDS);
*h = fgeom.bottom_height;
@@ -1283,8 +1266,8 @@ meta_get_event_window_position (decor_t *d,
*y = height - fgeom.bottom_height - RESIZE_EXTENDS;
if (d->frame_window)
{
- *x += frame->win_extents.left + 4;
- *y += frame->win_extents.bottom + 2;
+ *x += d->frame->win_extents.left + 4;
+ *y += d->frame->win_extents.bottom + 2;
}
*w = fgeom.left_width + RESIZE_EXTENDS;
*h = fgeom.bottom_height + RESIZE_EXTENDS;
@@ -1296,7 +1279,7 @@ meta_get_event_window_position (decor_t *d,
case 2: /* right */
*x = width - fgeom.right_width;
if (d->frame_window)
- *x += frame->win_extents.left + 2;
+ *x += d->frame->win_extents.left + 2;
*w = fgeom.right_width;
*h = height - fgeom.top_height - fgeom.bottom_height -
(2 * RESIZE_EXTENDS);
@@ -1311,7 +1294,7 @@ meta_get_event_window_position (decor_t *d,
default:
*x = 0;
if (d->frame_window)
- *x += frame->win_extents.left + 4;
+ *x += d->frame->win_extents.left + 4;
*y = fgeom.top_height + RESIZE_EXTENDS;
*w = fgeom.left_width;
*h = height - fgeom.top_height - fgeom.bottom_height -
@@ -1327,8 +1310,8 @@ meta_get_event_window_position (decor_t *d,
*y = 0;
if (d->frame_window)
{
- *x += frame->win_extents.left + 2;
- *y += frame->win_extents.top + 2 - fgeom.title_rect.height;
+ *x += d->frame->win_extents.left + 2;
+ *y += d->frame->win_extents.top + 2 - fgeom.title_rect.height;
}
*w = fgeom.right_width + RESIZE_EXTENDS;
*h = fgeom.top_height + RESIZE_EXTENDS;
@@ -1337,7 +1320,7 @@ meta_get_event_window_position (decor_t *d,
*x = fgeom.left_width + RESIZE_EXTENDS;
*y = 0;
if (d->frame_window)
- *y += frame->win_extents.top + 2;
+ *y += d->frame->win_extents.top + 2;
*w = width - fgeom.left_width - fgeom.right_width -
(2 * RESIZE_EXTENDS);
*h = fgeom.title_rect.y + TOP_RESIZE_HEIGHT;
@@ -1348,8 +1331,8 @@ meta_get_event_window_position (decor_t *d,
*y = 0;
if (d->frame_window)
{
- *x += frame->win_extents.left + 4;
- *y += frame->win_extents.top + 2 - fgeom.title_rect.height;
+ *x += d->frame->win_extents.left + 4;
+ *y += d->frame->win_extents.top + 2 - fgeom.title_rect.height;
}
*w = fgeom.left_width + RESIZE_EXTENDS;
*h = fgeom.top_height + RESIZE_EXTENDS;
diff --git a/gtk/window-decorator/settings.c b/gtk/window-decorator/settings.c
index 5cdae28..206397e 100644
--- a/gtk/window-decorator/settings.c
+++ b/gtk/window-decorator/settings.c
@@ -446,9 +446,6 @@ value_changed (GConfClient *client,
gboolean
init_settings (WnckScreen *screen)
{
- GtkSettings *settings;
- GdkScreen *gdkscreen;
- GdkColormap *colormap;
AtkObject *switcher_label_obj;
#ifdef USE_GCONF