[openoffice.org/f14/master] Resolves: rhbz#668349 Backport replace libegg with gtkStatusicon

Caolan McNamara caolanm at fedoraproject.org
Fri Jan 14 12:01:35 UTC 2011


commit 7b98b9fa5a85a9b89ececcb7c593ab8e839fa2a7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jan 14 12:01:22 2011 +0000

    Resolves: rhbz#668349 Backport replace libegg with gtkStatusicon

 ...ice.org-3.3.0.rh668349.backportstatusicon.patch |  212 ++++++++++++++++++++
 openoffice.org.spec                                |    7 +-
 2 files changed, 218 insertions(+), 1 deletions(-)
---
diff --git a/openoffice.org-3.3.0.rh668349.backportstatusicon.patch b/openoffice.org-3.3.0.rh668349.backportstatusicon.patch
new file mode 100644
index 0000000..2f5e3a7
--- /dev/null
+++ b/openoffice.org-3.3.0.rh668349.backportstatusicon.patch
@@ -0,0 +1,212 @@
+diff -ru sfx2.orig/prj/build.lst sfx2/prj/build.lst
+--- sfx2.orig/prj/build.lst	2011-01-07 05:28:51.000000000 +0000
++++ sfx2/prj/build.lst	2011-01-10 12:03:52.000000000 +0000
+@@ -1,4 +1,4 @@
+-sf      sfx2    :    l10n idl basic xmlscript framework readlicense_oo shell setup_native sax SYSTRAY_GTK:libegg LIBXML2:libxml2 NULL
++sf      sfx2    :    l10n idl basic xmlscript framework readlicense_oo shell setup_native sax LIBXML2:libxml2 NULL
+ sf	sfx2									usr1	-	all	sf_mkout NULL
+ sf	sfx2\inc								nmake	-	all	sf_inc NULL
+ sf	sfx2\prj								get		-	all	sf_prj NULL
+diff -ru sfx2.orig/source/appl/shutdowniconunx.cxx sfx2/source/appl/shutdowniconunx.cxx
+--- sfx2.orig/source/appl/shutdowniconunx.cxx	2011-01-10 12:18:38.000000000 +0000
++++ sfx2/source/appl/shutdowniconunx.cxx	2011-01-10 12:03:52.000000000 +0000
+@@ -7,7 +7,6 @@
+ 
+ #include <gtk/gtk.h>
+ #include <glib.h>
+-#include <eggtray/eggtrayicon.h>
+ #include <vos/mutex.hxx>
+ #include <vcl/bitmapex.hxx>
+ #include <vcl/bmpacc.hxx>
+@@ -40,7 +39,7 @@
+ using namespace ::osl;
+ 
+ static ResMgr *pVCLResMgr;
+-static EggTrayIcon *pTrayIcon;
++static GtkStatusIcon*pTrayIcon;
+ static GtkWidget *pExitMenuItem = NULL;
+ static GtkWidget *pOpenMenuItem = NULL;
+ static GtkWidget *pDisableMenuItem = NULL;
+@@ -76,7 +75,6 @@
+ {
+     if (pTrayIcon)
+     {
+-        egg_tray_icon_cancel_message (pTrayIcon, 1 );
+         plugin_shutdown_sys_tray();
+         //terminate may cause this .so to be unloaded. So we must be hands off
+         //all calls into this .so after this call
+@@ -305,46 +303,6 @@
+ 	gtk_widget_set_sensitive( pDisableMenuItem, !bModal);
+ }
+ 
+-extern "C" {
+-static void
+-layout_menu( GtkMenu *menu,
+-			 gint *x, gint *y, gboolean *push_in,
+-			 gpointer )
+-{
+-	GtkRequisition req;
+-	GtkWidget *ebox = gtk_bin_get_child(GTK_BIN( pTrayIcon ));
+-
+-	gtk_widget_size_request( GTK_WIDGET( menu ), &req );
+-#if GTK_CHECK_VERSION(2,90,0)
+-	gdk_window_get_origin( gtk_widget_get_window(ebox), x, y );
+-
+-	GtkAllocation allocation;
+-	gtk_widget_get_allocation(ebox, &allocation);
+-
+-	(*x) += allocation.x;
+-	(*y) += allocation.y;
+-#else
+-	gdk_window_get_origin( ebox->window, x, y );
+-
+-	(*x) += ebox->allocation.x;
+-	(*y) += ebox->allocation.y;
+-#endif
+-
+-	if (*y >= gdk_screen_get_height (gtk_widget_get_screen (ebox)) / 2)
+-		(*y) -= req.height;
+-	else
+-	{
+-#if GTK_CHECK_VERSION(2,90,0)
+-		(*y) += allocation.height;
+-#else
+-		(*y) += ebox->allocation.height;
+-#endif
+-	}
+-
+-	*push_in = TRUE;
+-}
+-}
+-
+ static gboolean display_menu_cb( GtkWidget *,
+ 								 GdkEventButton *event, GtkWidget *pMenu )
+ {
+@@ -366,21 +324,12 @@
+ 	refresh_menu( pMenu );
+ 
+ 	gtk_menu_popup( GTK_MENU( pMenu ), NULL, NULL,
+-					layout_menu, NULL, 0, event->time );
++					gtk_status_icon_position_menu, pTrayIcon,
++					0, event->time );
+ 
+ 	return TRUE;
+ }
+ 
+-extern "C" {
+-	static gboolean
+-	show_at_idle( gpointer )
+-	{
+-		::vos::OGuard aGuard( Application::GetSolarMutex() );
+-		gtk_widget_show_all( GTK_WIDGET( pTrayIcon ) );
+-		return FALSE;
+-	}
+-}
+-
+ #ifdef ENABLE_GIO
+ /*
+  * See rhbz#610103. If the quickstarter is running, then LibreOffice is
+@@ -393,7 +342,7 @@
+     GFile * /*arg2*/, GFileMonitorEvent event_type, gpointer /*user_data*/)
+ {
+     if (event_type == G_FILE_MONITOR_EVENT_DELETED)
+-        exit_quickstarter_cb(GTK_WIDGET(pTrayIcon));
++        exit_quickstarter_cb(NULL);
+ }
+ #endif
+ 
+@@ -411,42 +360,25 @@
+ 			pShutdownIcon->GetResString( STR_QUICKSTART_TIP ),
+ 			RTL_TEXTENCODING_UTF8 );
+ 
+-	pTrayIcon = egg_tray_icon_new( aLabel );
+-
+-	GtkWidget *pParent = gtk_event_box_new();
+-#if GTK_CHECK_VERSION(2,90,0)
+-	gtk_widget_set_tooltip_text (pParent, aLabel );
+-#else
+-	GtkTooltips *pTooltips = gtk_tooltips_new();
+-	gtk_tooltips_set_tip( GTK_TOOLTIPS( pTooltips ), pParent, aLabel, NULL );
+-#endif
+-
+-	GtkWidget *pIconImage = gtk_image_new();
+-	gtk_container_add( GTK_CONTAINER( pParent ), pIconImage );
+-
+ 	pVCLResMgr = CREATEVERSIONRESMGR( vcl );
+ 
+ 	GdkPixbuf *pPixbuf = ResIdToPixbuf( SV_ICON_ID_OFFICE );
+-	gtk_image_set_from_pixbuf( GTK_IMAGE( pIconImage ), pPixbuf );
++	pTrayIcon = gtk_status_icon_new_from_pixbuf(pPixbuf);
+ 	g_object_unref( pPixbuf );
+ 
++	gtk_status_icon_set_title(pTrayIcon, aLabel);
++	gtk_status_icon_set_tooltip_text(pTrayIcon, aLabel);
++
+ 	GtkWidget *pMenu = gtk_menu_new();
+ 	g_signal_connect (pMenu, "deactivate",
+ 					  G_CALLBACK (menu_deactivate_cb), NULL);
+-	g_signal_connect( pParent, "button_press_event",
+-					  G_CALLBACK( display_menu_cb ), pMenu );
+-	gtk_container_add( GTK_CONTAINER( pTrayIcon ), pParent );
+-
+-	// Show at idle to avoid artefacts at startup
+-	g_idle_add (show_at_idle, (gpointer) pTrayIcon);
++	g_signal_connect(pTrayIcon,  "button_press_event",
++			 G_CALLBACK(display_menu_cb), pMenu);
+ 
+ 	// disable shutdown
+ 	pShutdownIcon->SetVeto( true );
+ 	pShutdownIcon->addTerminateListener();
+ 
+-    g_signal_connect(GTK_WIDGET(pTrayIcon), "destroy",
+-            G_CALLBACK(exit_quickstarter_cb), NULL);
+-
+ #ifdef ENABLE_GIO
+     GFile* pFile = NULL;
+     rtl::OUString sLibraryFileUrl;
+@@ -479,15 +411,8 @@
+     }
+ #endif
+ 
+-    /* we have to set pTrayIcon to NULL now, because gtk_widget_destroy
+-     * causes calling exit_quickstarter_cb (which then calls this func.)
+-     * again -> crash.
+-     * As an alternative, we could deregister the "destroy" signal here,
+-     * but this is simpler .-)
+-     */
+-    GtkWidget* const pIcon = GTK_WIDGET( pTrayIcon );
++	g_object_unref(pTrayIcon);
+ 	pTrayIcon = NULL;
+-    gtk_widget_destroy( pIcon );
+ 
+ 	pExitMenuItem = NULL;
+ 	pOpenMenuItem = NULL;
+diff -ru sfx2.orig/util/makefile.mk sfx2/util/makefile.mk
+--- sfx2.orig/util/makefile.mk	2011-01-07 05:28:51.000000000 +0000
++++ sfx2/util/makefile.mk	2011-01-10 12:03:52.000000000 +0000
+@@ -148,7 +148,7 @@
+ SHL3LIBS=$(SLB)$/quickstart.lib
+ SHL3DEPN=$(SHL1IMPLIBN) $(SHL1TARGETN)
+ # libs for gtk plugin
+-SHL3STDLIBS=$(SHL1STDLIBS) $(SFX2LIB) $(EGGTRAYLIB)
++SHL3STDLIBS=$(SHL1STDLIBS) $(SFX2LIB)
+ SHL3STDLIBS+=$(PKGCONFIG_LIBS:s/ -lpangoxft-1.0//)
+ # hack for faked SO environment
+ .IF "$(PKGCONFIG_ROOT)"!=""
+diff -ru scp2.orig/source/ooo/file_library_ooo.scp scp2/source/ooo/file_library_ooo.scp
+--- scp2.orig/source/ooo/file_library_ooo.scp	2011-01-10 12:02:43.000000000 +0000
++++ scp2/source/ooo/file_library_ooo.scp	2011-01-10 12:03:29.000000000 +0000
+@@ -218,13 +218,6 @@
+ #ifdef UNX
+ #ifdef ENABLE_GTK
+ #ifdef ENABLE_SYSTRAY_GTK
+-File gid_File_Lib_Egg_Tray
+- TXT_FILE_BODY;
+- Styles = (PACKED);
+- Dir = SCP2_OOO_BIN_DIR;
+- Name = STRING(CONCAT3(libeggtray,DLLPOSTFIX,UNXSUFFIX));
+-End
+-
+ File gid_File_Lib_QStart_Gtk
+     Name = LIBNAME(qstart_gtk);
+     TXT_FILE_BODY;
diff --git a/openoffice.org.spec b/openoffice.org.spec
index 47ff244..44fe833 100644
--- a/openoffice.org.spec
+++ b/openoffice.org.spec
@@ -1,6 +1,6 @@
 %define oootag OOO330
 %define ooomilestone 19
-%define rh_rpm_release 2
+%define rh_rpm_release 3
 
 # rhbz#465664 jar-repacking breaks help by reordering META-INF/MANIFEST.MF
 %define __jar_repack %{nil}
@@ -155,6 +155,7 @@ Patch71: 0001-Avoid-double-paste-when-pasting-text-into-cell-comme.patch
 Patch72: 0001-Resolves-rhbz-660342-Undo-Redo-crash-with-postits.patch
 Patch73: 0001-Resolves-rhbz-666088-clean-up-search-cache-singleton.patch
 Patch74: 0001-rhbz-659394-avoid-mangling-internal-state-in-case-of.patch
+Patch75: openoffice.org-3.3.0.rh668349.backportstatusicon.patch
 
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
 %define instdir %{_libdir}
@@ -1726,6 +1727,7 @@ cp -p %{SOURCE5} external/unowinreg/unowinreg.dll
 %patch72 -p1 -b .rhbz-660342-Undo-Redo-crash-with-postits.patch
 %patch73 -p1 -b .rhbz-666088-clean-up-search-cache-singleton.patch
 %patch74 -p1 -b .rhbz-659394-avoid-mangling-internal-state-in-case-of.patch
+%patch75 -p1 -b .rh668349.backportstatusicon.patch
 touch scripting/source/pyprov/delzip
 touch scripting/util/provider/beanshell/delzip
 touch scripting/util/provider/javascript/delzip
@@ -3922,6 +3924,9 @@ unopkg remove --shared org.openoffice.legacy.ScriptProviderForPython.zip > /dev/
 %endif
 
 %changelog
+* Fri Jan 14 2011 Caolán McNamara <caolanm at redhat.com>- 1:3.3.0-19.3-UNBUILT
+- Resolves: rhbz#668349 Backport replace libegg with gtkStatusicon
+
 * Wed Jan 12 2011 David Tardon <dtardon at redhat.com>- 1:3.3.0-19.2
 - Resolves: rhbz#659394 avoid mangling internal state in case of UNO
   exception


More information about the scm-commits mailing list