rpms/gnome-settings-daemon/F-12 0001-Fix-bluriness-in-level-bar-and-popup.patch, NONE, 1.1 0002-Use-a-rounded-instead-of-curved-rectangle.patch, NONE, 1.1 0003-Improve-the-media-keys-overlay-design.patch, NONE, 1.1 gnome-settings-daemon.spec, 1.131, 1.132 0001-Bug-594617-Touchpad-left-handed-bug-fixes.patch, 1.1, NONE 0001-Update-gnome-volume-control-code.patch, 1.1, NONE composited-changed.patch, 1.1, NONE fix-variant-handling.patch, 1.1, NONE gnome-settings-daemon-2.26.0-support-touchpads.patch, 1.1, NONE locate-pointer-csw.patch, 1.1, NONE locate-pointer-process.patch, 1.1, NONE osd-rounded-rectangle.patch, 1.1, NONE osd-visual-refresh.patch, 1.1, NONE xklavier4.patch, 1.1, NONE

Bastien Nocera hadess at fedoraproject.org
Tue Oct 27 22:31:12 UTC 2009


Author: hadess

Update of /cvs/pkgs/rpms/gnome-settings-daemon/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv8458

Modified Files:
	gnome-settings-daemon.spec 
Added Files:
	0001-Fix-bluriness-in-level-bar-and-popup.patch 
	0002-Use-a-rounded-instead-of-curved-rectangle.patch 
	0003-Improve-the-media-keys-overlay-design.patch 
Removed Files:
	0001-Bug-594617-Touchpad-left-handed-bug-fixes.patch 
	0001-Update-gnome-volume-control-code.patch 
	composited-changed.patch fix-variant-handling.patch 
	gnome-settings-daemon-2.26.0-support-touchpads.patch 
	locate-pointer-csw.patch locate-pointer-process.patch 
	osd-rounded-rectangle.patch osd-visual-refresh.patch 
	xklavier4.patch 
Log Message:
* Tue Oct 27 2009 Bastien Nocera <bnocera at redhat.com> 2.28.1-4
- Fix bluriness in OSD


0001-Fix-bluriness-in-level-bar-and-popup.patch:
 gsd-media-keys-window.c |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

--- NEW FILE 0001-Fix-bluriness-in-level-bar-and-popup.patch ---
>From fadc8f8aaa65eecc855350a1dea9cfc8c255620f Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Mon, 26 Oct 2009 14:55:55 +0000
Subject: [PATCH 1/3] Fix bluriness in level bar, and popup

By shifting the top-left coordinates by half a pixel, to match
the cairo grid.

This makes the outter border of the popup, as well as the
level bar's borders much sharper.

https://bugzilla.gnome.org/show_bug.cgi?id=567249
---
 plugins/media-keys/gsd-media-keys-window.c |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/plugins/media-keys/gsd-media-keys-window.c b/plugins/media-keys/gsd-media-keys-window.c
index 9306b92..f890344 100644
--- a/plugins/media-keys/gsd-media-keys-window.c
+++ b/plugins/media-keys/gsd-media-keys-window.c
@@ -610,7 +610,11 @@ draw_volume_boxes (GsdMediaKeysWindow *window,
         GdkColor color;
         double   r, g, b;
 
-        x1 = width * percentage;
+        x0 += 0.5;
+        y0 += 0.5;
+        height = round (height) - 1;
+        width = round (width) - 1;
+        x1 = round ((width - 1) * percentage);
 
         /* bar background */
         color = GTK_WIDGET (window)->style->dark [GTK_STATE_NORMAL];
@@ -636,7 +640,7 @@ draw_volume_boxes (GsdMediaKeysWindow *window,
         r = (float)color.red / 65535.0;
         g = (float)color.green / 65535.0;
         b = (float)color.blue / 65535.0;
-        cairo_rectangle (cr, x0, y0, x1, height);
+        cairo_rectangle (cr, x0 + 0.5, y0 + 0.5, x1, height - 1);
         cairo_set_source_rgba (cr, r, g, b, FG_ALPHA);
         cairo_fill (cr);
 }
@@ -659,15 +663,15 @@ draw_action_volume (GsdMediaKeysWindow *window,
 
         gtk_window_get_size (GTK_WINDOW (window), &window_width, &window_height);
 
-        icon_box_width = window_width * 0.65;
-        icon_box_height = window_height * 0.65;
+        icon_box_width = round (window_width * 0.65);
+        icon_box_height = round (window_height * 0.65);
         volume_box_width = icon_box_width;
-        volume_box_height = window_height * 0.05;
+        volume_box_height = round (window_height * 0.05);
 
         icon_box_x0 = (window_width - icon_box_width) / 2;
         icon_box_y0 = (window_height - icon_box_height - volume_box_height) / 2;
-        volume_box_x0 = icon_box_x0;
-        volume_box_y0 = icon_box_height + icon_box_y0;
+        volume_box_x0 = round (icon_box_x0);
+        volume_box_y0 = round (icon_box_height + icon_box_y0);
 
 #if 0
         g_message ("icon box: w=%f h=%f x0=%f y0=%f",
-- 
1.6.5.rc2


0002-Use-a-rounded-instead-of-curved-rectangle.patch:
 gsd-media-keys-window.c |  104 ++++++++++++++++++++++--------------------------
 1 file changed, 49 insertions(+), 55 deletions(-)

--- NEW FILE 0002-Use-a-rounded-instead-of-curved-rectangle.patch ---
>From dab2e6b44c57e14dd373adf04d4530bd5915f582 Mon Sep 17 00:00:00 2001
From: William Jon McCann <jmccann at redhat.com>
Date: Wed, 23 Sep 2009 20:23:31 -0400
Subject: [PATCH 2/3] Use a rounded instead of curved rectangle

---
 plugins/media-keys/gsd-media-keys-window.c |  101 +++++++++++++---------------
 1 files changed, 48 insertions(+), 53 deletions(-)

diff --git a/plugins/media-keys/gsd-media-keys-window.c b/plugins/media-keys/gsd-media-keys-window.c
index f890344..cffbe3e 100644
--- a/plugins/media-keys/gsd-media-keys-window.c
+++ b/plugins/media-keys/gsd-media-keys-window.c
@@ -260,59 +260,54 @@ gsd_media_keys_window_set_volume_level (GsdMediaKeysWindow *window,
 }
 
 static void
-curved_rectangle (cairo_t *cr,
-                  double   x0,
-                  double   y0,
-                  double   width,
-                  double   height,
-                  double   radius)
-{
-        double x1;
-        double y1;
-
-        x1 = x0 + width;
-        y1 = y0 + height;
-
-        if (!width || !height) {
-                return;
-        }
-
-        if (width / 2 < radius) {
-                if (height / 2 < radius) {
-                        cairo_move_to  (cr, x0, (y0 + y1) / 2);
-                        cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1) / 2, y0);
-                        cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1) / 2);
-                        cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0) / 2, y1);
-                        cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1) / 2);
-                } else {
-                        cairo_move_to  (cr, x0, y0 + radius);
-                        cairo_curve_to (cr, x0, y0, x0, y0, (x0 + x1) / 2, y0);
-                        cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + radius);
-                        cairo_line_to (cr, x1, y1 - radius);
-                        cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0) / 2, y1);
-                        cairo_curve_to (cr, x0, y1, x0, y1, x0, y1 - radius);
-                }
-        } else {
-                if (height / 2 < radius) {
-                        cairo_move_to  (cr, x0, (y0 + y1) / 2);
-                        cairo_curve_to (cr, x0, y0, x0 , y0, x0 + radius, y0);
-                        cairo_line_to (cr, x1 - radius, y0);
-                        cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1) / 2);
-                        cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1);
-                        cairo_line_to (cr, x0 + radius, y1);
-                        cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1) / 2);
-                } else {
-                        cairo_move_to  (cr, x0, y0 + radius);
-                        cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + radius, y0);
-                        cairo_line_to (cr, x1 - radius, y0);
-                        cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + radius);
-                        cairo_line_to (cr, x1, y1 - radius);
-                        cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1);
-                        cairo_line_to (cr, x0 + radius, y1);
-                        cairo_curve_to (cr, x0, y1, x0, y1, x0, y1 - radius);
-                }
-        }
-
+rounded_rectangle (cairo_t* cr,
+                   gdouble  aspect,
+                   gdouble  x,
+                   gdouble  y,
+                   gdouble  corner_radius,
+                   gdouble  width,
+                   gdouble  height)
+{
+        gdouble radius = corner_radius / aspect;
+
+        cairo_move_to (cr, x + radius, y);
+
+        cairo_line_to (cr,
+                       x + width - radius,
+                       y);
+        cairo_arc (cr,
+                   x + width - radius,
+                   y + radius,
+                   radius,
+                   -90.0f * G_PI / 180.0f,
+                   0.0f * G_PI / 180.0f);
+        cairo_line_to (cr,
+                       x + width,
+                       y + height - radius);
+        cairo_arc (cr,
+                   x + width - radius,
+                   y + height - radius,
+                   radius,
+                   0.0f * G_PI / 180.0f,
+                   90.0f * G_PI / 180.0f);
+        cairo_line_to (cr,
+                       x + radius,
+                       y + height);
+        cairo_arc (cr,
+                   x + radius,
+                   y + height - radius,
+                   radius,
+                   90.0f * G_PI / 180.0f,
+                   180.0f * G_PI / 180.0f);
+        cairo_line_to (cr,
+                       x,
+                       y + radius);
+        cairo_arc (cr,
+                   x + radius,
+                   y + radius,
+                   radius,
+                   180.0f * G_PI / 180.0f,
+                   270.0f * G_PI / 180.0f);
         cairo_close_path (cr);
 }
 
@@ -799,7 +794,7 @@ on_expose_event (GtkWidget          *widget,
         cairo_paint (cr);
 
         /* draw a box */
-        curved_rectangle (cr, 0.5, 0.5, width-1, height-1, height / 10);
+        rounded_rectangle (cr, 1.0, 0.5, 0.5, height / 10, width-1, height-1);
         color = GTK_WIDGET (window)->style->bg [GTK_STATE_NORMAL];
         r = (float)color.red / 65535.0;
         g = (float)color.green / 65535.0;
-- 
1.6.5.rc2


0003-Improve-the-media-keys-overlay-design.patch:
 gsd-media-keys-window.c |   60 ++++++++++++++++++++++++++++++++++++------------
 1 file changed, 45 insertions(+), 15 deletions(-)

--- NEW FILE 0003-Improve-the-media-keys-overlay-design.patch ---
>From 26041c5b936263d3f5aa4aa7fc7ffedd128ed444 Mon Sep 17 00:00:00 2001
From: William Jon McCann <jmccann at redhat.com>
Date: Wed, 23 Sep 2009 21:15:45 -0400
Subject: [PATCH 3/3] Improve the media keys overlay design

---
 plugins/media-keys/gsd-media-keys-window.c |   59 +++++++++++++++++++++-------
 1 files changed, 45 insertions(+), 14 deletions(-)

diff --git a/plugins/media-keys/gsd-media-keys-window.c b/plugins/media-keys/gsd-media-keys-window.c
index cffbe3e..c33d624 100644
--- a/plugins/media-keys/gsd-media-keys-window.c
+++ b/plugins/media-keys/gsd-media-keys-window.c
@@ -33,7 +33,7 @@
 #define DIALOG_FADE_TIMEOUT 1500 /* timeout before fade starts */
 #define FADE_TIMEOUT 10        /* timeout in ms between each frame of the fade */
 
-#define BG_ALPHA 0.50
+#define BG_ALPHA 0.75
 #define FG_ALPHA 1.00
 
 static void     gsd_media_keys_window_class_init (GsdMediaKeysWindowClass *klass);
@@ -593,6 +593,36 @@ render_speaker (GsdMediaKeysWindow *window,
 }
 
 static void
+color_reverse (const GdkColor *a,
+               GdkColor       *b)
+{
+        gdouble red;
+        gdouble green;
+        gdouble blue;
+        gdouble h;
+        gdouble s;
+        gdouble v;
+
+        red = (gdouble) a->red / 65535.0;
+        green = (gdouble) a->green / 65535.0;
+        blue = (gdouble) a->blue / 65535.0;
+
+        gtk_rgb_to_hsv (red, green, blue, &h, &s, &v);
+
+        v = 0.5 + (0.5 - v);
+        if (v > 1.0)
+                v = 1.0;
+        else if (v < 0.0)
+                v = 0.0;
+
+        gtk_hsv_to_rgb (h, s, v, &red, &green, &blue);
+
+        b->red = red * 65535.0;
+        b->green = green * 65535.0;
+        b->blue = blue * 65535.0;
+}
+
+static void
 draw_volume_boxes (GsdMediaKeysWindow *window,
                    cairo_t            *cr,
                    double              percentage,
@@ -609,33 +639,34 @@ draw_volume_boxes (GsdMediaKeysWindow *window,
         y0 += 0.5;
         height = round (height) - 1;
         width = round (width) - 1;
-        x1 = round ((width - 1) * percentage);
+        x1 = round ((width - 2) * percentage);
 
         /* bar background */
-        color = GTK_WIDGET (window)->style->dark [GTK_STATE_NORMAL];
+        color_reverse (&GTK_WIDGET (window)->style->dark[GTK_STATE_NORMAL], &color);
         r = (float)color.red / 65535.0;
         g = (float)color.green / 65535.0;
         b = (float)color.blue / 65535.0;
-        cairo_rectangle (cr, x0, y0, width, height);
-        cairo_set_source_rgba (cr, r, g, b, FG_ALPHA);
-        cairo_fill (cr);
+        rounded_rectangle (cr, 1.0, x0, y0, height / 6, width, height);
+        cairo_set_source_rgba (cr, r, g, b, FG_ALPHA / 2);
+        cairo_fill_preserve (cr);
 
         /* bar border */
-        color = GTK_WIDGET (window)->style->dark [GTK_STATE_SELECTED];
+        color_reverse (&GTK_WIDGET (window)->style->light[GTK_STATE_NORMAL], &color);
         r = (float)color.red / 65535.0;
         g = (float)color.green / 65535.0;
         b = (float)color.blue / 65535.0;
-        cairo_rectangle (cr, x0, y0, width, height);
-        cairo_set_source_rgba (cr, r, g, b, FG_ALPHA);
+        cairo_set_source_rgba (cr, r, g, b, FG_ALPHA / 2);
         cairo_set_line_width (cr, 1);
         cairo_stroke (cr);
 
         /* bar progress */
-        color = GTK_WIDGET (window)->style->bg [GTK_STATE_SELECTED];
+        if (percentage < 0.01)
+                return;
+        color = GTK_WIDGET (window)->style->bg[GTK_STATE_NORMAL];
         r = (float)color.red / 65535.0;
         g = (float)color.green / 65535.0;
         b = (float)color.blue / 65535.0;
-        cairo_rectangle (cr, x0 + 0.5, y0 + 0.5, x1, height - 1);
+        rounded_rectangle (cr, 1.0, x0 + 0.5, y0 + 0.5, height / 8, x1, height - 2);
         cairo_set_source_rgba (cr, r, g, b, FG_ALPHA);
         cairo_fill (cr);
 }
@@ -795,18 +826,18 @@ on_expose_event (GtkWidget          *widget,
 
         /* draw a box */
         rounded_rectangle (cr, 1.0, 0.5, 0.5, height / 10, width-1, height-1);
-        color = GTK_WIDGET (window)->style->bg [GTK_STATE_NORMAL];
+        color_reverse (&GTK_WIDGET (window)->style->bg[GTK_STATE_NORMAL], &color);
         r = (float)color.red / 65535.0;
         g = (float)color.green / 65535.0;
         b = (float)color.blue / 65535.0;
         cairo_set_source_rgba (cr, r, g, b, BG_ALPHA);
         cairo_fill_preserve (cr);
 
-        color = GTK_WIDGET (window)->style->fg [GTK_STATE_NORMAL];
+        color_reverse (&GTK_WIDGET (window)->style->text_aa[GTK_STATE_NORMAL], &color);
         r = (float)color.red / 65535.0;
         g = (float)color.green / 65535.0;
         b = (float)color.blue / 65535.0;
-        cairo_set_source_rgba (cr, r, g, b, BG_ALPHA);
+        cairo_set_source_rgba (cr, r, g, b, BG_ALPHA / 2);
         cairo_set_line_width (cr, 1);
         cairo_stroke (cr);
 
-- 
1.6.5.rc2



Index: gnome-settings-daemon.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-settings-daemon/F-12/gnome-settings-daemon.spec,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -p -r1.131 -r1.132
--- gnome-settings-daemon.spec	26 Oct 2009 21:45:43 -0000	1.131
+++ gnome-settings-daemon.spec	27 Oct 2009 22:31:09 -0000	1.132
@@ -1,6 +1,6 @@
 Name:		gnome-settings-daemon
 Version:	2.28.1
-Release:	3%{?dist}
+Release:	4%{?dist}
 Summary:	The daemon sharing settings from GNOME to GTK+/KDE applications
 
 Group:		System Environment/Daemons
@@ -33,8 +33,10 @@ BuildRequires:  fontconfig-devel
 BuildRequires:	libcanberra-devel
 
 # https://bugzilla.gnome.org/show_bug.cgi?id=596136
-Patch0: osd-rounded-rectangle.patch
-Patch1: osd-visual-refresh.patch
+Patch0: 0002-Use-a-rounded-instead-of-curved-rectangle.patch
+Patch1: 0003-Improve-the-media-keys-overlay-design.patch
+# https://bugzilla.gnome.org/show_bug.cgi?id=567249
+Patch4: 0001-Fix-bluriness-in-level-bar-and-popup.patch
 
 # https://bugzilla.redhat.com/show_bug.cgi?id=498249
 Patch2: left-handed-touchpad.patch
@@ -59,6 +61,7 @@ developing applications that use %{name}
 
 %prep
 %setup -q
+%patch4 -p1 -b .blurry
 %patch0 -p1 -b .osd-rounded-rectangle
 %patch1 -p1 -b .osd-visual-refresh
 %patch2 -p1 -b .left-handed-touchpad
@@ -174,6 +177,9 @@ fi
 %{_libdir}/pkgconfig/gnome-settings-daemon.pc
 
 %changelog
+* Tue Oct 27 2009 Bastien Nocera <bnocera at redhat.com> 2.28.1-4
+- Fix bluriness in OSD
+
 * Mon Oct 26 2009 Matthias Clasen <mclasen at redhat.com> - 2.28.1-3
 - Change default font rendering to use slight hinting
 


--- 0001-Bug-594617-Touchpad-left-handed-bug-fixes.patch DELETED ---


--- 0001-Update-gnome-volume-control-code.patch DELETED ---


--- composited-changed.patch DELETED ---


--- fix-variant-handling.patch DELETED ---


--- gnome-settings-daemon-2.26.0-support-touchpads.patch DELETED ---


--- locate-pointer-csw.patch DELETED ---


--- locate-pointer-process.patch DELETED ---


--- osd-rounded-rectangle.patch DELETED ---


--- osd-visual-refresh.patch DELETED ---


--- xklavier4.patch DELETED ---




More information about the scm-commits mailing list