Re: [Libreoffice] quick starter applet/systray defaults and various confusion

2010-11-25 Thread Michael Meeks
Hi Caolan,

On Thu, 2010-11-25 at 09:42 +, Caolán McNamara wrote:
> On Fri, 2010-11-19 at 15:37 +, Caolán McNamara wrote:
> > 3) We should probably instead modify InitializeQuickStartMode to
> > effectively || Sfx::ShutdownIcon::GetAutostart() with the IsQuickStart
> > command line argument.
> > 
> > If we were to do all through, the first thing people would notice is
> > that the quickstart applet/systray would appear to change from defaulted
> > on to defaulted off. 
> 
> I've pushed this change to master. If there is no complaints or horrific
> fallout I propose to cherrypick it for 3.3 in a few days.

That would be brilliant - I'm testing migration, and it's certainly an
underwhelming mis-feature that pops up and part-mangles that.

Thanks !

Michael.

-- 
 michael.me...@novell.com  <><, Pseudo Engineer, itinerant idiot


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] quick starter applet/systray defaults and various confusion

2010-11-25 Thread Michael Meeks

On Thu, 2010-11-25 at 13:14 +, Caolán McNamara wrote:
> This seems to work, e.g. the attached.

Looks great to me :-) [ still puzzling over the migration swamp
though ].

Regards,

Michael.

-- 
 michael.me...@novell.com  <><, Pseudo Engineer, itinerant idiot


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] quick starter applet/systray defaults and various confusion

2010-11-25 Thread Caolán McNamara
On Wed, 2010-11-24 at 20:50 +, Caolán McNamara wrote:
> On Wed, 2010-11-24 at 12:04 +0100, David Tardon wrote:
> > Does anyone have any clever idea how to prevent that?
> 
> How about we over-engineer and..
> 
> a) use osl_getModuleURLFromFunctionAddress or something of that nature
> to get the filename of the physical .so that we were originally dlopened
> on
> b) Get a GFileMonitor from gio via g_file_monitor for that .so and
> attach to its "changed" signal to get notified when that .so has been
> deleted, and turn off the quickstarter (or get it to disable its menus
> and sommat like "LibreOffice upgraded restart needed!" :-0) when that
> happens.

This seems to work, e.g. the attached.

C.
diff --git a/sfx2/source/appl/makefile.mk b/sfx2/source/appl/makefile.mk
index 72ac94a..a583102 100644
--- a/sfx2/source/appl/makefile.mk
+++ b/sfx2/source/appl/makefile.mk
@@ -53,6 +53,10 @@ CFLAGS+=-DENABLE_QUICKSTART_APPLET
 CDEFS+=-DDLL_NAME=libsfx$(DLLPOSTFIX)$(DLLPOST)
 .IF "$(ENABLE_SYSTRAY_GTK)"=="TRUE"
 PKGCONFIG_MODULES=gtk+-2.0
+.IF "$(ENABLE_GIO)"!=""
+PKGCONFIG_MODULES+=gio-2.0
+CDEFS+=-DENABLE_GIO
+.ENDIF
 .INCLUDE: pkg_config.mk
 CFLAGS+=$(PKGCONFIG_CFLAGS)
 CFLAGS+=-DENABLE_QUICKSTART_APPLET
diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx
index e31c32f..1b78f9b 100644
--- a/sfx2/source/appl/shutdowniconunx.cxx
+++ b/sfx2/source/appl/shutdowniconunx.cxx
@@ -19,6 +19,10 @@
 #include "shutdownicon.hxx"
 #endif
 
+#ifdef ENABLE_GIO
+#include 
+#endif
+
 // Cut/paste from vcl/inc/svids.hrc
 #define SV_ICON_SMALL_START 25000
 
@@ -39,6 +43,9 @@ static EggTrayIcon *pTrayIcon;
 static GtkWidget *pExitMenuItem = NULL;
 static GtkWidget *pOpenMenuItem = NULL;
 static GtkWidget *pDisableMenuItem = NULL;
+#ifdef ENABLE_GIO
+GFileMonitor* pMonitor = NULL;
+#endif
 
 static void open_url_cb( GtkWidget *, gpointer data )
 {
@@ -358,6 +365,22 @@ extern "C" {
 }
 }
 
+#ifdef ENABLE_GIO
+/*
+ * See rhbz#610103. If the quickstarter is running, then LibreOffice is
+ * upgraded, then the old quickstarter is still running, but is now unreliable
+ * as the old install has been deleted. A fairly intractable problem but we
+ * can avoid much of the pain if we turn off the quickstarter if we detect
+ * that it has been physically deleted.
+*/
+static void notify_file_changed(GFileMonitor * /*gfilemonitor*/, GFile * /*arg1*/,
+GFile * /*arg2*/, GFileMonitorEvent event_type, gpointer /*user_data*/)
+{
+if (event_type == G_FILE_MONITOR_EVENT_DELETED)
+exit_quickstarter_cb(GTK_WIDGET(pTrayIcon));
+}
+#endif
+
 void SAL_DLLPUBLIC_EXPORT plugin_init_sys_tray()
 {
 ::SolarMutexGuard aGuard;
@@ -403,6 +426,20 @@ void SAL_DLLPUBLIC_EXPORT plugin_init_sys_tray()
 
 g_signal_connect(GTK_WIDGET(pTrayIcon), "destroy",
 G_CALLBACK(exit_quickstarter_cb), NULL);
+
+#ifdef ENABLE_GIO
+GFile* pFile = NULL;
+rtl::OUString sLibraryFileUrl;
+if (osl::Module::getUrlFromAddress(plugin_init_sys_tray, sLibraryFileUrl))
+pFile = g_file_new_for_uri(rtl::OUStringToOString(sLibraryFileUrl, RTL_TEXTENCODING_UTF8).getStr());
+
+if (pFile)
+{
+if ((pMonitor = g_file_monitor_file(pFile, G_FILE_MONITOR_NONE, NULL, NULL)))
+g_signal_connect(pMonitor, "changed", (GCallback)notify_file_changed, NULL); 
+g_object_unref(pFile);
+}
+#endif
 }
 
 void SAL_DLLPUBLIC_EXPORT plugin_shutdown_sys_tray()
@@ -411,6 +448,17 @@ void SAL_DLLPUBLIC_EXPORT plugin_shutdown_sys_tray()
 if( !pTrayIcon )
 return;
 
+#ifdef ENABLE_GIO
+if (pMonitor)
+{
+g_signal_handlers_disconnect_by_func(pMonitor,
+(void*)notify_file_changed, pMonitor);
+g_file_monitor_cancel(pMonitor);
+g_object_unref(pMonitor);
+pMonitor = NULL;
+}
+#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.
@@ -419,7 +467,7 @@ void SAL_DLLPUBLIC_EXPORT plugin_shutdown_sys_tray()
  */
 GtkWidget* const pIcon = GTK_WIDGET( pTrayIcon );
 pTrayIcon = NULL;
-	gtk_widget_destroy( pIcon );
+gtk_widget_destroy( pIcon );
 
 pExitMenuItem = NULL;
 pOpenMenuItem = NULL;
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] quick starter applet/systray defaults and various confusion

2010-11-25 Thread Caolán McNamara
On Fri, 2010-11-19 at 15:37 +, Caolán McNamara wrote:
> 3) We should probably instead modify InitializeQuickStartMode to
> effectively || Sfx::ShutdownIcon::GetAutostart() with the IsQuickStart
> command line argument.
> 
> If we were to do all through, the first thing people would notice is
> that the quickstart applet/systray would appear to change from defaulted
> on to defaulted off. 

I've pushed this change to master. If there is no complaints or horrific
fallout I propose to cherrypick it for 3.3 in a few days.

C.



___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] quick starter applet/systray defaults and various confusion

2010-11-24 Thread Sebastian Spaeth
On Wed, 24 Nov 2010 21:49:38 -0500, Kevin Hunter wrote:
> Frankly, I think the 
> QuickStart solution was always the wrong answer.  It represents to me a 
> quick and (truly) dirty solution.  I believe the "correct" answer is to 
> streamline LO.  However, the latter solution involves a bit more 
> diligence (i.e. more work :-( ).

I think everyone agrees that this is the right solution and would make
quickstart redundant. However, until we are there, I am sure some
appreciate the quickstarter.

On a related note, is some profiling results available, looking at the
startup of a, say, typical writer document? I know that the GNOME guys
had nice time-tables showing what happened when. Also it would be
interesting to see what functions are run and how often until the doc
shows up?

What do people recommend for that? oprofile, valgrind, trace, or
whatever? And are some resulting profiles available somewhere?

Each second squeezed out of the startup path are a million seconds
accumulated of all users' starts.

Sebastian


pgp6Iv32jVHBD.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] quick starter applet/systray defaults and various confusion

2010-11-24 Thread Kevin Hunter

At 6:51am -0500 Wed, 24 Nov 2010, Andrew wrote:

One other discussion I want to start is that do we actually
need/want the quickstarter? From my own experience it is annoying and
not needed - why should an office suite be in the system tray, it is
not needed.


I have only my memory as a young person/non-developer, so take what I 
say with a grain of salt: Originally, I believe the idea was to compete 
with how much faster MSOffice started.  OpenOffice was *always* slow in 
comparison to MSOffice (on Windows), and the QuickStart solution was 
meant to hide the loading time of the major parts of OpenOffice in the 
computer startup.  (The idea was that a standard workflow was to turn on 
the computer and walk away for five minutes, because Windows took so 
long to boot anyway; besides MSOffice "cheated" by using Windows 
internals -- or so went a common rumor.)



Maybe the best way to go about this discussion is to ask - "Is there
anyone that wants to keep the Quickstarter?"


This is a question I wanted to ask in a previous thread as well but it 
wasn't pertinent then; I'm glad you brought it up.  Frankly, I think the 
QuickStart solution was always the wrong answer.  It represents to me a 
quick and (truly) dirty solution.  I believe the "correct" answer is to 
streamline LO.  However, the latter solution involves a bit more 
diligence (i.e. more work :-( ).


So, ideally, I believe the QuickStart solution would be removed.  I 
don't like it, and personally, I turn it off whenever it is on by 
default: I use my resources, and I don't want them forcibly (pre)wasted.


Kevin
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] quick starter applet/systray defaults and various confusion

2010-11-24 Thread Caolán McNamara
On Wed, 2010-11-24 at 12:04 +0100, David Tardon wrote:
> Does anyone have any clever idea how to prevent that?

How about we over-engineer and..

a) use osl_getModuleURLFromFunctionAddress or something of that nature
to get the filename of the physical .so that we were originally dlopened
on
b) Get a GFileMonitor from gio via g_file_monitor for that .so and
attach to its "changed" signal to get notified when that .so has been
deleted, and turn off the quickstarter (or get it to disable its menus
and sommat like "LibreOffice upgraded restart needed!" :-0) when that
happens.

C.

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] quick starter applet/systray defaults and various confusion

2010-11-24 Thread rugby471
On 24 November 2010 11:04, David Tardon  wrote:
> Yet another argument for quickstarter not being on by default is that it
> doesn't survive update, i.e.,
>
> 1. start quickstarter
> 2. update OO.o (or LibO)
> 3. try to create new text document through quickstarter (or click on
>   existing one, or... do whatever else)
> -> crash (see https://bugzilla.redhat.com/show_bug.cgi?id=610103;
>   63 users in CC currently).
>
> Does anyone have any clever idea how to prevent that?
>

One other discussion I want to start is that do we actually need/want
the quickstarter? From my own experience it is annoying and not needed
- why should an office suite be in the system tray, it is not needed.

Maybe the best way to go about this discussion is to ask - "Is there
anyone that wants to keep the Quickstarter?"

--
Andrew
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] quick starter applet/systray defaults and various confusion

2010-11-24 Thread David Tardon
Yet another argument for quickstarter not being on by default is that it
doesn't survive update, i.e.,

1. start quickstarter
2. update OO.o (or LibO)
3. try to create new text document through quickstarter (or click on
   existing one, or... do whatever else)
-> crash (see https://bugzilla.redhat.com/show_bug.cgi?id=610103;
   63 users in CC currently).

Does anyone have any clever idea how to prevent that?

D.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] quick starter applet/systray defaults and various confusion

2010-11-19 Thread Andrew
On 19/11/10 15:37, Caolán McNamara wrote:
> There is something of a mess going on at the moment I think.
> 
> a)
> 
> If you look at desktop/source/app/app.cxx see
> DoRestartActionsIfNecessary
> 
> If there is no ~/.libreoffice dir, then on first start we register the
> extensions, this triggers a restart of the app.
> 
> Simply because there is no explict -noquickstart then the quickstarter
> is launched. Once the quickstarter is launched it will reappear on every
> login because there we're passing "true, true" to the quickstarter, i.e.
> "start now", "always start next time"
> 
> Now, disable the quickstarter, shutdown LO and
> 
> rm -rf ~/.libreoffice/3/user/extensions/bundled to emulate adding a new
> bundled extension.
> 
> and launch LO again, the quickstarter should reappear, i.e. even though
> it was disabled I believe adding a new extension to LO and being forced
> to restart LO will reenable it.
> 
> b) If you launch LO, enable the quickstarter and it appears in the
> systray. Now exit the quickstarter and exit LO, restart LO, and no entry
> in the systray. Logout, login, and ta-da its back.
> 
> So, I reckon that:
> 
> 1) DeRestartActionsIfNecessary at a minimum should only *show* the
> quickstarter, not set it to restart next time. i.e. single argument
> "true" case, not "true, true". Which is what InitializeQuickStartMode
> does.
> 2) DeRestartActionsIfNecessary is actually bogus, and its an attempt to
> fix (b) for the specific restart-after-updated-extensions case, but
> doesn't address the normal case. And even with 1 will display the
> quickstarter applet regardless of your settings if you happen to add a
> new extension.
> 3) We should probably instead modify InitializeQuickStartMode to
> effectively || Sfx::ShutdownIcon::GetAutostart() with the IsQuickStart
> command line argument so that "b" gets fixed.
> 
> If we were to do all through, the first thing people would notice is
> that the quickstart applet/systray would appear to change from defaulted
> on to defaulted off. So on a fresh install, do we want the systray
> quickstarter to be enabled or disabled by default ?

Disabled by default, don't be intrusive by default :)

-- 
Andrew
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice