[mail-notification] Improved GTK3 support in the popup windows

epienbro epienbro at fedoraproject.org
Sun Jul 3 18:03:32 UTC 2011


commit 17b97a3428d11f79b6101f5c3572ca8abccc1814
Author: Erik van Pienbroek <epienbro at fedoraproject.org>
Date:   Sun Jul 3 20:02:40 2011 +0200

    Improved GTK3 support in the popup windows
    
    Updated the GTK3 patch so that popup windows are themed properly
    and the list of unread mails in popup windows are positioned properly
    Initial patch by Enrico Scholz (RHBZ #702097)

 mail-notification-5.4-gtk3-support.patch |   47 ++++++++++++++++++++++-------
 mail-notification.spec                   |    7 ++++-
 2 files changed, 41 insertions(+), 13 deletions(-)
---
diff --git a/mail-notification-5.4-gtk3-support.patch b/mail-notification-5.4-gtk3-support.patch
index a7190e7..5a3b3e5 100644
--- a/mail-notification-5.4-gtk3-support.patch
+++ b/mail-notification-5.4-gtk3-support.patch
@@ -545,7 +545,7 @@
 +    int y;
 +
 +    gtk_widget_get_allocation(widget, &allocation);
-+    y = allocation.y;
++    y = 0;
  
 -    if (! GTK_WIDGET_DRAWABLE(widget))
 +    if (! gtk_widget_is_drawable(widget))
@@ -557,7 +557,7 @@
  	Row *row = g_ptr_array_index(selfp->rows, i);
  	int j;
 -	int x = widget->allocation.x;
-+	int x = allocation.x;
++	int x = 0;
  	int column = 0;
  
  	MN_ARRAY_FOREACH(j, row->cells)
@@ -587,6 +587,20 @@
  #line 109 "mn-tooltips.c"
  #line 308 "src/mn-tooltips.gob"
  static void mn_tooltips_draw_tips (MNTooltips * self);
+@@ -422,7 +422,13 @@
+ 	
+     if (! selfp->window)
+       {
++	GtkStyleContext *ctx;
++
+ 	selfp->window = gtk_window_new(GTK_WINDOW_POPUP);
++
++	ctx = gtk_widget_get_style_context(GTK_WIDGET(selfp->window));
++	gtk_style_context_add_class(ctx, "tooltip");
++
+ 	self_update_screen(self, TRUE);
+ 	gtk_widget_set_app_paintable(selfp->window, TRUE);
+ 	gtk_window_set_resizable(GTK_WINDOW(selfp->window), FALSE);
 @@ -430,7 +430,7 @@
  	gtk_container_set_border_width(GTK_CONTAINER(selfp->window), selfp->border_width);
  
@@ -614,23 +628,32 @@
  {
  #line 600 "mn-tooltips.c"
  #define __GOB_FUNCTION__ "MN:Tooltips::paint_window"
-@@ -608,13 +608,12 @@
+@@ -608,18 +608,13 @@
  	
      GtkRequisition req;
  
 -    gtk_widget_size_request(selfp->window, &req);
 -    gtk_paint_flat_box(selfp->window->style,
 -		       selfp->window->window,
-+    gtk_widget_size_request(GTK_WIDGET(selfp), &req);
-+    gtk_paint_flat_box(gtk_widget_get_style(GTK_WIDGET(selfp)),
-+		       cr,
- 		       GTK_STATE_NORMAL,
- 		       GTK_SHADOW_OUT,
- 		       NULL,
+-		       GTK_STATE_NORMAL,
+-		       GTK_SHADOW_OUT,
+-		       NULL,
 -		       selfp->window,
- 		       "tooltip",
- 		       0,
- 		       0,
+-		       "tooltip",
+-		       0,
+-		       0,
+-		       req.width,
+-		       req.height);
++    gtk_widget_size_request(GTK_WIDGET(selfp->window), &req);
++    gtk_render_background(gtk_widget_get_style_context(GTK_WIDGET(selfp->window)),
++                                                       cr,
++                                                       0,
++                                                       0,
++                                                       req.width,
++                                                       req.height);
+ 
+     return FALSE;
+   }}
 @@ -651,10 +650,11 @@
      gint monitor_num, px, py;
      GdkRectangle monitor;
diff --git a/mail-notification.spec b/mail-notification.spec
index e609a52..a9b259d 100644
--- a/mail-notification.spec
+++ b/mail-notification.spec
@@ -1,6 +1,6 @@
 Name:           mail-notification
 Version:        5.4
-Release:        39%{?dist}
+Release:        40%{?dist}
 Summary:        Status icon that informs you if you have new mail
 
 Group:          Applications/Internet
@@ -249,6 +249,11 @@ export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
 
 
 %changelog
+* Sun Jul  3 2011 Erik van Pienbroek <epienbro at fedoraproject.org> - 5.4-40
+- Updated the GTK3 patch so that popup windows are themed properly
+  and the list of unread mails in popup windows are positioned properly
+  Initial patch by Enrico Scholz (RHBZ #702097)
+
 * Sat Jun 25 2011 Erik van Pienbroek <epienbro at fedoraproject.org> - 5.4-39
 - Fix markup with XFCE (RHBZ #715591)
   Thanks to Enrico Scholz for supplying a patch!


More information about the scm-commits mailing list