diff --git a/compiz_0001-Fix-build-against-marco-1.23.patch b/compiz_0001-Fix-build-against-marco-1.23.patch new file mode 100644 index 0000000..314a686 --- /dev/null +++ b/compiz_0001-Fix-build-against-marco-1.23.patch @@ -0,0 +1,440 @@ +From cc75be2e92b5680d88166145e6cc0b901d2879ca Mon Sep 17 00:00:00 2001 +From: lukefromdc +Date: Thu, 6 Jun 2019 01:02:46 -0400 +Subject: [PATCH 1/6] Fix build against marco 1.23 + +Fix build failure after https://github.com/mate-desktop/marco/commit/c66b32666e48996b97e691ed002f86b6ff18dec5 +--- + gtk-window-decorator/gtk-window-decorator.c | 197 ++++++++++++++------ + 1 file changed, 138 insertions(+), 59 deletions(-) + +diff --git a/gtk-window-decorator/gtk-window-decorator.c b/gtk-window-decorator/gtk-window-decorator.c +index 14cab69f..bc34e964 100644 +--- a/gtk-window-decorator/gtk-window-decorator.c ++++ b/gtk-window-decorator/gtk-window-decorator.c +@@ -1634,7 +1634,7 @@ meta_get_top_border_region (const MetaFrameGeometry *fgeom, + xrect.x = 0; + xrect.y = 0; + xrect.width = width; +- xrect.height = fgeom->top_height; ++ xrect.height = fgeom->height; + + XUnionRectWithRegion (&xrect, border_xregion, border_xregion); + +@@ -1672,7 +1672,7 @@ meta_get_bottom_border_region (const MetaFrameGeometry *fgeom, + w = radius_to_width (bottom_left_radius, i); + + xrect.x = 0; +- xrect.y = fgeom->bottom_height - i - 1; ++ xrect.y = fgeom->height - i - 1; + xrect.width = w; + xrect.height = 1; + +@@ -1687,7 +1687,7 @@ meta_get_bottom_border_region (const MetaFrameGeometry *fgeom, + w = radius_to_width (bottom_right_radius, i); + + xrect.x = width - w; +- xrect.y = fgeom->bottom_height - i - 1; ++ xrect.y = fgeom->height - i - 1; + xrect.width = w; + xrect.height = 1; + +@@ -1700,7 +1700,7 @@ meta_get_bottom_border_region (const MetaFrameGeometry *fgeom, + xrect.x = 0; + xrect.y = 0; + xrect.width = width; +- xrect.height = fgeom->bottom_height; ++ xrect.height = fgeom->height; + + XUnionRectWithRegion (&xrect, border_xregion, border_xregion); + +@@ -1722,8 +1722,8 @@ meta_get_left_border_region (const MetaFrameGeometry *fgeom, + + xrect.x = 0; + xrect.y = 0; +- xrect.width = fgeom->left_width; +- xrect.height = height - fgeom->top_height - fgeom->bottom_height; ++ xrect.width = fgeom->borders.total.left; ++ xrect.height = fgeom->height - fgeom->borders.total.top - fgeom->borders.total.bottom; + + XUnionRectWithRegion (&xrect, border_xregion, border_xregion); + +@@ -1741,8 +1741,8 @@ meta_get_right_border_region (const MetaFrameGeometry *fgeom, + + xrect.x = 0; + xrect.y = 0; +- xrect.width = fgeom->right_width; +- xrect.height = height - fgeom->top_height - fgeom->bottom_height; ++ xrect.width = fgeom->borders.total.right; ++ xrect.height = fgeom->height - fgeom->borders.total.top - fgeom->borders.total.bottom; + + XUnionRectWithRegion (&xrect, border_xregion, border_xregion); + +@@ -1858,6 +1858,9 @@ meta_get_decoration_geometry (decor_t *d, + MetaButtonLayout *button_layout, + GdkRectangle *clip) + { ++/*#ifdef HAVE_MARCO_3_23_0 */ ++ MetaFrameBorders borders; ++/*#endif */ + gint left_width, right_width, top_height, bottom_height; + + if (meta_button_layout_set) +@@ -1931,7 +1934,18 @@ meta_get_decoration_geometry (decor_t *d, + + if (d->state & WNCK_WINDOW_STATE_ABOVE) + *flags |= META_FRAME_ABOVE; +- ++/*#ifdef HAVE_MARCO_1_22_0*/ ++ meta_theme_get_frame_borders (theme, ++ META_FRAME_TYPE_NORMAL, ++ text_height, ++ *flags, ++ &borders); ++ ++ top_height = borders.total.top; ++ bottom_height = borders.total.bottom; ++ left_width = borders.total.left; ++ right_width = borders.total.right; ++/* + meta_theme_get_frame_borders (theme, + META_FRAME_TYPE_NORMAL, + text_height, +@@ -1940,7 +1954,7 @@ meta_get_decoration_geometry (decor_t *d, + &bottom_height, + &left_width, + &right_width); +- ++/*#endif*/ + clip->x = d->context->left_space - left_width; + clip->y = d->context->top_space - top_height; + +@@ -2097,8 +2111,13 @@ meta_draw_window_decoration (decor_t *d) + + cairo_paint (cr); + ++/*#ifdef HAVE_MARCO_1_22_0*/ ++ meta_theme_draw_frame (theme, ++ context, ++/*else + meta_theme_draw_frame (theme, + style_window, ++ *endif*/ + #if GTK_CHECK_VERSION (3, 0, 0) + cr, + #else +@@ -2108,8 +2127,8 @@ meta_draw_window_decoration (decor_t *d) + #endif + META_FRAME_TYPE_NORMAL, + flags, +- clip.width - fgeom.left_width - fgeom.right_width, +- clip.height - fgeom.top_height - fgeom.bottom_height, ++ fgeom.width - fgeom.borders.total.left - fgeom.borders.total.right, ++ fgeom.height - fgeom.borders.total.top - fgeom.borders.total.bottom, + d->layout, + text_height, + &button_layout, +@@ -2117,14 +2136,15 @@ meta_draw_window_decoration (decor_t *d) + d->icon_pixbuf, + NULL); + +- if (fgeom.top_height) ++ if (fgeom.borders.visible.top) + { + top_region = meta_get_top_border_region (&fgeom, clip.width); + + decor_blend_border_picture (xdisplay, + d->context, + src, +- 0, 0, ++ fgeom.borders.invisible.left, ++ fgeom.borders.invisible.top, + d->picture, + &d->border_layout, + BORDER_TOP, +@@ -2134,14 +2154,15 @@ meta_draw_window_decoration (decor_t *d) + 0); + } + +- if (fgeom.bottom_height) ++ if (fgeom.borders.visible.bottom ) + { + bottom_region = meta_get_bottom_border_region (&fgeom, clip.width); + + decor_blend_border_picture (xdisplay, + d->context, + src, +- 0, clip.height - fgeom.bottom_height, ++ fgeom.borders.invisible.left, ++ fgeom.height - fgeom.borders.total.bottom, + d->picture, + &d->border_layout, + BORDER_BOTTOM, +@@ -2151,14 +2172,15 @@ meta_draw_window_decoration (decor_t *d) + 0); + } + +- if (fgeom.left_width) ++ if (fgeom.borders.visible.left) + { + left_region = meta_get_left_border_region (&fgeom, clip.height); + + decor_blend_border_picture (xdisplay, + d->context, + src, +- 0, fgeom.top_height, ++ fgeom.borders.invisible.left, ++ fgeom.borders.total.top, + d->picture, + &d->border_layout, + BORDER_LEFT, +@@ -2168,14 +2190,15 @@ meta_draw_window_decoration (decor_t *d) + 0); + } + +- if (fgeom.right_width) ++ if (fgeom.borders.visible.right) + { + right_region = meta_get_right_border_region (&fgeom, clip.height); + + decor_blend_border_picture (xdisplay, + d->context, + src, +- clip.width - fgeom.right_width, fgeom.top_height, ++ fgeom.width - fgeom.borders.total.right, ++ fgeom.borders.total.top, + d->picture, + &d->border_layout, + BORDER_RIGHT, +@@ -2202,11 +2225,11 @@ meta_draw_window_decoration (decor_t *d) + { + /* translate from frame to client window space */ + if (top_region) +- XOffsetRegion (top_region, -fgeom.left_width, -fgeom.top_height); ++ XOffsetRegion (top_region, -fgeom.borders.total.left, -fgeom.borders.total.top); + if (bottom_region) +- XOffsetRegion (bottom_region, -fgeom.left_width, 0); ++ XOffsetRegion (bottom_region, -fgeom.borders.total.left, 0); + if (left_region) +- XOffsetRegion (left_region, -fgeom.left_width, 0); ++ XOffsetRegion (left_region, -fgeom.borders.total.left, 0); + + decor_update_meta_window_property (d, theme, flags, + top_region, +@@ -2957,6 +2980,10 @@ meta_get_event_window_position (decor_t *d, + MetaButtonLayout button_layout; + MetaFrameGeometry fgeom; + MetaFrameFlags flags; ++ GtkBorder visible; ++ GtkBorder resize; ++ GtkBorder total; ++ gint top_border; + MetaTheme *theme; + GdkRectangle clip; + +@@ -2965,56 +2992,73 @@ meta_get_event_window_position (decor_t *d, + meta_get_decoration_geometry (d, theme, &flags, &fgeom, &button_layout, + &clip); + +- width += fgeom.right_width + fgeom.left_width; +- height += fgeom.top_height + fgeom.bottom_height; ++ visible = fgeom.borders.visible; ++ resize = fgeom.borders.total; ++ ++ /* When shadow borders are added, we will no longer be able to use ++ * `fgeom->borders.total` border here - it includes also ++ * `shadow` border, but it is not included in frame extents! Create new ++ * `total` border that includes only `visible` border and `resize` border. ++ */ ++ total.left = visible.left + resize.left; ++ total.right = visible.right + resize.right; ++ total.top = visible.top + resize.top; ++ total.bottom = visible.bottom + resize.bottom; ++ ++ ++ /* Taken from compiz 0.9, cannot be used in this function ++ * but not declaring these causes a segfault due to return values ++ */ ++ width += total.left + total.right; ++ height += total.top + total.bottom; ++ ++ top_border = fgeom.title_rect.y - fgeom.borders.invisible.top; ++ + + switch (i) { + case 2: /* bottom */ + switch (j) { + case 2: /* bottom right */ +- *x = width - fgeom.right_width - RESIZE_EXTENDS; +- *y = height - fgeom.bottom_height - RESIZE_EXTENDS; +- *w = fgeom.right_width + RESIZE_EXTENDS; +- *h = fgeom.bottom_height + RESIZE_EXTENDS; ++ *x = fgeom.width - resize.right - RESIZE_EXTENDS; ++ *y = fgeom.height - resize.bottom - RESIZE_EXTENDS; ++ *w = resize.right + RESIZE_EXTENDS; ++ *h = resize.bottom + RESIZE_EXTENDS; + break; + case 1: /* bottom */ +- *x = fgeom.left_width + RESIZE_EXTENDS; +- *y = height - fgeom.bottom_height; +- *w = width - fgeom.left_width - fgeom.right_width - +- (2 * RESIZE_EXTENDS); +- *h = fgeom.bottom_height; ++ *x = resize.left + RESIZE_EXTENDS; ++ *y = fgeom.height - resize.bottom - RESIZE_EXTENDS; ++ *w = fgeom.width - resize.left - resize.right - (2 * RESIZE_EXTENDS); ++ *h = resize.bottom; + break; + case 0: /* bottom left */ + default: + *x = 0; +- *y = height - fgeom.bottom_height - RESIZE_EXTENDS; +- *w = fgeom.left_width + RESIZE_EXTENDS; +- *h = fgeom.bottom_height + RESIZE_EXTENDS; ++ *y = fgeom.height - resize.bottom - RESIZE_EXTENDS; ++ *w = resize.left + RESIZE_EXTENDS; ++ *h = resize.bottom + RESIZE_EXTENDS; + break; + } + break; + case 1: /* middle */ + switch (j) { + case 2: /* right */ +- *x = width - fgeom.right_width; +- *y = fgeom.top_height + RESIZE_EXTENDS; +- *w = fgeom.right_width; +- *h = height - fgeom.top_height - fgeom.bottom_height - +- (2 * RESIZE_EXTENDS); ++ *x = fgeom.width - resize.right - RESIZE_EXTENDS; ++ *y = resize.top + top_border + RESIZE_EXTENDS; ++ *w = resize.right + RESIZE_EXTENDS; ++ *h = fgeom.height - resize.top - top_border - resize.bottom - (2 * RESIZE_EXTENDS); + break; + case 1: /* middle */ +- *x = fgeom.left_width; ++ *x = total.left; + *y = fgeom.title_rect.y + TOP_RESIZE_HEIGHT; +- *w = width - fgeom.left_width - fgeom.right_width; +- *h = height - fgeom.top_titlebar_edge - fgeom.bottom_height; ++ *w = fgeom.width - resize.left - resize.right; ++ *h = visible.top - top_border - TOP_RESIZE_HEIGHT; + break; + case 0: /* left */ + default: + *x = 0; +- *y = fgeom.top_height + RESIZE_EXTENDS; +- *w = fgeom.left_width; +- *h = height - fgeom.top_height - fgeom.bottom_height - +- (2 * RESIZE_EXTENDS); ++ *y = resize.top + top_border + RESIZE_EXTENDS; ++ *w = resize.left; ++ *h = fgeom.height - resize.top - top_border - resize.bottom - (2 * RESIZE_EXTENDS); + break; + } + break; +@@ -3022,24 +3066,23 @@ meta_get_event_window_position (decor_t *d, + default: + switch (j) { + case 2: /* top right */ +- *x = width - fgeom.right_width - RESIZE_EXTENDS; ++ *x = fgeom.width - resize.right - RESIZE_EXTENDS; + *y = 0; +- *w = fgeom.right_width + RESIZE_EXTENDS; +- *h = fgeom.top_height + RESIZE_EXTENDS; ++ *w = total.right + RESIZE_EXTENDS; ++ *h = resize.top + top_border + RESIZE_EXTENDS; + break; + case 1: /* top */ +- *x = fgeom.left_width + RESIZE_EXTENDS; ++ *x = resize.left + RESIZE_EXTENDS; + *y = 0; +- *w = width - fgeom.left_width - fgeom.right_width - +- (2 * RESIZE_EXTENDS); +- *h = fgeom.title_rect.y + TOP_RESIZE_HEIGHT; ++ *w = fgeom.width - total.left - total.right - (2 * RESIZE_EXTENDS); ++ *h = resize.top + top_border + TOP_RESIZE_HEIGHT; + break; + case 0: /* top left */ + default: + *x = 0; + *y = 0; +- *w = fgeom.left_width + RESIZE_EXTENDS; +- *h = fgeom.top_height + RESIZE_EXTENDS; ++ *w = total.left + RESIZE_EXTENDS; ++ *h = resize.top + top_border + RESIZE_EXTENDS; + break; + } + } +@@ -3057,6 +3100,8 @@ meta_get_event_window_position (decor_t *d, + if (j == 0 || j == 2) + *w = *h = 0; + } ++#undef TOP_RESIZE_HEIGHT ++#undef RESIZE_EXTENDS + } + + static gboolean +@@ -6248,10 +6293,28 @@ static void + meta_update_border_extents (gint text_height) + { + MetaTheme *theme; ++/*#ifdef HAVE_MARCO_1_22_0 */ ++ MetaFrameBorders borders; ++/*#else + gint top_height, bottom_height, left_width, right_width; +- ++ #endif*/ + theme = meta_theme_get_current (); ++/*#ifdef HAVE_MARCO_1_22_0 */ ++ meta_theme_get_frame_borders (theme, ++ META_FRAME_TYPE_NORMAL, ++ text_height, ++ 0, ++ &borders); ++ ++ _win_extents.top = borders.visible.top; ++ _win_extents.bottom = borders.visible.bottom; ++ _win_extents.left = borders.visible.left; ++ _win_extents.right = borders.visible.right; ++ ++ titlebar_height = borders.visible.top - _win_extents.top; + ++/*#else*/ ++/* + meta_theme_get_frame_borders (theme, + META_FRAME_TYPE_NORMAL, + text_height, +@@ -6267,7 +6330,22 @@ meta_update_border_extents (gint text_height) + _win_extents.right = right_width; + + titlebar_height = top_height - _win_extents.top; ++#endif*/ ++/*#ifdef HAVE_MARCO_1_22_0 */ ++ meta_theme_get_frame_borders (theme, ++ META_FRAME_TYPE_NORMAL, ++ text_height, ++ META_FRAME_MAXIMIZED, ++ &borders); ++ ++ _max_win_extents.top = borders.visible.top; ++ _max_win_extents.bottom = borders.visible.bottom; ++ _max_win_extents.left = borders.visible.left; ++ _max_win_extents.right = borders.visible.right; ++ ++ max_titlebar_height = borders.visible.top - _max_win_extents.top; + ++/*#else + meta_theme_get_frame_borders (theme, + META_FRAME_TYPE_NORMAL, + text_height, +@@ -6283,6 +6361,7 @@ meta_update_border_extents (gint text_height) + _max_win_extents.right = right_width; + + max_titlebar_height = top_height - _max_win_extents.top; ++*/ + } + #endif + +-- +2.21.0 + diff --git a/compiz_0002-gtk-window-decorator-allow-building-against-older-ve.patch b/compiz_0002-gtk-window-decorator-allow-building-against-older-ve.patch new file mode 100644 index 0000000..10f3df0 --- /dev/null +++ b/compiz_0002-gtk-window-decorator-allow-building-against-older-ve.patch @@ -0,0 +1,497 @@ +From bd67e0807d9ac74b725d5d7a39dc978a098eba4d Mon Sep 17 00:00:00 2001 +From: lukefromdc +Date: Tue, 11 Jun 2019 00:49:11 -0400 +Subject: [PATCH 2/6] gtk-window-decorator: allow building against older + versions of marco + +Autodetect marco 1.23 or later, build against the correct version +--- + configure.ac | 15 ++ + gtk-window-decorator/gtk-window-decorator.c | 200 +++++++++++++++++--- + 2 files changed, 190 insertions(+), 25 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 08ecba7d..d7f5e85b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -384,6 +384,14 @@ else + use_marco="no" + fi + ++# Check if we are building against marco 1.23.1 or later ++if test "x$use_marco" = "xyes"; then ++ PKG_CHECK_EXISTS(libmarco-private >= 1.23.1, ++ [have_marco_1_23_1=yes], [have_marco_1_23_1=no]) ++else ++ have_marco_1_23_1="no" ++fi ++ + if test "x$use_gtk" = "xyes"; then + if test "x$use_gsettings" = "xyes"; then + PKG_CHECK_MODULES(GSETTINGS, [glib-2.0 >= 2.32 gio-2.0 >= 2.25.0]) +@@ -410,6 +418,12 @@ if test "$use_marco" = yes; then + AC_DEFINE(USE_MARCO, 1, [Build marco theme support]) + fi + ++AM_CONDITIONAL(HAVE_MARCO_1_23_1, test "x$have_marco_1_23_1" = "xyes") ++if test "$have_marco_1_23_1" = yes; then ++ AC_DEFINE(HAVE_MARCO_1_23_1, 1, ++ [Build against marco 1.23.1 o later]) ++fi ++ + AM_CONDITIONAL(USE_MATE, test "x$use_mate" = "xyes") + if test "$use_mate" = yes; then + AC_DEFINE(USE_MATE, 1, [Build basic mate compatibility]) +@@ -499,6 +513,7 @@ echo "and the following optional features will be used:" + echo "and the following optional features will be used:" + echo " gtk: $use_gtk ($with_gtk)" + echo " marco: $use_marco" ++echo " marco >=1.23.1 support: $have_marco_1_23_1" + echo " gwd gsettings support: $use_gsettings" + echo " desktop menu entries: $use_menu_entries" + echo "" +diff --git a/gtk-window-decorator/gtk-window-decorator.c b/gtk-window-decorator/gtk-window-decorator.c +index bc34e964..1b8979cf 100644 +--- a/gtk-window-decorator/gtk-window-decorator.c ++++ b/gtk-window-decorator/gtk-window-decorator.c +@@ -1634,8 +1634,11 @@ meta_get_top_border_region (const MetaFrameGeometry *fgeom, + xrect.x = 0; + xrect.y = 0; + xrect.width = width; ++#ifdef HAVE_MARCO_1_23_1 + xrect.height = fgeom->height; +- ++#else ++ xrect.height = fgeom->top_height; ++#endif + XUnionRectWithRegion (&xrect, border_xregion, border_xregion); + + XSubtractRegion (border_xregion, corners_xregion, border_xregion); +@@ -1672,7 +1675,11 @@ meta_get_bottom_border_region (const MetaFrameGeometry *fgeom, + w = radius_to_width (bottom_left_radius, i); + + xrect.x = 0; ++#ifdef HAVE_MARCO_1_23_1 + xrect.y = fgeom->height - i - 1; ++#else ++ xrect.y = fgeom->bottom_height - i - 1; ++#endif + xrect.width = w; + xrect.height = 1; + +@@ -1687,7 +1694,11 @@ meta_get_bottom_border_region (const MetaFrameGeometry *fgeom, + w = radius_to_width (bottom_right_radius, i); + + xrect.x = width - w; ++#ifdef HAVE_MARCO_1_23_1 + xrect.y = fgeom->height - i - 1; ++#else ++ xrect.y = fgeom->bottom_height - i - 1; ++#endif + xrect.width = w; + xrect.height = 1; + +@@ -1700,7 +1711,11 @@ meta_get_bottom_border_region (const MetaFrameGeometry *fgeom, + xrect.x = 0; + xrect.y = 0; + xrect.width = width; ++#ifdef HAVE_MARCO_1_23_1 + xrect.height = fgeom->height; ++#else ++ xrect.height = fgeom->bottom_height; ++#endif + + XUnionRectWithRegion (&xrect, border_xregion, border_xregion); + +@@ -1722,9 +1737,13 @@ meta_get_left_border_region (const MetaFrameGeometry *fgeom, + + xrect.x = 0; + xrect.y = 0; ++#ifdef HAVE_MARCO_1_23_1 + xrect.width = fgeom->borders.total.left; + xrect.height = fgeom->height - fgeom->borders.total.top - fgeom->borders.total.bottom; +- ++#else ++ xrect.width = fgeom->left_width; ++ xrect.height = height - fgeom->top_height - fgeom->bottom_height; ++#endif + XUnionRectWithRegion (&xrect, border_xregion, border_xregion); + + return border_xregion; +@@ -1741,8 +1760,13 @@ meta_get_right_border_region (const MetaFrameGeometry *fgeom, + + xrect.x = 0; + xrect.y = 0; ++#ifdef HAVE_MARCO_1_23_1 + xrect.width = fgeom->borders.total.right; + xrect.height = fgeom->height - fgeom->borders.total.top - fgeom->borders.total.bottom; ++#else ++ xrect.width = fgeom->right_width; ++ xrect.height = height - fgeom->top_height - fgeom->bottom_height; ++#endif + + XUnionRectWithRegion (&xrect, border_xregion, border_xregion); + +@@ -1858,9 +1882,9 @@ meta_get_decoration_geometry (decor_t *d, + MetaButtonLayout *button_layout, + GdkRectangle *clip) + { +-/*#ifdef HAVE_MARCO_3_23_0 */ ++#ifdef HAVE_MARCO_1_23_1 + MetaFrameBorders borders; +-/*#endif */ ++#endif + gint left_width, right_width, top_height, bottom_height; + + if (meta_button_layout_set) +@@ -1934,7 +1958,7 @@ meta_get_decoration_geometry (decor_t *d, + + if (d->state & WNCK_WINDOW_STATE_ABOVE) + *flags |= META_FRAME_ABOVE; +-/*#ifdef HAVE_MARCO_1_22_0*/ ++#ifdef HAVE_MARCO_1_23_1 + meta_theme_get_frame_borders (theme, + META_FRAME_TYPE_NORMAL, + text_height, +@@ -1945,7 +1969,7 @@ meta_get_decoration_geometry (decor_t *d, + bottom_height = borders.total.bottom; + left_width = borders.total.left; + right_width = borders.total.right; +-/* ++#else + meta_theme_get_frame_borders (theme, + META_FRAME_TYPE_NORMAL, + text_height, +@@ -1954,7 +1978,7 @@ meta_get_decoration_geometry (decor_t *d, + &bottom_height, + &left_width, + &right_width); +-/*#endif*/ ++#endif + clip->x = d->context->left_space - left_width; + clip->y = d->context->top_space - top_height; + +@@ -2111,13 +2135,14 @@ meta_draw_window_decoration (decor_t *d) + + cairo_paint (cr); + +-/*#ifdef HAVE_MARCO_1_22_0*/ ++#ifdef HAVE_MARCO_1_23_1 + meta_theme_draw_frame (theme, + context, +-/*else ++#else + meta_theme_draw_frame (theme, + style_window, +- *endif*/ ++#endif ++ + #if GTK_CHECK_VERSION (3, 0, 0) + cr, + #else +@@ -2127,24 +2152,36 @@ meta_draw_window_decoration (decor_t *d) + #endif + META_FRAME_TYPE_NORMAL, + flags, ++#ifdef HAVE_MARCO_1_23_1 + fgeom.width - fgeom.borders.total.left - fgeom.borders.total.right, + fgeom.height - fgeom.borders.total.top - fgeom.borders.total.bottom, ++#else ++ clip.width - fgeom.left_width - fgeom.right_width, ++ clip.height - fgeom.top_height - fgeom.bottom_height, ++#endif + d->layout, + text_height, + &button_layout, + button_states, + d->icon_pixbuf, + NULL); +- ++#ifdef HAVE_MARCO_1_23_1 + if (fgeom.borders.visible.top) ++#else ++ if (fgeom.top_height) ++#endif + { + top_region = meta_get_top_border_region (&fgeom, clip.width); + + decor_blend_border_picture (xdisplay, + d->context, + src, ++#ifdef HAVE_MARCO_1_23_1 + fgeom.borders.invisible.left, + fgeom.borders.invisible.top, ++#else ++ 0, 0, ++#endif + d->picture, + &d->border_layout, + BORDER_TOP, +@@ -2153,16 +2190,23 @@ meta_draw_window_decoration (decor_t *d) + shade_alpha, + 0); + } +- ++#ifdef HAVE_MARCO_1_23_1 + if (fgeom.borders.visible.bottom ) ++#else ++ if (fgeom.bottom_height) ++#endif + { + bottom_region = meta_get_bottom_border_region (&fgeom, clip.width); + + decor_blend_border_picture (xdisplay, + d->context, + src, ++#ifdef HAVE_MARCO_1_23_1 + fgeom.borders.invisible.left, + fgeom.height - fgeom.borders.total.bottom, ++#else ++ 0, clip.height - fgeom.bottom_height, ++#endif + d->picture, + &d->border_layout, + BORDER_BOTTOM, +@@ -2171,16 +2215,23 @@ meta_draw_window_decoration (decor_t *d) + shade_alpha, + 0); + } +- ++#ifdef HAVE_MARCO_1_23_1 + if (fgeom.borders.visible.left) ++#else ++ if (fgeom.left_width) ++#endif + { + left_region = meta_get_left_border_region (&fgeom, clip.height); + + decor_blend_border_picture (xdisplay, + d->context, + src, ++#ifdef HAVE_MARCO_1_23_1 + fgeom.borders.invisible.left, + fgeom.borders.total.top, ++#else ++ 0, fgeom.top_height, ++#endif + d->picture, + &d->border_layout, + BORDER_LEFT, +@@ -2189,16 +2240,23 @@ meta_draw_window_decoration (decor_t *d) + shade_alpha, + 0); + } +- ++#ifdef HAVE_MARCO_1_23_1 + if (fgeom.borders.visible.right) ++#else ++ if (fgeom.right_width) ++#endif + { + right_region = meta_get_right_border_region (&fgeom, clip.height); + + decor_blend_border_picture (xdisplay, + d->context, + src, ++#ifdef HAVE_MARCO_1_23_1 + fgeom.width - fgeom.borders.total.right, + fgeom.borders.total.top, ++#else ++ clip.width - fgeom.right_width, fgeom.top_height, ++#endif + d->picture, + &d->border_layout, + BORDER_RIGHT, +@@ -2224,12 +2282,21 @@ meta_draw_window_decoration (decor_t *d) + if (d->prop_xid) + { + /* translate from frame to client window space */ ++#ifdef HAVE_MARCO_1_23_1 + if (top_region) + XOffsetRegion (top_region, -fgeom.borders.total.left, -fgeom.borders.total.top); + if (bottom_region) + XOffsetRegion (bottom_region, -fgeom.borders.total.left, 0); + if (left_region) + XOffsetRegion (left_region, -fgeom.borders.total.left, 0); ++#else ++ if (top_region) ++ XOffsetRegion (top_region, -fgeom.left_width, -fgeom.top_height); ++ if (bottom_region) ++ XOffsetRegion (bottom_region, -fgeom.left_width, 0); ++ if (left_region) ++ XOffsetRegion (left_region, -fgeom.left_width, 0); ++#endif + + decor_update_meta_window_property (d, theme, flags, + top_region, +@@ -2980,10 +3047,12 @@ meta_get_event_window_position (decor_t *d, + MetaButtonLayout button_layout; + MetaFrameGeometry fgeom; + MetaFrameFlags flags; ++#ifdef HAVE_MARCO_1_23_1 + GtkBorder visible; + GtkBorder resize; + GtkBorder total; + gint top_border; ++#endif + MetaTheme *theme; + GdkRectangle clip; + +@@ -2991,7 +3060,7 @@ meta_get_event_window_position (decor_t *d, + + meta_get_decoration_geometry (d, theme, &flags, &fgeom, &button_layout, + &clip); +- ++#ifdef HAVE_MARCO_1_23_1 + visible = fgeom.borders.visible; + resize = fgeom.borders.total; + +@@ -3102,6 +3171,86 @@ meta_get_event_window_position (decor_t *d, + } + #undef TOP_RESIZE_HEIGHT + #undef RESIZE_EXTENDS ++#else ++ width += fgeom.right_width + fgeom.left_width; ++ height += fgeom.top_height + fgeom.bottom_height; ++ ++ switch (i) { ++ case 2: /* bottom */ ++ switch (j) { ++ case 2: /* bottom right */ ++ *x = width - fgeom.right_width - RESIZE_EXTENDS; ++ *y = height - fgeom.bottom_height - RESIZE_EXTENDS; ++ *w = fgeom.right_width + RESIZE_EXTENDS; ++ *h = fgeom.bottom_height + RESIZE_EXTENDS; ++ break; ++ case 1: /* bottom */ ++ *x = fgeom.left_width + RESIZE_EXTENDS; ++ *y = height - fgeom.bottom_height; ++ *w = width - fgeom.left_width - fgeom.right_width - ++ (2 * RESIZE_EXTENDS); ++ *h = fgeom.bottom_height; ++ break; ++ case 0: /* bottom left */ ++ default: ++ *x = 0; ++ *y = height - fgeom.bottom_height - RESIZE_EXTENDS; ++ *w = fgeom.left_width + RESIZE_EXTENDS; ++ *h = fgeom.bottom_height + RESIZE_EXTENDS; ++ break; ++ } ++ break; ++ case 1: /* middle */ ++ switch (j) { ++ case 2: /* right */ ++ *x = width - fgeom.right_width; ++ *y = fgeom.top_height + RESIZE_EXTENDS; ++ *w = fgeom.right_width; ++ *h = height - fgeom.top_height - fgeom.bottom_height - ++ (2 * RESIZE_EXTENDS); ++ break; ++ case 1: /* middle */ ++ *x = fgeom.left_width; ++ *y = fgeom.title_rect.y + TOP_RESIZE_HEIGHT; ++ *w = width - fgeom.left_width - fgeom.right_width; ++ *h = height - fgeom.top_titlebar_edge - fgeom.bottom_height; ++ break; ++ case 0: /* left */ ++ default: ++ *x = 0; ++ *y = fgeom.top_height + RESIZE_EXTENDS; ++ *w = fgeom.left_width; ++ *h = height - fgeom.top_height - fgeom.bottom_height - ++ (2 * RESIZE_EXTENDS); ++ break; ++ } ++ break; ++ case 0: /* top */ ++ default: ++ switch (j) { ++ case 2: /* top right */ ++ *x = width - fgeom.right_width - RESIZE_EXTENDS; ++ *y = 0; ++ *w = fgeom.right_width + RESIZE_EXTENDS; ++ *h = fgeom.top_height + RESIZE_EXTENDS; ++ break; ++ case 1: /* top */ ++ *x = fgeom.left_width + RESIZE_EXTENDS; ++ *y = 0; ++ *w = width - fgeom.left_width - fgeom.right_width - ++ (2 * RESIZE_EXTENDS); ++ *h = fgeom.title_rect.y + TOP_RESIZE_HEIGHT; ++ break; ++ case 0: /* top left */ ++ default: ++ *x = 0; ++ *y = 0; ++ *w = fgeom.left_width + RESIZE_EXTENDS; ++ *h = fgeom.top_height + RESIZE_EXTENDS; ++ break; ++ } ++ } ++#endif + } + + static gboolean +@@ -6293,13 +6442,14 @@ static void + meta_update_border_extents (gint text_height) + { + MetaTheme *theme; +-/*#ifdef HAVE_MARCO_1_22_0 */ ++#ifdef HAVE_MARCO_1_23_1 + MetaFrameBorders borders; +-/*#else ++#else + gint top_height, bottom_height, left_width, right_width; +- #endif*/ ++#endif + theme = meta_theme_get_current (); +-/*#ifdef HAVE_MARCO_1_22_0 */ ++ ++#ifdef HAVE_MARCO_1_23_1 + meta_theme_get_frame_borders (theme, + META_FRAME_TYPE_NORMAL, + text_height, +@@ -6313,8 +6463,7 @@ meta_update_border_extents (gint text_height) + + titlebar_height = borders.visible.top - _win_extents.top; + +-/*#else*/ +-/* ++#else + meta_theme_get_frame_borders (theme, + META_FRAME_TYPE_NORMAL, + text_height, +@@ -6330,8 +6479,9 @@ meta_update_border_extents (gint text_height) + _win_extents.right = right_width; + + titlebar_height = top_height - _win_extents.top; +-#endif*/ +-/*#ifdef HAVE_MARCO_1_22_0 */ ++#endif ++ ++#ifdef HAVE_MARCO_1_23_1 + meta_theme_get_frame_borders (theme, + META_FRAME_TYPE_NORMAL, + text_height, +@@ -6345,7 +6495,7 @@ meta_update_border_extents (gint text_height) + + max_titlebar_height = borders.visible.top - _max_win_extents.top; + +-/*#else ++#else + meta_theme_get_frame_borders (theme, + META_FRAME_TYPE_NORMAL, + text_height, +@@ -6361,7 +6511,7 @@ meta_update_border_extents (gint text_height) + _max_win_extents.right = right_width; + + max_titlebar_height = top_height - _max_win_extents.top; +-*/ ++#endif + } + #endif + +-- +2.21.0 + diff --git a/compiz_0003-gtk-window-decorator-fix-button-clickable-area-offse.patch b/compiz_0003-gtk-window-decorator-fix-button-clickable-area-offse.patch new file mode 100644 index 0000000..0308e2e --- /dev/null +++ b/compiz_0003-gtk-window-decorator-fix-button-clickable-area-offse.patch @@ -0,0 +1,31 @@ +From c272018a97ad3f5dee8e627463d787c19f7f16a3 Mon Sep 17 00:00:00 2001 +From: lukefromdc +Date: Tue, 11 Jun 2019 02:38:52 -0400 +Subject: [PATCH 3/6] gtk-window-decorator: fix button clickable area offset + +--- + gtk-window-decorator/gtk-window-decorator.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/gtk-window-decorator/gtk-window-decorator.c b/gtk-window-decorator/gtk-window-decorator.c +index 1b8979cf..a45de9ee 100644 +--- a/gtk-window-decorator/gtk-window-decorator.c ++++ b/gtk-window-decorator/gtk-window-decorator.c +@@ -3374,7 +3374,13 @@ meta_get_button_position (decor_t *d, + *y = space->clickable.y; + *w = space->clickable.width; + *h = space->clickable.height; +- ++#ifdef HAVE_MARCO_1_23_1 ++ /*compensate for offset caused by invisible borders ++ *taken straight from compiz 0.9 ++ */ ++ *x = *x - fgeom.borders.invisible.left; ++ *y = *y - fgeom.borders.invisible.top; ++#endif + return TRUE; + } + +-- +2.21.0 + diff --git a/compiz_0004-gtk-window-decorator-fix-ugly-top-right-corner.patch b/compiz_0004-gtk-window-decorator-fix-ugly-top-right-corner.patch new file mode 100644 index 0000000..ee3cb06 --- /dev/null +++ b/compiz_0004-gtk-window-decorator-fix-ugly-top-right-corner.patch @@ -0,0 +1,30 @@ +From d2b578558d9a830f6f5de773c5e099a84258f8a9 Mon Sep 17 00:00:00 2001 +From: lukefromdc +Date: Thu, 13 Jun 2019 02:43:28 -0400 +Subject: [PATCH 4/6] gtk-window-decorator: fix ugly top right corner + +--- + gtk-window-decorator/gtk-window-decorator.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/gtk-window-decorator/gtk-window-decorator.c b/gtk-window-decorator/gtk-window-decorator.c +index a45de9ee..6c872486 100644 +--- a/gtk-window-decorator/gtk-window-decorator.c ++++ b/gtk-window-decorator/gtk-window-decorator.c +@@ -1619,8 +1619,12 @@ meta_get_top_border_region (const MetaFrameGeometry *fgeom, + for (i = 0; i < top_right_radius; i++) + { + w = radius_to_width (top_right_radius, i); +- ++#ifdef HAVE_MARCO_1_23_1 ++ xrect.x = width - w - fgeom->borders.invisible.left - ++ fgeom->borders.invisible.right; ++#else + xrect.x = width - w; ++#endif + xrect.y = i; + xrect.width = w; + xrect.height = 1; +-- +2.21.0 + diff --git a/compiz_0005-gtk-window-decorator-use-code-from-compiz-0.9-for-co.patch b/compiz_0005-gtk-window-decorator-use-code-from-compiz-0.9-for-co.patch new file mode 100644 index 0000000..afafa68 --- /dev/null +++ b/compiz_0005-gtk-window-decorator-use-code-from-compiz-0.9-for-co.patch @@ -0,0 +1,218 @@ +From 004d52d9049108ffedb8b276a568cf092a2b0729 Mon Sep 17 00:00:00 2001 +From: lukefromdc +Date: Thu, 13 Jun 2019 16:04:39 -0400 +Subject: [PATCH 5/6] gtk-window-decorator: use code from compiz 0.9 for + corners fix + +This is based on the same code as in compiz 0.9 and may be necessary to support resizing windows from outside the visible borders later. Probably more commits from compiz 0.9 will have to be ported to suppport that feature, and keeping the code as similar as possible now makes that easier. This also avoids passing two unused variables and two that were having to be modified and could more easily just be set inside meta_get_top_border_region and in meta_get_bottom_border_region . +--- + gtk-window-decorator/gtk-window-decorator.c | 69 ++++++++++++++++----- + 1 file changed, 53 insertions(+), 16 deletions(-) + +diff --git a/gtk-window-decorator/gtk-window-decorator.c b/gtk-window-decorator/gtk-window-decorator.c +index 6c872486..a93db39c 100644 +--- a/gtk-window-decorator/gtk-window-decorator.c ++++ b/gtk-window-decorator/gtk-window-decorator.c +@@ -1579,9 +1579,15 @@ radius_to_width (int radius, + return floor (0.5f + r1 - sqrt (r2)); + } + ++ + static Region ++#ifdef HAVE_MARCO_1_23_1 ++meta_get_top_border_region (const MetaFrameGeometry *fgeom) ++#else + meta_get_top_border_region (const MetaFrameGeometry *fgeom, + int width) ++#endif ++ + { + Region corners_xregion, border_xregion; + XRectangle xrect; +@@ -1590,7 +1596,10 @@ meta_get_top_border_region (const MetaFrameGeometry *fgeom, + int bottom_left_radius; + int bottom_right_radius; + int w, i; +- ++#ifdef HAVE_MARCO_1_23_1 ++ int width; ++ int height; ++#endif + corners_xregion = XCreateRegion (); + + meta_get_corner_radius (fgeom, +@@ -1599,6 +1608,11 @@ meta_get_top_border_region (const MetaFrameGeometry *fgeom, + &bottom_left_radius, + &bottom_right_radius); + ++#ifdef HAVE_MARCO_1_23_1 ++ /*We have to define these here with newer marco versions*/ ++ width = fgeom->width - fgeom->borders.invisible.left - fgeom->borders.invisible.right; ++ height = fgeom->borders.visible.top; ++#endif + if (top_left_radius) + { + for (i = 0; i < top_left_radius; i++) +@@ -1619,12 +1633,8 @@ meta_get_top_border_region (const MetaFrameGeometry *fgeom, + for (i = 0; i < top_right_radius; i++) + { + w = radius_to_width (top_right_radius, i); +-#ifdef HAVE_MARCO_1_23_1 +- xrect.x = width - w - fgeom->borders.invisible.left - +- fgeom->borders.invisible.right; +-#else ++ + xrect.x = width - w; +-#endif + xrect.y = i; + xrect.width = w; + xrect.height = 1; +@@ -1653,8 +1663,12 @@ meta_get_top_border_region (const MetaFrameGeometry *fgeom, + } + + static Region ++#ifdef HAVE_MARCO_1_23_1 ++meta_get_bottom_border_region (const MetaFrameGeometry *fgeom) ++#else + meta_get_bottom_border_region (const MetaFrameGeometry *fgeom, + int width) ++#endif + { + Region corners_xregion, border_xregion; + XRectangle xrect; +@@ -1664,6 +1678,11 @@ meta_get_bottom_border_region (const MetaFrameGeometry *fgeom, + int bottom_right_radius; + int w, i; + ++#ifdef HAVE_MARCO_1_23_1 ++ int width; ++ int height; ++#endif ++ + corners_xregion = XCreateRegion (); + + meta_get_corner_radius (fgeom, +@@ -1672,6 +1691,12 @@ meta_get_bottom_border_region (const MetaFrameGeometry *fgeom, + &bottom_left_radius, + &bottom_right_radius); + ++#ifdef HAVE_MARCO_1_23_1 ++ /*We have to define these here with newer marco versions*/ ++ width = fgeom->width - fgeom->borders.invisible.left - fgeom->borders.invisible.right; ++ height = fgeom->borders.visible.top; ++#endif ++ + if (bottom_left_radius) + { + for (i = 0; i < bottom_left_radius; i++) +@@ -1731,8 +1756,12 @@ meta_get_bottom_border_region (const MetaFrameGeometry *fgeom, + } + + static Region ++#ifdef HAVE_MARCO_1_23_1 ++meta_get_left_border_region (const MetaFrameGeometry *fgeom) ++#else + meta_get_left_border_region (const MetaFrameGeometry *fgeom, + int height) ++#endif + { + Region border_xregion; + XRectangle xrect; +@@ -1742,7 +1771,7 @@ meta_get_left_border_region (const MetaFrameGeometry *fgeom, + xrect.x = 0; + xrect.y = 0; + #ifdef HAVE_MARCO_1_23_1 +- xrect.width = fgeom->borders.total.left; ++ xrect.width = fgeom->borders.visible.left; + xrect.height = fgeom->height - fgeom->borders.total.top - fgeom->borders.total.bottom; + #else + xrect.width = fgeom->left_width; +@@ -1754,8 +1783,12 @@ meta_get_left_border_region (const MetaFrameGeometry *fgeom, + } + + static Region ++#ifdef HAVE_MARCO_1_23_1 ++meta_get_right_border_region (const MetaFrameGeometry *fgeom) ++#else + meta_get_right_border_region (const MetaFrameGeometry *fgeom, + int height) ++#endif + { + Region border_xregion; + XRectangle xrect; +@@ -1765,7 +1798,7 @@ meta_get_right_border_region (const MetaFrameGeometry *fgeom, + xrect.x = 0; + xrect.y = 0; + #ifdef HAVE_MARCO_1_23_1 +- xrect.width = fgeom->borders.total.right; ++ xrect.width = fgeom->borders.visible.right; + xrect.height = fgeom->height - fgeom->borders.total.top - fgeom->borders.total.bottom; + #else + xrect.width = fgeom->right_width; +@@ -2171,12 +2204,13 @@ meta_draw_window_decoration (decor_t *d) + NULL); + #ifdef HAVE_MARCO_1_23_1 + if (fgeom.borders.visible.top) ++ { ++ top_region = meta_get_top_border_region (&fgeom); + #else + if (fgeom.top_height) +-#endif + { + top_region = meta_get_top_border_region (&fgeom, clip.width); +- ++#endif + decor_blend_border_picture (xdisplay, + d->context, + src, +@@ -2196,12 +2230,13 @@ meta_draw_window_decoration (decor_t *d) + } + #ifdef HAVE_MARCO_1_23_1 + if (fgeom.borders.visible.bottom ) ++ { ++ bottom_region = meta_get_bottom_border_region (&fgeom); + #else + if (fgeom.bottom_height) +-#endif + { + bottom_region = meta_get_bottom_border_region (&fgeom, clip.width); +- ++#endif + decor_blend_border_picture (xdisplay, + d->context, + src, +@@ -2221,12 +2256,13 @@ meta_draw_window_decoration (decor_t *d) + } + #ifdef HAVE_MARCO_1_23_1 + if (fgeom.borders.visible.left) ++ { ++ left_region = meta_get_left_border_region (&fgeom); + #else + if (fgeom.left_width) +-#endif + { + left_region = meta_get_left_border_region (&fgeom, clip.height); +- ++#endif + decor_blend_border_picture (xdisplay, + d->context, + src, +@@ -2246,12 +2282,13 @@ meta_draw_window_decoration (decor_t *d) + } + #ifdef HAVE_MARCO_1_23_1 + if (fgeom.borders.visible.right) ++ { ++ right_region = meta_get_right_border_region (&fgeom); + #else + if (fgeom.right_width) +-#endif + { + right_region = meta_get_right_border_region (&fgeom, clip.height); +- ++#endif + decor_blend_border_picture (xdisplay, + d->context, + src, +-- +2.21.0 + diff --git a/compiz_0006-update-marco_version_checks-to-match-marco-1.22.2-re.patch b/compiz_0006-update-marco_version_checks-to-match-marco-1.22.2-re.patch new file mode 100644 index 0000000..533fdf6 --- /dev/null +++ b/compiz_0006-update-marco_version_checks-to-match-marco-1.22.2-re.patch @@ -0,0 +1,358 @@ +From 8de1335f119ca017e7c1bfebbd54a38106a90bb8 Mon Sep 17 00:00:00 2001 +From: raveit65 +Date: Mon, 17 Jun 2019 09:51:39 +0200 +Subject: [PATCH 6/6] update marco_version_checks to match marco-1.22.2 release + +--- + configure.ac | 18 +++--- + gtk-window-decorator/gtk-window-decorator.c | 66 ++++++++++----------- + 2 files changed, 42 insertions(+), 42 deletions(-) + +diff --git a/configure.ac b/configure.ac +index d7f5e85b..27a435a6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -384,12 +384,12 @@ else + use_marco="no" + fi + +-# Check if we are building against marco 1.23.1 or later ++# Check if we are building against marco 1.22.2 or later + if test "x$use_marco" = "xyes"; then +- PKG_CHECK_EXISTS(libmarco-private >= 1.23.1, +- [have_marco_1_23_1=yes], [have_marco_1_23_1=no]) ++ PKG_CHECK_EXISTS(libmarco-private >= 1.22.2, ++ [have_marco_1_22_2=yes], [have_marco_1_22_2=no]) + else +- have_marco_1_23_1="no" ++ have_marco_1_22_2="no" + fi + + if test "x$use_gtk" = "xyes"; then +@@ -418,10 +418,10 @@ if test "$use_marco" = yes; then + AC_DEFINE(USE_MARCO, 1, [Build marco theme support]) + fi + +-AM_CONDITIONAL(HAVE_MARCO_1_23_1, test "x$have_marco_1_23_1" = "xyes") +-if test "$have_marco_1_23_1" = yes; then +- AC_DEFINE(HAVE_MARCO_1_23_1, 1, +- [Build against marco 1.23.1 o later]) ++AM_CONDITIONAL(HAVE_MARCO_1_22_2, test "x$have_marco_1_22_2" = "xyes") ++if test "$have_marco_1_22_2" = yes; then ++ AC_DEFINE(HAVE_MARCO_1_22_2, 1, ++ [Build against marco 1.22.2 o later]) + fi + + AM_CONDITIONAL(USE_MATE, test "x$use_mate" = "xyes") +@@ -513,7 +513,7 @@ echo "and the following optional features will be used:" + echo "and the following optional features will be used:" + echo " gtk: $use_gtk ($with_gtk)" + echo " marco: $use_marco" +-echo " marco >=1.23.1 support: $have_marco_1_23_1" ++echo " marco >=1.22.2 support: $have_marco_1_22_2" + echo " gwd gsettings support: $use_gsettings" + echo " desktop menu entries: $use_menu_entries" + echo "" +diff --git a/gtk-window-decorator/gtk-window-decorator.c b/gtk-window-decorator/gtk-window-decorator.c +index a93db39c..59456ad3 100644 +--- a/gtk-window-decorator/gtk-window-decorator.c ++++ b/gtk-window-decorator/gtk-window-decorator.c +@@ -1581,7 +1581,7 @@ radius_to_width (int radius, + + + static Region +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + meta_get_top_border_region (const MetaFrameGeometry *fgeom) + #else + meta_get_top_border_region (const MetaFrameGeometry *fgeom, +@@ -1596,7 +1596,7 @@ meta_get_top_border_region (const MetaFrameGeometry *fgeom, + int bottom_left_radius; + int bottom_right_radius; + int w, i; +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + int width; + int height; + #endif +@@ -1608,7 +1608,7 @@ meta_get_top_border_region (const MetaFrameGeometry *fgeom, + &bottom_left_radius, + &bottom_right_radius); + +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + /*We have to define these here with newer marco versions*/ + width = fgeom->width - fgeom->borders.invisible.left - fgeom->borders.invisible.right; + height = fgeom->borders.visible.top; +@@ -1648,7 +1648,7 @@ meta_get_top_border_region (const MetaFrameGeometry *fgeom, + xrect.x = 0; + xrect.y = 0; + xrect.width = width; +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + xrect.height = fgeom->height; + #else + xrect.height = fgeom->top_height; +@@ -1663,7 +1663,7 @@ meta_get_top_border_region (const MetaFrameGeometry *fgeom, + } + + static Region +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + meta_get_bottom_border_region (const MetaFrameGeometry *fgeom) + #else + meta_get_bottom_border_region (const MetaFrameGeometry *fgeom, +@@ -1678,7 +1678,7 @@ meta_get_bottom_border_region (const MetaFrameGeometry *fgeom, + int bottom_right_radius; + int w, i; + +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + int width; + int height; + #endif +@@ -1691,7 +1691,7 @@ meta_get_bottom_border_region (const MetaFrameGeometry *fgeom, + &bottom_left_radius, + &bottom_right_radius); + +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + /*We have to define these here with newer marco versions*/ + width = fgeom->width - fgeom->borders.invisible.left - fgeom->borders.invisible.right; + height = fgeom->borders.visible.top; +@@ -1704,7 +1704,7 @@ meta_get_bottom_border_region (const MetaFrameGeometry *fgeom, + w = radius_to_width (bottom_left_radius, i); + + xrect.x = 0; +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + xrect.y = fgeom->height - i - 1; + #else + xrect.y = fgeom->bottom_height - i - 1; +@@ -1723,7 +1723,7 @@ meta_get_bottom_border_region (const MetaFrameGeometry *fgeom, + w = radius_to_width (bottom_right_radius, i); + + xrect.x = width - w; +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + xrect.y = fgeom->height - i - 1; + #else + xrect.y = fgeom->bottom_height - i - 1; +@@ -1740,7 +1740,7 @@ meta_get_bottom_border_region (const MetaFrameGeometry *fgeom, + xrect.x = 0; + xrect.y = 0; + xrect.width = width; +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + xrect.height = fgeom->height; + #else + xrect.height = fgeom->bottom_height; +@@ -1756,7 +1756,7 @@ meta_get_bottom_border_region (const MetaFrameGeometry *fgeom, + } + + static Region +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + meta_get_left_border_region (const MetaFrameGeometry *fgeom) + #else + meta_get_left_border_region (const MetaFrameGeometry *fgeom, +@@ -1770,7 +1770,7 @@ meta_get_left_border_region (const MetaFrameGeometry *fgeom, + + xrect.x = 0; + xrect.y = 0; +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + xrect.width = fgeom->borders.visible.left; + xrect.height = fgeom->height - fgeom->borders.total.top - fgeom->borders.total.bottom; + #else +@@ -1783,7 +1783,7 @@ meta_get_left_border_region (const MetaFrameGeometry *fgeom, + } + + static Region +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + meta_get_right_border_region (const MetaFrameGeometry *fgeom) + #else + meta_get_right_border_region (const MetaFrameGeometry *fgeom, +@@ -1797,7 +1797,7 @@ meta_get_right_border_region (const MetaFrameGeometry *fgeom, + + xrect.x = 0; + xrect.y = 0; +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + xrect.width = fgeom->borders.visible.right; + xrect.height = fgeom->height - fgeom->borders.total.top - fgeom->borders.total.bottom; + #else +@@ -1919,7 +1919,7 @@ meta_get_decoration_geometry (decor_t *d, + MetaButtonLayout *button_layout, + GdkRectangle *clip) + { +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + MetaFrameBorders borders; + #endif + gint left_width, right_width, top_height, bottom_height; +@@ -1995,7 +1995,7 @@ meta_get_decoration_geometry (decor_t *d, + + if (d->state & WNCK_WINDOW_STATE_ABOVE) + *flags |= META_FRAME_ABOVE; +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + meta_theme_get_frame_borders (theme, + META_FRAME_TYPE_NORMAL, + text_height, +@@ -2172,7 +2172,7 @@ meta_draw_window_decoration (decor_t *d) + + cairo_paint (cr); + +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + meta_theme_draw_frame (theme, + context, + #else +@@ -2189,7 +2189,7 @@ meta_draw_window_decoration (decor_t *d) + #endif + META_FRAME_TYPE_NORMAL, + flags, +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + fgeom.width - fgeom.borders.total.left - fgeom.borders.total.right, + fgeom.height - fgeom.borders.total.top - fgeom.borders.total.bottom, + #else +@@ -2202,7 +2202,7 @@ meta_draw_window_decoration (decor_t *d) + button_states, + d->icon_pixbuf, + NULL); +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + if (fgeom.borders.visible.top) + { + top_region = meta_get_top_border_region (&fgeom); +@@ -2214,7 +2214,7 @@ meta_draw_window_decoration (decor_t *d) + decor_blend_border_picture (xdisplay, + d->context, + src, +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + fgeom.borders.invisible.left, + fgeom.borders.invisible.top, + #else +@@ -2228,7 +2228,7 @@ meta_draw_window_decoration (decor_t *d) + shade_alpha, + 0); + } +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + if (fgeom.borders.visible.bottom ) + { + bottom_region = meta_get_bottom_border_region (&fgeom); +@@ -2240,7 +2240,7 @@ meta_draw_window_decoration (decor_t *d) + decor_blend_border_picture (xdisplay, + d->context, + src, +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + fgeom.borders.invisible.left, + fgeom.height - fgeom.borders.total.bottom, + #else +@@ -2254,7 +2254,7 @@ meta_draw_window_decoration (decor_t *d) + shade_alpha, + 0); + } +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + if (fgeom.borders.visible.left) + { + left_region = meta_get_left_border_region (&fgeom); +@@ -2266,7 +2266,7 @@ meta_draw_window_decoration (decor_t *d) + decor_blend_border_picture (xdisplay, + d->context, + src, +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + fgeom.borders.invisible.left, + fgeom.borders.total.top, + #else +@@ -2280,7 +2280,7 @@ meta_draw_window_decoration (decor_t *d) + shade_alpha, + 0); + } +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + if (fgeom.borders.visible.right) + { + right_region = meta_get_right_border_region (&fgeom); +@@ -2292,7 +2292,7 @@ meta_draw_window_decoration (decor_t *d) + decor_blend_border_picture (xdisplay, + d->context, + src, +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + fgeom.width - fgeom.borders.total.right, + fgeom.borders.total.top, + #else +@@ -2323,7 +2323,7 @@ meta_draw_window_decoration (decor_t *d) + if (d->prop_xid) + { + /* translate from frame to client window space */ +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + if (top_region) + XOffsetRegion (top_region, -fgeom.borders.total.left, -fgeom.borders.total.top); + if (bottom_region) +@@ -3088,7 +3088,7 @@ meta_get_event_window_position (decor_t *d, + MetaButtonLayout button_layout; + MetaFrameGeometry fgeom; + MetaFrameFlags flags; +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + GtkBorder visible; + GtkBorder resize; + GtkBorder total; +@@ -3101,7 +3101,7 @@ meta_get_event_window_position (decor_t *d, + + meta_get_decoration_geometry (d, theme, &flags, &fgeom, &button_layout, + &clip); +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + visible = fgeom.borders.visible; + resize = fgeom.borders.total; + +@@ -3415,7 +3415,7 @@ meta_get_button_position (decor_t *d, + *y = space->clickable.y; + *w = space->clickable.width; + *h = space->clickable.height; +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + /*compensate for offset caused by invisible borders + *taken straight from compiz 0.9 + */ +@@ -6489,14 +6489,14 @@ static void + meta_update_border_extents (gint text_height) + { + MetaTheme *theme; +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + MetaFrameBorders borders; + #else + gint top_height, bottom_height, left_width, right_width; + #endif + theme = meta_theme_get_current (); + +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + meta_theme_get_frame_borders (theme, + META_FRAME_TYPE_NORMAL, + text_height, +@@ -6528,7 +6528,7 @@ meta_update_border_extents (gint text_height) + titlebar_height = top_height - _win_extents.top; + #endif + +-#ifdef HAVE_MARCO_1_23_1 ++#ifdef HAVE_MARCO_1_22_2 + meta_theme_get_frame_borders (theme, + META_FRAME_TYPE_NORMAL, + text_height, +-- +2.21.0 +