Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


On Mon, Apr 29, 2013 at 2:10 PM, Stephan Bergmann <sbergman@redhat.com>wrote:

On 04/29/2013 10:31 AM, Jesús Corrius wrote:

2. Change the thread Application User Model ID when launching a new
component from inside LibO.


Keeping track of per-thread AppUserModelIDs might be tricky (e.g., for
remote UNO access), but documentation like <http://msdn.microsoft.com/en-*
*us/library/windows/desktop/**dd378459%28v=vs.85%29.aspx<http://msdn.microsoft.com/en-us/library/windows/desktop/dd378459%28v=vs.85%29.aspx>>
"Application User Model IDs (AppUserModelIDs)" makes it look like any
per-process setting is overridden per-window rather than per-thread anyway?


I found setting the System.AppUserModel.ID property of the application's
shortcut file not necessary provided that the file types are correctly
mapped in the registry (we already have so) and the launcher sets the
AppUserModelID during startup (I removed the code on Friday but it will be
back soon). If we set different IDs per launcher (as it is currently in
4.0.x), everything seems to work perfectly fine if you launch the documents
by double clicking in the Windows Explorer icon (you have the recent
documents without calling SHAddToRecentDocs and you have a "Jump List" menu
-- I don't like to call it Jump list in the case because it's just the one
provided by Windows, that is we don't really provide one, but i may be a
little bit picky here).

On the other side, if you then open --double click-- a new document
(suppose you open a new spreadsheet and you have a write document already
open) the window grouping doesn't work, although the AppUserModelID is set
correctly by the launcher. Also the icon on the task bar is not the one of
a calc document, but just a plain LibreOffice icon.

So during application startup (i.e launcher) we
call SetCurrentProcessExplicitAppUserModelID("TheDocumentFoundation.LibreOffice")
provided that the Shell32.dll version is equal or higher than 6.1. I guess
if we wanted to have "separate applications" we could
call SHGetPropertyStoreForWindow for each different app window and set the
AppUserModelID, for example, to "TheDocumentFoundation.LibreOffice.Writer".
This would make setting a different ID in the launchers unnecessary,
although we could need them there to personalize the Jump List menu.

Also then we should call SHAddToRecentDocs explicitly. But we could do the
trick to not prevent the file dialog to call it, in this way all the
documents would be added to the "TheDocumentFoundation.LibreOffice" one and
also to the "TheDocumentFoundation.LibreOffice.Writer" one. In this way,
the start center, associated only with the main ID could act as a place to
store *all* recent documents, while the writer shortcut could only store
the list of recent writer documents.

-- 
Jesús Corrius <jesus@softcatala.org>

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.