online.git: windows/coda

0 views
Skip to first unread message

"Andras Timar (via cogerrit)"

unread,
May 18, 2026, 7:35:13 AM (7 days ago) May 18
to collaboraon...@googlegroups.com
windows/coda/AppxManifest.xml.in | 148 ++++++++++++++++++++++++++++-----------
1 file changed, 107 insertions(+), 41 deletions(-)

New commits:
commit 50324070906c5f604ff746021ef9ad6c758f1019
Author: Andras Timar <andras...@collabora.com>
AuthorDate: Fri May 15 00:31:20 2026 +0200
Commit: Miklos Vajna <vmi...@collabora.com>
CommitDate: Mon May 18 11:34:17 2026 +0000

coda: wire shell extensions through AppxManifest.xml

Promote the AppxManifest to a Windows 10 1809+ schema and bind the three
shell-extension handlers to the ODF file types:

- Add namespaces xmlns:com, xmlns:desktop2, xmlns:uap3 plus matching
IgnorableNamespaces. Bump TargetDeviceFamily MinVersion
10.0.10240.0 -> 10.0.17763.0 (Win10 1809, the build Microsoft treats
as the baseline for end-to-end MSIX shell-extension scenarios).
MaxVersionTested 10.0.19041.508 -> 10.0.22621.0 (Win11 22H2).

- Add a <com:Extension Category="windows.comServer"> block registering
each of the three handler CLSIDs as a <com:SurrogateServer> with
<com:Class Path> pointing at program\\shlxthdl\\{shlxthdl,propertyhdl,
odffilter}.dll. Do NOT set SystemSurrogate - that attribute is for
IPreviewHandler classes only and Windows silently drops the entire
<com:Extension> block for non-IPreviewHandler classes on Win11 26200
if it is present. Without the attribute the classes register as
ordinary in-proc DLLs hosted by dllhost.exe; the shell picks
prevhost.exe for thumbnail callbacks and SearchFilterHost.exe for
IFilter callbacks on its own.

- Promote the 19 ODF / StarOffice-legacy FileTypeAssociation entries to
uap3:FileTypeAssociation and give them desktop2:ThumbnailHandler +
desktop2:DesktopPropertyHandler children pointing at the thumbnail
and property CLSIDs.

- Split calc_ods_flatxml into a .fods-only entry (with the property
handler binding) and a new calc_xml_open_with FTA covering .xml
alone (no handlers, just the "Open With" association). The flat-ODF
FTAs are given the desktop2:DesktopPropertyHandler child only - no
thumbnail handler, since flat ODF has no embedded thumbnail PNG.

Signed-off-by: Andras Timar <andras...@collabora.com>
Change-Id: Iab96e025c562cb700a27abb95f9e08a16ff66f26
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2673
Reviewed-by: Miklos Vajna <vmi...@collabora.com>

diff --git a/windows/coda/AppxManifest.xml.in b/windows/coda/AppxManifest.xml.in
index c0f065c0bf73..a612a5e4222d 100644
--- a/windows/coda/AppxManifest.xml.in
+++ b/windows/coda/AppxManifest.xml.in
@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
+ xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
- xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10">
+ xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
+ xmlns:desktop2="http://schemas.microsoft.com/appx/manifest/desktop/windows10/2"
+ xmlns:com="http://schemas.microsoft.com/appx/manifest/com/windows10"
+ IgnorableNamespaces="uap uap3 rescap desktop desktop2 com">
<Identity Name="CollaboraProductivityLtd.CollaboraOfficeDesktop" Version="%VER" Publisher="CN=E9F172FF-9203-4DB8-A589-184C7A58C071" ProcessorArchitecture="%ARCH"/>
<Properties>
<DisplayName>Collabora Office Desktop</DisplayName>
@@ -13,7 +17,7 @@
<Resource Language="en-US"/>
%RES </Resources>
<Dependencies>
- <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.10240.0" MaxVersionTested="10.0.19041.508"/>
+ <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.22621.0"/>
<PackageDependency Name="Microsoft.VCLibs.140.00.UWPDesktop" MinVersion="14.0.24210.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"/>
</Dependencies>
<Capabilities>
@@ -24,23 +28,51 @@
<Application Id="CODA" Executable="program/Collabora Office.exe" EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements DisplayName="Collabora Office Desktop" Description="sofficeUapDescription" Square150x150Logo="Assets/Square150x150Logo.png" Square44x44Logo="Assets/Square44x44Logo.png" BackgroundColor="white"/>
<Extensions>
- <uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="calc8">
+ <!-- Register the three shell-extension CLSIDs as in-proc DLLs hosted
+ by the default COM surrogate (dllhost.exe). The shell picks the
+ right host process for each interface itself: prevhost.exe for
+ thumbnails, SearchFilterHost.exe for the IFilter, etc.
+ SystemSurrogate="PreviewHost" cannot be used here - it is for
+ IPreviewHandler classes only, and adding it causes Windows to
+ silently drop the entire <com:Extension> at install time.
+ Per-extension binding for the thumbnail and property handlers is
+ attached to each ODF FileTypeAssociation below; the IFilter has
+ no documented manifest binding and is wired up at runtime via
+ HKCU\Software\Classes by the CODA launcher. -->
+ <com:Extension Category="windows.comServer">
+ <com:ComServer>
+ <com:SurrogateServer DisplayName="Collabora Office Thumbnail Handler">
+ <com:Class Id="8DD6FA24-F2C1-409F-B879-61A829643EB2" Path="program\shlxthdl\shlxthdl.dll" ThreadingModel="STA"/>
+ </com:SurrogateServer>
+ <com:SurrogateServer DisplayName="Collabora Office Property Handler">
+ <com:Class Id="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70" Path="program\shlxthdl\propertyhdl.dll" ThreadingModel="STA"/>
+ </com:SurrogateServer>
+ <com:SurrogateServer DisplayName="Collabora Office ODF Filter">
+ <com:Class Id="DEB88601-6245-4803-81A5-13082BB738FF" Path="program\shlxthdl\odffilter.dll" ThreadingModel="STA"/>
+ </com:SurrogateServer>
+ </com:ComServer>
+ </com:Extension>
+ <uap:Extension Category="windows.fileTypeAssociation">
+ <uap3:FileTypeAssociation Name="calc8">
<uap:DisplayName>Calc 8</uap:DisplayName>
<uap:Logo>Assets/spreadsheet.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.ods</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="calc8_template">
+ <uap3:FileTypeAssociation Name="calc8_template">
<uap:DisplayName>Calc 8 Template</uap:DisplayName>
<uap:Logo>Assets/spreadsheet-template.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.ots</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
<uap:FileTypeAssociation Name="calc_dbase">
@@ -114,22 +146,26 @@
</uap:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="calc_staroffice_xml_calc">
+ <uap3:FileTypeAssociation Name="calc_staroffice_xml_calc">
<uap:DisplayName>Calc 6.0</uap:DisplayName>
<uap:Logo>Assets/spreadsheet.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.sxc</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="calc_staroffice_xml_calc_template">
+ <uap3:FileTypeAssociation Name="calc_staroffice_xml_calc_template">
<uap:DisplayName>Calc 6.0 Template</uap:DisplayName>
<uap:Logo>Assets/spreadsheet-template.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.stc</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
<uap:FileTypeAssociation Name="calc_sylk">
@@ -160,22 +196,26 @@
</uap:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="draw8">
+ <uap3:FileTypeAssociation Name="draw8">
<uap:DisplayName>Draw 8</uap:DisplayName>
<uap:Logo>Assets/presentation.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.odg</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="draw8_template">
+ <uap3:FileTypeAssociation Name="draw8_template">
<uap:DisplayName>Draw 8 Template</uap:DisplayName>
<uap:Logo>Assets/drawing-template.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.otg</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
<uap3:FileTypeAssociation Name="draw_odg_flatxml">
@@ -188,22 +228,26 @@
</uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="draw_staroffice_xml_draw">
+ <uap3:FileTypeAssociation Name="draw_staroffice_xml_draw">
<uap:DisplayName>OpenOffice.org 1.0 Drawing</uap:DisplayName>
<uap:Logo>Assets/drawing.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.sxd</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="draw_staroffice_xml_draw_template">
+ <uap3:FileTypeAssociation Name="draw_staroffice_xml_draw_template">
<uap:DisplayName>Draw 6.0 Template</uap:DisplayName>
<uap:Logo>Assets/drawing-template.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.std</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
<uap:FileTypeAssociation Name="generic_html">
@@ -239,22 +283,26 @@
</uap:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="impress8">
+ <uap3:FileTypeAssociation Name="impress8">
<uap:DisplayName>Impress 8</uap:DisplayName>
<uap:Logo>Assets/presentation.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.odp</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="impress8_template">
+ <uap3:FileTypeAssociation Name="impress8_template">
<uap:DisplayName>Impress 8 Template</uap:DisplayName>
<uap:Logo>Assets/presentation-template.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.otp</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
<uap:FileTypeAssociation Name="impress_ms_powerpoint_97">
@@ -325,22 +373,26 @@
</uap:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="impress_staroffice_xml_impress">
+ <uap3:FileTypeAssociation Name="impress_staroffice_xml_impress">
<uap:DisplayName>OpenOffice.org 1.0 Presentation</uap:DisplayName>
<uap:Logo>Assets/presentation.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.sxi</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="impress_staroffice_xml_impress_template">
+ <uap3:FileTypeAssociation Name="impress_staroffice_xml_impress_template">
<uap:DisplayName>Impress 6.0 Template</uap:DisplayName>
<uap:Logo>Assets/presentation-template.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.sti</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
<uap:FileTypeAssociation Name="ms_excel_2007_xml_template">
@@ -381,31 +433,37 @@
</uap:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="writer8">
+ <uap3:FileTypeAssociation Name="writer8">
<uap:DisplayName>Writer 8</uap:DisplayName>
<uap:Logo>Assets/text.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.odt</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="writer8_template">
+ <uap3:FileTypeAssociation Name="writer8_template">
<uap:DisplayName>Writer 8 Template</uap:DisplayName>
<uap:Logo>Assets/text-template.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.ott</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="writerglobal8">
+ <uap3:FileTypeAssociation Name="writerglobal8">
<uap:DisplayName>Writer 8 Master Document</uap:DisplayName>
<uap:Logo>Assets/master-document.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.odm</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
<uap:FileTypeAssociation Name="writerglobal8_template">
@@ -417,22 +475,26 @@
</uap:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="writerweb8_writer_template">
+ <uap3:FileTypeAssociation Name="writerweb8_writer_template">
<uap:DisplayName>Writer/Web 8 Template</uap:DisplayName>
<uap:Logo>Assets/text-template.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.oth</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="writer_globaldocument_staroffice_xml_writer_globaldocument">
+ <uap3:FileTypeAssociation Name="writer_globaldocument_staroffice_xml_writer_globaldocument">
<uap:DisplayName>Writer 6.0 Master Document</uap:DisplayName>
<uap:Logo>Assets/master-document.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.sxg</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
<uap:FileTypeAssociation Name="writer_ms_word_2003_xml">
@@ -510,22 +572,26 @@
</uap:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="writer_staroffice_xml_writer">
+ <uap3:FileTypeAssociation Name="writer_staroffice_xml_writer">
<uap:DisplayName>OpenOffice.org 1.0 Text Document</uap:DisplayName>
<uap:Logo>Assets/text.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.sxw</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
- <uap:FileTypeAssociation Name="writer_staroffice_xml_writer_template">
+ <uap3:FileTypeAssociation Name="writer_staroffice_xml_writer_template">
<uap:DisplayName>Writer 6.0 Template</uap:DisplayName>
<uap:Logo>Assets/text-template.png</uap:Logo>
<uap:SupportedFileTypes>
<uap:FileType>.stw</uap:FileType>
</uap:SupportedFileTypes>
- </uap:FileTypeAssociation>
+ <desktop2:ThumbnailHandler Clsid="8DD6FA24-F2C1-409F-B879-61A829643EB2"/>
+ <desktop2:DesktopPropertyHandler Clsid="90B47FF6-F60A-43CD-9BAD-1BD9F5CA2E70"/>
+ </uap3:FileTypeAssociation>
</uap:Extension>
</Extensions>
</Application>

"Andras Timar (via cogerrit)"

unread,
May 18, 2026, 4:28:54 PM (7 days ago) May 18
to collaboraon...@googlegroups.com
windows/coda/CODA/CODA.vcxproj | 12 ---
windows/coda/CODA/CODA.vcxproj.filters | 3
windows/coda/CODA/packages.config | 5 -
windows/coda/WebDriverThing/WebDriverThing.csproj | 67 ++++------------------
windows/coda/WebDriverThing/packages.config | 16 -----
5 files changed, 17 insertions(+), 86 deletions(-)

New commits:
commit c9a8fcbd8e34bf8e01d26d9ec155f4d736aa0dcb
Author: Andras Timar <andras...@collabora.com>
AuthorDate: Mon May 18 22:28:07 2026 +0200
Commit: Andras Timar <andras...@collabora.com>
CommitDate: Mon May 18 22:28:07 2026 +0200

windows: migrate CODA and WebDriverThing to PackageReference

packages.config-style NuGet references are not restored by
'msbuild -restore' (only PackageReference is), so Jenkins clean
builds failed with the missing Microsoft.Web.WebView2.targets
import unless a separate 'nuget restore' step ran first. Replace
both projects' packages.config with inline <PackageReference>
ItemGroups and drop the hand-written packages\*\build\*.targets
imports plus the EnsureNuGetPackageBuildImports guard; NuGet now
generates those imports at restore time from the global cache.

Signed-off-by: Andras Timar <andras...@collabora.com>
Change-Id: I75c742be53b9da54259405c66072050cb754a20b

diff --git a/windows/coda/CODA/CODA.vcxproj b/windows/coda/CODA/CODA.vcxproj
index 9e2d5ee06b11..7ec9dc8aec84 100644
--- a/windows/coda/CODA/CODA.vcxproj
+++ b/windows/coda/CODA/CODA.vcxproj
@@ -342,18 +342,10 @@
<Image Include="CODA.ico" />
</ItemGroup>
<ItemGroup>
- <None Include="packages.config" />
+ <PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3719.77" />
+ <PackageReference Include="Microsoft.Windows.ImplementationLibrary" Version="1.0.260126.7" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
- <Import Project="..\packages\Microsoft.Web.WebView2.1.0.3719.77\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.3719.77\build\native\Microsoft.Web.WebView2.targets')" />
- <Import Project="..\packages\Microsoft.Windows.ImplementationLibrary.1.0.260126.7\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\packages\Microsoft.Windows.ImplementationLibrary.1.0.260126.7\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
</ImportGroup>
- <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
- <PropertyGroup>
- <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
- </PropertyGroup>
- <Error Condition="!Exists('..\packages\Microsoft.Web.WebView2.1.0.3719.77\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Web.WebView2.1.0.3719.77\build\native\Microsoft.Web.WebView2.targets'))" />
- <Error Condition="!Exists('..\packages\Microsoft.Windows.ImplementationLibrary.1.0.260126.7\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.ImplementationLibrary.1.0.260126.7\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
- </Target>
</Project>
diff --git a/windows/coda/CODA/CODA.vcxproj.filters b/windows/coda/CODA/CODA.vcxproj.filters
index 3ee725f90cb2..5a8eaa90059a 100644
--- a/windows/coda/CODA/CODA.vcxproj.filters
+++ b/windows/coda/CODA/CODA.vcxproj.filters
@@ -160,9 +160,6 @@
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
- <ItemGroup>
- <None Include="packages.config" />
- </ItemGroup>
<ItemGroup>
<Natvis Include="$(MSBuildThisFileDirectory)..\..\natvis\wil.natvis" />
<Natvis Include="$(MSBuildThisFileDirectory)..\..\natvis\wil.natstepfilter" />
diff --git a/windows/coda/CODA/packages.config b/windows/coda/CODA/packages.config
deleted file mode 100644
index 42763b73ab22..000000000000
--- a/windows/coda/CODA/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="Microsoft.Web.WebView2" version="1.0.3719.77" targetFramework="native" />
- <package id="Microsoft.Windows.ImplementationLibrary" version="1.0.260126.7" targetFramework="native" />
-</packages>
\ No newline at end of file
diff --git a/windows/coda/WebDriverThing/WebDriverThing.csproj b/windows/coda/WebDriverThing/WebDriverThing.csproj
index 7ea53345aad8..dec88e678d8c 100644
--- a/windows/coda/WebDriverThing/WebDriverThing.csproj
+++ b/windows/coda/WebDriverThing/WebDriverThing.csproj
@@ -13,8 +13,6 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<PreferNativeArm64>true</PreferNativeArm64>
<Deterministic>true</Deterministic>
- <NuGetPackageImportStamp>
- </NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -36,45 +34,11 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
- <HintPath>packages\Microsoft.Bcl.AsyncInterfaces.10.0.2\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
- <Private>True</Private>
- </Reference>
<Reference Include="System" />
- <Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
- <HintPath>packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll</HintPath>
- </Reference>
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
- <Reference Include="System.IO.Pipelines, Version=10.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
- <HintPath>packages\System.IO.Pipelines.10.0.2\lib\net462\System.IO.Pipelines.dll</HintPath>
- <Private>True</Private>
- </Reference>
- <Reference Include="System.Memory, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
- <HintPath>packages\System.Memory.4.6.3\lib\net462\System.Memory.dll</HintPath>
- </Reference>
<Reference Include="System.Numerics" />
- <Reference Include="System.Numerics.Vectors, Version=4.1.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
- <HintPath>packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll</HintPath>
- </Reference>
- <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
- <HintPath>packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
- </Reference>
- <Reference Include="System.Text.Encodings.Web, Version=10.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
- <HintPath>packages\System.Text.Encodings.Web.10.0.2\lib\net462\System.Text.Encodings.Web.dll</HintPath>
- <Private>True</Private>
- </Reference>
- <Reference Include="System.Text.Json, Version=10.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
- <HintPath>packages\System.Text.Json.10.0.2\lib\net462\System.Text.Json.dll</HintPath>
- <Private>True</Private>
- </Reference>
- <Reference Include="System.Threading.Channels, Version=10.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
- <HintPath>packages\System.Threading.Channels.10.0.2\lib\net462\System.Threading.Channels.dll</HintPath>
- </Reference>
- <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
- <HintPath>packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
- </Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
@@ -84,10 +48,21 @@
<Reference Include="System.Xml" />
<Reference Include="UIAutomationClient" />
<Reference Include="UIAutomationTypes" />
- <Reference Include="WebDriver, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>packages\Selenium.WebDriver.4.41.0\lib\net462\WebDriver.dll</HintPath>
- <Private>True</Private>
- </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.2" />
+ <PackageReference Include="Selenium.WebDriver" Version="4.41.0" />
+ <PackageReference Include="Selenium.WebDriver.MSEdgeDriver" Version="145.0.3800.82" />
+ <PackageReference Include="System.Buffers" Version="4.6.1" />
+ <PackageReference Include="System.IO.Pipelines" Version="10.0.2" />
+ <PackageReference Include="System.Memory" Version="4.6.3" />
+ <PackageReference Include="System.Numerics.Vectors" Version="4.6.1" />
+ <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
+ <PackageReference Include="System.Text.Encodings.Web" Version="10.0.2" />
+ <PackageReference Include="System.Text.Json" Version="10.0.2" />
+ <PackageReference Include="System.Threading.Channels" Version="10.0.2" />
+ <PackageReference Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
+ <PackageReference Include="System.ValueTuple" Version="4.6.2" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
@@ -95,18 +70,6 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
- <None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
- <PropertyGroup>
- <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
- </PropertyGroup>
- <Error Condition="!Exists('packages\Selenium.WebDriver.MSEdgeDriver.145.0.3800.82\build\Selenium.WebDriver.MSEdgeDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Selenium.WebDriver.MSEdgeDriver.145.0.3800.82\build\Selenium.WebDriver.MSEdgeDriver.targets'))" />
- <Error Condition="!Exists('packages\System.ValueTuple.4.6.2\build\net471\System.ValueTuple.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\System.ValueTuple.4.6.2\build\net471\System.ValueTuple.targets'))" />
- <Error Condition="!Exists('packages\Selenium.WebDriver.4.41.0\build\Selenium.WebDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Selenium.WebDriver.4.41.0\build\Selenium.WebDriver.targets'))" />
- </Target>
- <Import Project="packages\Selenium.WebDriver.MSEdgeDriver.145.0.3800.82\build\Selenium.WebDriver.MSEdgeDriver.targets" Condition="Exists('packages\Selenium.WebDriver.MSEdgeDriver.145.0.3800.82\build\Selenium.WebDriver.MSEdgeDriver.targets')" />
- <Import Project="packages\System.ValueTuple.4.6.2\build\net471\System.ValueTuple.targets" Condition="Exists('packages\System.ValueTuple.4.6.2\build\net471\System.ValueTuple.targets')" />
- <Import Project="packages\Selenium.WebDriver.4.41.0\build\Selenium.WebDriver.targets" Condition="Exists('packages\Selenium.WebDriver.4.41.0\build\Selenium.WebDriver.targets')" />
</Project>
\ No newline at end of file
diff --git a/windows/coda/WebDriverThing/packages.config b/windows/coda/WebDriverThing/packages.config
deleted file mode 100644
index d25d729f6ed0..000000000000
--- a/windows/coda/WebDriverThing/packages.config
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="Microsoft.Bcl.AsyncInterfaces" version="10.0.2" targetFramework="net48" />
- <package id="Selenium.WebDriver" version="4.41.0" targetFramework="net48" />
- <package id="Selenium.WebDriver.MSEdgeDriver" version="145.0.3800.82" targetFramework="net48" />
- <package id="System.Buffers" version="4.6.1" targetFramework="net48" />
- <package id="System.IO.Pipelines" version="10.0.2" targetFramework="net48" />
- <package id="System.Memory" version="4.6.3" targetFramework="net48" />
- <package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net48" />
- <package id="System.Runtime.CompilerServices.Unsafe" version="6.1.2" targetFramework="net48" />
- <package id="System.Text.Encodings.Web" version="10.0.2" targetFramework="net48" />
- <package id="System.Text.Json" version="10.0.2" targetFramework="net48" />
- <package id="System.Threading.Channels" version="10.0.2" targetFramework="net48" />
- <package id="System.Threading.Tasks.Extensions" version="4.6.3" targetFramework="net48" />
- <package id="System.ValueTuple" version="4.6.2" targetFramework="net48" />
-</packages>
\ No newline at end of file

"Andras Timar (via cogerrit)"

unread,
May 19, 2026, 2:52:28 AM (7 days ago) May 19
to collaboraon...@googlegroups.com
windows/coda/CODA/CODA.vcxproj | 2 ++
1 file changed, 2 insertions(+)

New commits:
commit eb84b1c3057a75b21de13acff624dd651c067d6e
Author: Andras Timar <andras...@collabora.com>
AuthorDate: Tue May 19 08:51:22 2026 +0200
Commit: Andras Timar <andras...@collabora.com>
CommitDate: Tue May 19 08:51:43 2026 +0200

windows: stop the legacy NuGet task on the migrated CODA vcxproj

After switching CODA to PackageReference, Jenkins builds failed
with "Sequence contains no elements" thrown from the legacy
ResolveNuGetPackageAssets task in Microsoft.NuGet.targets(198,5).
That task is the project.json-era handler; Microsoft.Cpp.NuGet.targets
imports it into every vcxproj and it runs by default, then errors
out because a pure PackageReference C++ project has no native
target framework for it to resolve.

Set RestoreProjectStyle=PackageReference (so NuGet's restore picks
the new code path explicitly instead of auto-detecting) and
ResolveNuGetPackages=false (to skip the legacy task entirely).
The package's build/native/*.targets still get imported via the
obj/CODA.vcxproj.nuget.g.targets that msbuild -restore generates
from the <PackageReference> items.

Signed-off-by: Andras Timar <andras...@collabora.com>
Change-Id: I25ac77f4451cee9219205dbf3fc887ae2ec2cdbb

diff --git a/windows/coda/CODA/CODA.vcxproj b/windows/coda/CODA/CODA.vcxproj
index 7ec9dc8aec84..d4869d6aa036 100644
--- a/windows/coda/CODA/CODA.vcxproj
+++ b/windows/coda/CODA/CODA.vcxproj
@@ -24,6 +24,8 @@
<ProjectGuid>{01e897c1-3460-4aa1-a374-98a8dcd58a7c}</ProjectGuid>
<RootNamespace>CODA</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ <RestoreProjectStyle>PackageReference</RestoreProjectStyle>
+ <ResolveNuGetPackages>false</ResolveNuGetPackages>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">

"Andras Timar (via cogerrit)"

unread,
May 21, 2026, 2:55:49 AM (5 days ago) May 21
to collaboraon...@googlegroups.com
windows/coda/CODA/CODA.cpp | 57 +++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 55 insertions(+), 2 deletions(-)

New commits:
commit dffaa27b1567379977bfa45ca19a081d2313df73
Author: Andras Timar <andras...@collabora.com>
AuthorDate: Mon May 18 16:42:29 2026 +0200
Commit: Miklos Vajna <vmi...@collabora.com>
CommitDate: Thu May 21 06:55:33 2026 +0000

coda: check reg.exe result and delete the .reg file after use

Two minor follow-ups to the breakaway-spawn registration:

- Capture reg.exe's stderr/stdout via an anonymous pipe and, on
non-zero exit, log the actual error message ("ERROR: Access is
denied.", "ERROR: The specified file is not a registry script.",
etc.) via OutputDebugStringW. Log:: is not initialized this early
in wWinMain, but OutputDebugStringW is captureable in DebugView
during testing and lets us notice silent reg.exe failures with a
human-readable cause rather than a bare exit code.

- DeleteFileW the .reg artifact after reg.exe is done with it. The
file is purely transient - it exists only as the import payload for
that one spawn - and there is no reason to leave it lingering under
%LocalAppData%\\<appName>\\.

Signed-off-by: Andras Timar <andras...@collabora.com>
Change-Id: Ifc60cc247be8f81bfd6ff7ce212a65168be74e70
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2848
Tested-by: Jenkins CPCI <rel...@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmi...@collabora.com>

diff --git a/windows/coda/CODA/CODA.cpp b/windows/coda/CODA/CODA.cpp
index e07dfa2cebd4..3eef59db22da 100644
--- a/windows/coda/CODA/CODA.cpp
+++ b/windows/coda/CODA/CODA.cpp
@@ -1753,24 +1753,77 @@ static void registerOdfShellExtensions()
return;
}

+ // Capture reg.exe's stderr/stdout via a pipe so a failure message can
+ // be surfaced verbatim (e.g. "ERROR: Access is denied.") instead of
+ // just the numeric exit code.
+ SECURITY_ATTRIBUTES sa = { sizeof(sa), nullptr, TRUE };
+ HANDLE hReadPipe = nullptr;
+ HANDLE hWritePipe = nullptr;
+ if (!CreatePipe(&hReadPipe, &hWritePipe, &sa, 65536))
+ {
+ DeleteProcThreadAttributeList(attrList);
+ return;
+ }
+ SetHandleInformation(hReadPipe, HANDLE_FLAG_INHERIT, 0);
+
STARTUPINFOEXW si = {};
si.StartupInfo.cb = sizeof(si);
- si.StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
+ si.StartupInfo.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
si.StartupInfo.wShowWindow = SW_HIDE;
+ si.StartupInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
+ si.StartupInfo.hStdOutput = hWritePipe;
+ si.StartupInfo.hStdError = hWritePipe;
si.lpAttributeList = attrList;

PROCESS_INFORMATION pi = {};
- BOOL ok = CreateProcessW(NULL, cmdLine.data(), NULL, NULL, FALSE,
+ BOOL ok = CreateProcessW(NULL, cmdLine.data(), NULL, NULL, TRUE,
EXTENDED_STARTUPINFO_PRESENT | CREATE_NO_WINDOW,
NULL, NULL,
reinterpret_cast<LPSTARTUPINFOW>(&si), &pi);
DeleteProcThreadAttributeList(attrList);
+ // Parent must close its copy of the write end so the read end sees EOF
+ // when reg.exe exits.
+ CloseHandle(hWritePipe);
if (!ok)
+ {
+ CloseHandle(hReadPipe);
return;
+ }

WaitForSingleObject(pi.hProcess, 5000);
+
+ std::string output;
+ char buf[1024];
+ DWORD nRead = 0;
+ while (ReadFile(hReadPipe, buf, sizeof(buf), &nRead, nullptr) && nRead > 0)
+ output.append(buf, nRead);
+ CloseHandle(hReadPipe);
+
+ DWORD exitCode = STILL_ACTIVE;
+ GetExitCodeProcess(pi.hProcess, &exitCode);
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
+ if (exitCode != 0)
+ {
+ while (!output.empty() && (output.back() == '\r' || output.back() == '\n'
+ || output.back() == ' ' || output.back() == '\t'))
+ output.pop_back();
+ // reg.exe writes in the user's OEM (console) codepage; widen for
+ // OutputDebugStringW. Log:: is not initialized yet at this point
+ // in wWinMain. DebugView (Sysinternals) captures the output.
+ int wlen = MultiByteToWideChar(CP_OEMCP, 0,
+ output.c_str(), static_cast<int>(output.size()),
+ nullptr, 0);
+ std::wstring wide(wlen, L'\0');
+ MultiByteToWideChar(CP_OEMCP, 0,
+ output.c_str(), static_cast<int>(output.size()),
+ wide.data(), wlen);
+ std::wstring msg = L"registerOdfShellExtensions: reg.exe failed: ";
+ msg += wide.empty() ? L"(no diagnostic on stderr)" : wide;
+ msg += L"\n";
+ OutputDebugStringW(msg.c_str());
+ }
+ DeleteFileW(regFilePath.c_str());
}

static void openCOOLWindow(const FilenameAndUri& filenameAndUri, DocumentMode mode)

"Tor Lillqvist (via cogerrit)"

unread,
May 24, 2026, 2:37:00 PM (yesterday) May 24
to collaboraon...@googlegroups.com
windows/coda/CODA/CODA.cpp | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)

New commits:
commit 63f0901392fa8db27a15ee3eb45e8baf40f9ac13
Author: Tor Lillqvist <t...@collabora.com>
AuthorDate: Thu May 21 18:49:22 2026 +0200
Commit: Caolán McNamara <caolan....@collabora.com>
CommitDate: Sun May 24 18:36:44 2026 +0000

Work around the clipboard being intermittently open by some other process

Signed-off-by: Tor Lillqvist <t...@collabora.com>
Change-Id: I0578848bad7a7e328ae32cad6c51d0c9549daa47
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3088
Tested-by: Jenkins CPCI <rel...@collaboraoffice.com>
Tested-by: Caolán McNamara <caolan....@collabora.com>
Reviewed-by: Caolán McNamara <caolan....@collabora.com>

diff --git a/windows/coda/CODA/CODA.cpp b/windows/coda/CODA/CODA.cpp
index 3eef59db22da..d29e5ce50462 100644
--- a/windows/coda/CODA/CODA.cpp
+++ b/windows/coda/CODA/CODA.cpp
@@ -582,6 +582,22 @@ static void do_getrecentdocs(const WindowData& data, int id)
", '" + recentFiles.serialiseFiltered(currentlyOpenDocumens()) + "')").c_str()), 0);
}

+// It happens that some other process opens the clipboard for a short time, and if we happen to try
+// during that time it will fail. Workaround for that: a function that tries a couple of times.
+
+static BOOL try_open_clipboard()
+{
+ const int NTRIES = 10;
+ for (int i = 0; i < NTRIES; i++)
+ {
+ if (OpenClipboard(NULL))
+ return TRUE;
+ Sleep(5);
+ }
+ LOG_ERR("OpenClipboard() failed repeatedly, last error: " << GetLastError());
+ return FALSE;
+}
+
static void do_cut_or_copy(ClipboardOp op, WindowData& data)
{
// Tell core to copy the selection into its internal clipboard
@@ -595,7 +611,7 @@ static void do_cut_or_copy(ClipboardOp op, WindowData& data)
// Get core's internal clipboard
DocumentData::get(data.appDocId).loKitDocument->getClipboard(nullptr, &count, &mimeTypes, &sizes,
&streams);
- if (!OpenClipboard(NULL))
+ if (!try_open_clipboard())
return;

if (!EmptyClipboard())
@@ -717,7 +733,7 @@ static void do_paste_or_read(ClipboardOp op, WindowData& data)
{
if (data.lastAnyonesClipboardModification > data.lastOwnClipboardModification)
{
- if (!OpenClipboard(NULL))
+ if (!try_open_clipboard())
return;

std::vector<const char*> mimeTypes;
@@ -2253,7 +2269,7 @@ static void processMessage(WindowData& data, wil::unique_cotaskmem_string& messa
else if (s.starts_with(L"TEXTCLIPBOARD "))
{
std::wstring text = s.substr(14);
- if (OpenClipboard(NULL))
+ if (try_open_clipboard())
{
EmptyClipboard();
HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, (text.size() + 1) * sizeof(wchar_t));

Reply all
Reply to author
Forward
0 new messages