summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk/window-decorator/cairo.c6
-rw-r--r--gtk/window-decorator/decorator.c18
-rw-r--r--gtk/window-decorator/gtk-window-decorator.c58
-rw-r--r--gtk/window-decorator/gtk-window-decorator.h6
-rw-r--r--gtk/window-decorator/metacity.c4
5 files changed, 18 insertions, 74 deletions
diff --git a/gtk/window-decorator/cairo.c b/gtk/window-decorator/cairo.c
index f652321..5bfcae9 100644
--- a/gtk/window-decorator/cairo.c
+++ b/gtk/window-decorator/cairo.c
@@ -881,12 +881,12 @@ update_border_extents ()
{
unsigned int i;
- for (i = 0; i < DECOR_FRAME_TYPE_UNDECORATED; i++)
+ for (i = 0; i < DECOR_FRAME_TYPE_SWITCHER; i++)
{
decor_frame_t *frame = &decor_frames[i];
- frame->win_extents = _default_decoration.win_extents;
- frame->max_win_extents = _default_decoration.win_extents;
+ frame->win_extents = decor_frames[DECOR_FRAME_TYPE_DEFAULT].win_extents;
+ frame->max_win_extents = decor_frames[DECOR_FRAME_TYPE_DEFAULT].win_extents;
frame->titlebar_height = frame->max_titlebar_height =
(frame->text_height < 17) ? 17 : frame->text_height;
}
diff --git a/gtk/window-decorator/decorator.c b/gtk/window-decorator/decorator.c
index 2163c14..a33d1c0 100644
--- a/gtk/window-decorator/decorator.c
+++ b/gtk/window-decorator/decorator.c
@@ -444,7 +444,7 @@ draw_border_shape (Display *xdisplay,
if (info)
d.frame = info->frame;
else
- d.frame = &_default_decoration;
+ d.frame = &decor_frames[DECOR_FRAME_TYPE_DEFAULT];
d.pixmap = gdk_pixmap_foreign_new_for_display (gdk_display_get_default (),
pixmap);
@@ -747,7 +747,7 @@ update_default_decorations (GdkScreen *screen)
decor_t d;
gint nQuad;
decor_quad_t quads[N_QUADS_MAX];
- decor_extents_t extents = _default_decoration.win_extents;
+ decor_extents_t extents = decor_frames[DECOR_FRAME_TYPE_DEFAULT].win_extents;
xroot = RootWindowOfScreen (gdk_x11_screen_get_xscreen (screen));
@@ -805,18 +805,18 @@ update_default_decorations (GdkScreen *screen)
memset (&d, 0, sizeof (d));
- d.context = &_default_decoration.window_context;
- d.shadow = _default_decoration.border_shadow;
- d.layout = pango_layout_new (_default_decoration.pango_context); /* FIXME */
+ d.context = &decor_frames[DECOR_FRAME_TYPE_DEFAULT].window_context;
+ d.shadow = decor_frames[DECOR_FRAME_TYPE_DEFAULT].border_shadow;
+ d.layout = pango_layout_new (decor_frames[DECOR_FRAME_TYPE_DEFAULT].pango_context);
decor_get_default_layout (d.context, 1, 1, &d.border_layout);
d.width = d.border_layout.width;
d.height = d.border_layout.height;
- d.frame = &_default_decoration;
+ d.frame = &decor_frames[DECOR_FRAME_TYPE_DEFAULT];
- extents.top += _default_decoration.titlebar_height;
+ extents.top += decor_frames[DECOR_FRAME_TYPE_DEFAULT].titlebar_height;
d.draw = theme_draw_window_decoration;
@@ -826,7 +826,7 @@ update_default_decorations (GdkScreen *screen)
nQuad = decor_set_lSrStSbS_window_quads (quads, d.context,
&d.border_layout);
- decor_normal_pixmap = create_pixmap (d.width, d.height, _default_decoration.style_window_rgba); /* FIXME */
+ decor_normal_pixmap = create_pixmap (d.width, d.height, decor_frames[DECOR_FRAME_TYPE_DEFAULT].style_window_rgba);
if (decor_normal_pixmap)
{
@@ -854,7 +854,7 @@ update_default_decorations (GdkScreen *screen)
if (decor_active_pixmap)
g_object_unref (G_OBJECT (decor_active_pixmap));
- decor_active_pixmap = create_pixmap (d.width, d.height, _default_decoration.style_window_rgba); /* FIXME */
+ decor_active_pixmap = create_pixmap (d.width, d.height, decor_frames[DECOR_FRAME_TYPE_DEFAULT].style_window_rgba);
if (decor_active_pixmap)
{
diff --git a/gtk/window-decorator/gtk-window-decorator.c b/gtk/window-decorator/gtk-window-decorator.c
index 7e22ec0..d38999d 100644
--- a/gtk/window-decorator/gtk-window-decorator.c
+++ b/gtk/window-decorator/gtk-window-decorator.c
@@ -26,10 +26,9 @@ gboolean minimal = FALSE;
double decoration_alpha = 0.5;
#define SWITCHER_SPACE 40
-#define DECOR_FRAMES_NUM 6
+#define DECOR_FRAMES_NUM 7
decor_frame_t decor_frames[DECOR_FRAMES_NUM];
-decor_frame_t _default_decoration;
decor_extents_t _shadow_extents = { 0, 0, 0, 0 };
decor_extents_t _default_win_extents = { 6, 6, 6, 6 };
@@ -233,61 +232,6 @@ initialize_decorations ()
update_style (decor_frames[i].style_window_rgba);
update_style (decor_frames[i].style_window_rgb);
}
-
- _default_decoration.win_extents = _win_extents;
- _default_decoration.max_win_extents = _max_win_extents;
- _default_decoration.titlebar_height = 17;
- _default_decoration.max_titlebar_height = 17;
- _default_decoration.window_context = _window_context;
- _default_decoration.window_context_no_shadow = _window_context_no_shadow;
- _default_decoration.max_window_context = _max_window_context;
- _default_decoration.max_window_context_no_shadow = _max_window_context_no_shadow;
- _default_decoration.border_shadow = NULL;
- _default_decoration.border_no_shadow = NULL;
- _default_decoration.max_border_no_shadow = NULL;
- _default_decoration.max_border_shadow = NULL;
- _default_decoration.titlebar_font = NULL;
- _default_decoration.style_window_rgba = NULL;
- _default_decoration.style_window_rgb = NULL;
- _default_decoration.pango_context = NULL;
- _default_decoration.type = 0;
-
- _default_decoration.style_window_rgba = gtk_window_new (GTK_WINDOW_POPUP);
-
- colormap = gdk_screen_get_rgba_colormap (gdkscreen);
- if (colormap)
- gtk_widget_set_colormap (_default_decoration.style_window_rgba, colormap);
-
- gtk_widget_realize (_default_decoration.style_window_rgba);
-
- gtk_widget_set_size_request (_default_decoration.style_window_rgba, 0, 0);
- gtk_window_move (GTK_WINDOW (_default_decoration.style_window_rgba), -100, -100);
- gtk_widget_show_all (_default_decoration.style_window_rgba);
-
- _default_decoration.pango_context = gtk_widget_create_pango_context (_default_decoration.style_window_rgba);
-
- g_signal_connect_data (_default_decoration.style_window_rgba, "style-set",
- G_CALLBACK (style_changed),
- (gpointer) _default_decoration.pango_context, 0, 0);
-
- _default_decoration.style_window_rgb = gtk_window_new (GTK_WINDOW_POPUP);
-
- colormap = gdk_screen_get_rgb_colormap (gdkscreen);
- if (colormap)
- gtk_widget_set_colormap (_default_decoration.style_window_rgb, colormap);
-
- gtk_widget_realize (_default_decoration.style_window_rgb);
-
- gtk_widget_set_size_request (_default_decoration.style_window_rgb, 0, 0);
- gtk_window_move (GTK_WINDOW (_default_decoration.style_window_rgb), -100, -100);
- gtk_widget_show_all (_default_decoration.style_window_rgb);
-
- g_signal_connect_data (_default_decoration.style_window_rgb, "style-set",
- G_CALLBACK (style_changed),
- (gpointer) _default_decoration.pango_context, 0, 0);
-
- update_style (_default_decoration.style_window_rgba);
- update_style (_default_decoration.style_window_rgb);
}
int
diff --git a/gtk/window-decorator/gtk-window-decorator.h b/gtk/window-decorator/gtk-window-decorator.h
index 76c6b61..ed792e1 100644
--- a/gtk/window-decorator/gtk-window-decorator.h
+++ b/gtk/window-decorator/gtk-window-decorator.h
@@ -343,7 +343,8 @@ typedef enum _decor_frame_type {
DECOR_FRAME_TYPE_MENU = 2,
DECOR_FRAME_TYPE_UTILITY = 3,
DECOR_FRAME_TYPE_SWITCHER = 4,
- DECOR_FRAME_TYPE_UNDECORATED = 5
+ DECOR_FRAME_TYPE_UNDECORATED = 5,
+ DECOR_FRAME_TYPE_DEFAULT = 6
} decor_frame_type;
typedef struct _decor_frame {
@@ -466,10 +467,9 @@ extern XRenderPictFormat *xformat_rgb;
extern Atom compiz_shadow_info_atom;
extern Atom compiz_shadow_color_atom;
-#define NUM_DECOR_FRAMES 6
+#define NUM_DECOR_FRAMES 7
extern decor_frame_t decor_frames[NUM_DECOR_FRAMES];
-extern decor_frame_t _default_decoration;
/* gtk-window-decorator.c */
diff --git a/gtk/window-decorator/metacity.c b/gtk/window-decorator/metacity.c
index c3221a2..c50754d 100644
--- a/gtk/window-decorator/metacity.c
+++ b/gtk/window-decorator/metacity.c
@@ -1640,7 +1640,7 @@ meta_update_border_extents ()
&left_width,
&right_width);
- decor_frames[d_frame_type].win_extents.top = _default_decoration.win_extents.top;
+ decor_frames[d_frame_type].win_extents.top = decor_frames[DECOR_FRAME_TYPE_DEFAULT].win_extents.top;
decor_frames[d_frame_type].win_extents.bottom = bottom_height;
decor_frames[d_frame_type].win_extents.left = left_width;
decor_frames[d_frame_type].win_extents.right = right_width;
@@ -1656,7 +1656,7 @@ meta_update_border_extents ()
&left_width,
&right_width);
- decor_frames[d_frame_type].max_win_extents.top = _default_decoration.win_extents.top;
+ decor_frames[d_frame_type].max_win_extents.top = decor_frames[DECOR_FRAME_TYPE_DEFAULT].win_extents.top;
decor_frames[d_frame_type].max_win_extents.bottom = bottom_height;
decor_frames[d_frame_type].max_win_extents.left = left_width;
decor_frames[d_frame_type].max_win_extents.right = right_width;