Package: metacity Version: 1:2.30.1-3 Severity: important Tags: patch upstream
I'm packaging light-themes for Debian, under current metacity version window control buttons will have "square" edges when it's supposed to be otherwise. This problem has been fixed and has been uploaded in Ubuntu and Upstream, I'm sending along the fix as well. I tried this fix, and when applied metacity displays borders just as it's supposed to. Reference: Packaging light-themes for Debian: https://answers.launchpad.net/ubuntu/+source/light-themes/+question/142268 Gnome bug 608511: http://bugzilla.gnome.org/show_bug.cgi?id=608511 Adnan -- System Information: Debian Release: 6.0 APT prefers unstable APT policy: (900, 'unstable'), (600, 'testing'), (200, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores) Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages metacity depends on: ii libatk1.0-0 1.30.0-1 The ATK accessibility toolkit ii libc6 2.11.2-8 Embedded GNU C Library: Shared lib ii libcairo2 1.8.10-6 The Cairo 2D vector graphics libra ii libcanberra-gtk0 0.24-1 Gtk+ helper for playing widget eve ii libcanberra0 0.24-1 a simple abstract interface for pl ii libgconf2-4 2.28.1-6 GNOME configuration database syste ii libglib2.0-0 2.24.2-1 The GLib library of C routines ii libgtk2.0-0 2.20.1-2 The GTK+ graphical user interface ii libice6 2:1.0.7-1 X11 Inter-Client Exchange library ii libmetacity-private0 1:2.30.1-3 library for the Metacity window ma ii libpango1.0-0 1.28.3-1 Layout and rendering of internatio ii libsm6 2:1.2.0-1 X11 Session Management library ii libstartup-notification0 0.10-1 library for program launch feedbac ii libx11-6 2:1.3.3-4 X11 client-side library ii libxcomposite1 1:0.4.3-1 X11 Composite extension library ii libxcursor1 1:1.1.11-1 X cursor management library ii libxdamage1 1:1.1.3-1 X11 damaged region extension libra ii libxext6 2:1.1.2-1 X11 miscellaneous extension librar ii libxfixes3 1:4.0.5-1 X11 miscellaneous 'fixes' extensio ii libxinerama1 2:1.1.1-1 X11 Xinerama extension library ii libxrandr2 2:1.3.1-1 X11 RandR extension library ii libxrender1 1:0.9.6-1 X Rendering Extension client libra ii metacity-common 1:2.30.1-3 shared files for the Metacity wind ii zenity 2.30.0-1 Display graphical dialog boxes fro Versions of packages metacity recommends: ii gnome-session [x-session-mana 2.30.2-3 The GNOME Session Manager - GNOME Versions of packages metacity suggests: ii gnome-control-center 1:2.30.1-2 utilities to configure the GNOME d ii gnome-themes 2.30.2-1 official themes for the GNOME desk ii xdg-user-dirs 0.13-2 tool to manage well known user dir -- no debconf information
Description: Corrected support for buttons backgrounds with transparency Added 'no background' if there is only one button and backgrounds no more overlap if transparency used. Corrected bug with left button clickable region when window is maximized Origin: Ubuntu Bug: https://bugzilla.gnome.org/show_bug.cgi?id=608511 Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/535088 Author: Nicolas Desfontaine <[email protected]> Index: metacity-2.30.1/src/ui/theme.c =================================================================== --- metacity-2.30.1.orig/src/ui/theme.c 2009-05-02 12:23:00.000000000 +1000 +++ metacity-2.30.1/src/ui/theme.c 2010-06-02 09:52:36.032513731 +1000 @@ -704,8 +704,14 @@ for (i = 0; i < n_left; i++) { - if (i == 0) /* prefer left background if only one button */ - left_bg_rects[i] = &fgeom->left_left_background; + if (i == 0) /* For the first button (From left to right) */ + { + if (n_left > 1) /* Set left_left_background + if we have more than one button */ + left_bg_rects[i] = &fgeom->left_left_background; + else /* No background if we have only one single button */ + left_bg_rects[i] = &fgeom->left_single_background; + } else if (i == (n_left - 1)) left_bg_rects[i] = &fgeom->left_right_background; else @@ -714,15 +720,20 @@ for (i = 0; i < n_right; i++) { - /* prefer right background if only one button */ - if (i == (n_right - 1)) - right_bg_rects[i] = &fgeom->right_right_background; + if (i == (n_right - 1)) /* For the first button (From right to left) */ + { + if (n_right > 1) /* Set right_right_background + if we have more than one button */ + right_bg_rects[i] = &fgeom->right_right_background; + else /* No background if we have only one single button */ + right_bg_rects[i] = &fgeom->right_single_background; + } else if (i == 0) right_bg_rects[i] = &fgeom->right_left_background; else right_bg_rects[i] = &fgeom->right_middle_backgrounds[i - 1]; } - + /* Be sure buttons fit */ while (n_left > 0 || n_right > 0) { @@ -838,9 +849,9 @@ if (flags & META_FRAME_MAXIMIZED) { rect->clickable.x = rect->visible.x; - rect->clickable.y = 0; - rect->clickable.width = rect->visible.width; - rect->clickable.height = button_height + button_y; + rect->clickable.y = rect->visible.y; + rect->clickable.width = button_width; + rect->clickable.height = button_height; if (i == n_right - 1) rect->clickable.width += layout->right_titlebar_edge + layout->right_width + layout->button_border.right; @@ -876,23 +887,13 @@ if (flags & META_FRAME_MAXIMIZED) { - if (i==0) - { - rect->clickable.x = 0; - rect->clickable.width = button_width + x; - } - else - { - rect->clickable.x = rect->visible.x; - rect->clickable.width = button_width; - } - - rect->clickable.y = 0; - rect->clickable.height = button_height + button_y; - } - else - g_memmove (&(rect->clickable), &(rect->visible), sizeof(rect->clickable)); - + rect->clickable.x = rect->visible.x; + rect->clickable.y = rect->visible.y; + rect->clickable.width = button_width; + rect->clickable.height = button_height; + } + else + g_memmove (&(rect->clickable), &(rect->visible), sizeof(rect->clickable)); x = rect->visible.x + rect->visible.width + layout->button_border.right; if (left_buttons_has_spacer[i]) @@ -4525,7 +4526,7 @@ /* MIDDLE_BACKGROUND type may get drawn more than once */ if ((j == META_BUTTON_TYPE_RIGHT_MIDDLE_BACKGROUND || j == META_BUTTON_TYPE_LEFT_MIDDLE_BACKGROUND) && - middle_bg_offset < MAX_MIDDLE_BACKGROUNDS) + (middle_bg_offset < (MAX_MIDDLE_BACKGROUNDS - 1))) { ++middle_bg_offset; } Index: metacity-2.30.1/src/ui/theme.h =================================================================== --- metacity-2.30.1.orig/src/ui/theme.h 2009-05-02 12:23:00.000000000 +1000 +++ metacity-2.30.1/src/ui/theme.h 2010-06-02 09:52:36.032513731 +1000 @@ -200,9 +200,11 @@ MetaButtonSpace unstick_rect; #define MAX_MIDDLE_BACKGROUNDS (MAX_BUTTONS_PER_CORNER - 2) + GdkRectangle left_single_background; GdkRectangle left_left_background; GdkRectangle left_middle_backgrounds[MAX_MIDDLE_BACKGROUNDS]; GdkRectangle left_right_background; + GdkRectangle right_single_background; GdkRectangle right_left_background; GdkRectangle right_middle_backgrounds[MAX_MIDDLE_BACKGROUNDS]; GdkRectangle right_right_background;

