[mail-notification/f13/master] fix popup attach window fix tray icon on KDE
Dmitry Butskoy
buc at fedoraproject.org
Mon Oct 11 14:23:10 UTC 2010
commit e7e551c91e4b4da848c2d5a86c4b94d7b2c5f1f8
Author: Dmitry Butskoy <Dmitry at Butskoy.name>
Date: Mon Oct 11 18:22:50 2010 +0400
fix popup attach window
fix tray icon on KDE
mail-notification-5.4-kde-trayicon.patch | 72 ++++++++++++++++++++++++++++++
mail-notification-5.4-popup-attach.patch | 45 ++++++++++++++++++
mail-notification.spec | 31 +++++++++++--
3 files changed, 144 insertions(+), 4 deletions(-)
---
diff --git a/mail-notification-5.4-kde-trayicon.patch b/mail-notification-5.4-kde-trayicon.patch
new file mode 100644
index 0000000..a3bdc83
--- /dev/null
+++ b/mail-notification-5.4-kde-trayicon.patch
@@ -0,0 +1,72 @@
+diff -Nrbu mail-notification-5.4/build/src/mn-shell.c mail-notification-5.4-OK/build/src/mn-shell.c
+--- mail-notification-5.4/build/src/mn-shell.c 2010-10-11 17:45:23.000000000 +0400
++++ mail-notification-5.4-OK/build/src/mn-shell.c 2010-10-11 17:45:48.000000000 +0400
+@@ -313,6 +313,29 @@
+ #undef __GOB_FUNCTION__
+
+ static void
++mn_shell_init_icon_base (MNShell * self)
++{
++ g_return_if_fail (self != NULL);
++ g_return_if_fail (MN_IS_SHELL (self));
++
++ self->icon = MN_MAIL_ICON(mn_mail_icon_new());
++ mn_add_weak_pointer(&self->icon);
++
++ g_object_connect(self->icon,
++ "signal::activate", self_icon_activate_h, self,
++ "signal::activate-mail-reader", self_icon_activate_mail_reader_h, self,
++ "signal::activate-open-latest-message", self_icon_activate_open_latest_message_h, self,
++ "swapped-signal::activate-consider-new-mail-as-read", self_consider_new_mail_as_read, self,
++ "swapped-signal::activate-update", self_update, self,
++ "signal::activate-properties", self_icon_activate_properties_h, self,
++ "signal::activate-help", self_icon_activate_help_h, self,
++ "signal::activate-about", self_icon_activate_about_h, self,
++ "swapped-signal::activate-remove", self_quit, self,
++ "signal::destroy", self_icon_destroy_h, self,
++ NULL);
++}
++
++static void
+ mn_shell_init (MNShell * o G_GNUC_UNUSED)
+ {
+ #define __GOB_FUNCTION__ "MN:Shell::init"
+@@ -793,22 +816,7 @@
+ {
+ #line 360 "src/mn-shell.gob"
+
+- self->icon = MN_MAIL_ICON(mn_mail_icon_new());
+- mn_add_weak_pointer(&self->icon);
+-
+- g_object_connect(self->icon,
+- "signal::activate", self_icon_activate_h, self,
+- "signal::activate-mail-reader", self_icon_activate_mail_reader_h, self,
+- "signal::activate-open-latest-message", self_icon_activate_open_latest_message_h, self,
+- "swapped-signal::activate-consider-new-mail-as-read", self_consider_new_mail_as_read, self,
+- "swapped-signal::activate-update", self_update, self,
+- "signal::activate-properties", self_icon_activate_properties_h, self,
+- "signal::activate-help", self_icon_activate_help_h, self,
+- "signal::activate-about", self_icon_activate_about_h, self,
+- "swapped-signal::activate-remove", self_quit, self,
+- "signal::destroy", self_icon_destroy_h, self,
+- NULL);
+-
++ mn_shell_init_icon_base(self);
+ self_update_sensitivity(self);
+ self_update_tooltip(self);
+ self_update_icon(self);
+@@ -1094,7 +1102,13 @@
+ }
+ else
+ {
+- gtk_widget_hide(GTK_WIDGET(self->icon));
++ /* Re-create the icon as a regular gtk_widget_hide causes the
++ * icon to remain visible on non-GNOME environments. We can't
++ * use the callback self_icon_destroy_h here as it can cause an
++ * endless recursion */
++ g_signal_handlers_disconnect_by_func(self->icon, self_icon_destroy_h, self);
++ gtk_widget_destroy(GTK_WIDGET(self->icon));
++ mn_shell_init_icon_base(self);
+ mn_mail_icon_set_blinking(self->icon, FALSE);
+ }
+ }}
diff --git a/mail-notification-5.4-popup-attach.patch b/mail-notification-5.4-popup-attach.patch
new file mode 100644
index 0000000..b8d5f6a
--- /dev/null
+++ b/mail-notification-5.4-popup-attach.patch
@@ -0,0 +1,45 @@
+diff -Nrbu mail-notification-5.4/build/src/mn-popup.c mail-notification-5.4-OK/build/src/mn-popup.c
+--- mail-notification-5.4/build/src/mn-popup.c 2008-05-22 19:47:49.000000000 +0400
++++ mail-notification-5.4-OK/build/src/mn-popup.c 2010-10-11 17:42:32.000000000 +0400
+@@ -177,6 +177,29 @@
+ #undef __GOB_FUNCTION__
+
+ static void
++mn_popup_wait_for_icon_to_become_ready (void)
++{
++ int x, y;
++ int count = 0;
++
++ /* When the tray icon is created, it can still take some time before
++ * it has arrived at the correct position. This is especially the case
++ * on KDE environments. To work around this, add a little delay of at
++ * most 2 seconds before showing a popup which is attached to the notification */
++ do {
++ gdk_window_get_origin (gtk_widget_get_window (mn_shell->icon), &x, &y);
++
++ if (x != 0 || y != 0) {
++ break;
++ }
++
++ g_usleep(G_USEC_PER_SEC / 10);
++ count++;
++ } while (count < 20);
++}
++
++
++static void
+ mn_popup_init (MNPopup * o G_GNUC_UNUSED)
+ {
+ #define __GOB_FUNCTION__ "MN:Popup::init"
+@@ -299,8 +322,10 @@
+ "icon-name", "stock_mail",
+ NULL);
+
+- if (mn_conf_get_enum_value(MN_TYPE_POPUP_POSITION, MN_CONF_POPUPS_POSITION) == MN_POPUP_POSITION_ATTACHED)
++ if (mn_conf_get_enum_value(MN_TYPE_POPUP_POSITION, MN_CONF_POPUPS_POSITION) == MN_POPUP_POSITION_ATTACHED) {
++ mn_popup_wait_for_icon_to_become_ready();
+ g_object_set(self, "attach-widget", mn_shell->icon, NULL);
++ }
+
+ g_string_free(body, TRUE);
+
diff --git a/mail-notification.spec b/mail-notification.spec
index ef1b447..7cedd31 100644
--- a/mail-notification.spec
+++ b/mail-notification.spec
@@ -1,6 +1,6 @@
Name: mail-notification
Version: 5.4
-Release: 21%{?dist}
+Release: 25%{?dist}
Summary: Status icon that informs you if you have new mail
Group: Applications/Internet
@@ -14,6 +14,8 @@ Patch3: mail-notification-5.4-evolution-gtkhtml.patch
Patch4: mail-notification-5.4-camel_headers.patch
Patch5: mail-notification-5.4-icons.patch
Patch6: mail-notification-5.4-weak.patch
+Patch7: mail-notification-5.4-popup-attach.patch
+Patch8: mail-notification-5.4-kde-trayicon.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: gettext
@@ -33,6 +35,9 @@ BuildRequires: perl-XML-Parser
BuildRequires: evolution-devel
BuildRequires: evolution-data-server-devel >= 1.5
+# temporary to work-around some dependency issues in other packages...
+BuildRequires: libICE-devel, libSM-devel
+
Requires: hicolor-icon-theme
Requires(pre): GConf2
@@ -60,13 +65,15 @@ Evolution support for Mail Notification.
%prep
%setup -q
-%patch0 -p0 -b .evolution
+%patch0 -p1 -b .evolution
%patch1 -p1 -b .gmime
%patch2 -p1 -b .sasl_encode64
%patch3 -p1 -b .gtkhtml
%patch4 -p1 -b .camel_headers
%patch5 -p1 -b .icons
%patch6 -p1 -b .weak
+%patch7 -p1 -b .popup_attach
+%patch8 -p1 -b .kde_trayicon
# Drop #line statements in C sources generated bu .gob,
# for the proper debuginfo package
@@ -192,8 +199,24 @@ export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
%changelog
-* Mon Jun 28 2010 Matthew Barnes <mbarnes at redhat.com> - 5.4-21
-- Rebuild against newer libedataserver.
+* Mon Oct 11 2010 Dmitry Butskoy <Dmitry at Butskoy.name> - 5.4-25
+- fix popup window place
+ (#608372, by Erik van Pienbroek <erik-fedora at vanpienbroek.nl>)
+- fix tray icon freezes on KDE when unread count reaches zero (#641580)
+
+* Fri Sep 17 2010 Dmitry Butskoy <Dmitry at Butskoy.name> - 5.4-24
+- add support for evolution 2.31+
+ (#633507, by Erik van Pienbroek <erik-fedora at vanpienbroek.nl>)
+ Combined with common evolution patch
+
+* Thu Sep 9 2010 Dmitry Butskoy <Dmitry at Butskoy.name> - 5.4-23
+- rebuild with new evolution-data-server
+
+* Wed Jul 14 2010 Dmitry Butskoy <Dmitry at Butskoy.name> - 5.4-22
+- rebuild with new gtkhtml3
+
+* Tue Jun 8 2010 Dmitry Butskoy <Dmitry at Butskoy.name> - 5.4-21
+- rebuild with new evolution-data-server
* Mon May 24 2010 Dmitry Butskoy <Dmitry at Butskoy.name> - 5.4-20
- change icon usage for Fedora 13 (#573809)
More information about the scm-commits
mailing list