Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump DBus stack take 2 #15685

Merged
merged 25 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a13131c
Bump DBus stack
affederaffe Apr 30, 2024
5c11cf7
Fix merge issues
affederaffe May 1, 2024
4888cda
Merge remote-tracking branch 'refs/remotes/upstream/master' into bump…
affederaffe May 1, 2024
87facce
Intentionally break the DBus spec
affederaffe May 10, 2024
f1eae81
Dispose DBus connection and signal watchers
affederaffe May 10, 2024
c6f04be
Bump Tmds,DBus.Protocol
affederaffe May 10, 2024
39df8a0
Dispose DBus objects correctly
affederaffe May 10, 2024
470aa93
Merge remote-tracking branch 'refs/remotes/upstream/master' into bump…
affederaffe Jun 8, 2024
f3e2470
Use PathHandler for DBus objects
affederaffe Jun 8, 2024
0468dae
Merge remote-tracking branch 'refs/remotes/upstream/master' into bump…
affederaffe Jun 23, 2024
16d2456
Merge remote-tracking branch 'refs/remotes/upstream/master' into bump…
affederaffe Jul 13, 2024
6dd4f00
Revert to old initialization
affederaffe Jul 13, 2024
dc3ce5d
Bump DBus packages
affederaffe Jul 13, 2024
a4cff3c
Fix global menu
affederaffe Jul 13, 2024
1cfecb7
Add comment about wrapped variants
affederaffe Jul 13, 2024
9cf1100
Merge branch 'master' into bump-tmds-dbus-sourcegenerator
maxkatz6 Jul 18, 2024
85d587f
Merge remote-tracking branch 'upstream/master' into bump-tmds-dbus-so…
affederaffe Jul 20, 2024
eab37e9
Bump Tmds.DBus.SourceGenerator
affederaffe Jul 20, 2024
a5007c0
Merge remote-tracking branch 'origin/bump-tmds-dbus-sourcegenerator' …
affederaffe Jul 20, 2024
5fbf023
Merge branch 'master' into bump-tmds-dbus-sourcegenerator
affederaffe Jul 23, 2024
08ca68a
Merge branch 'master' into bump-tmds-dbus-sourcegenerator
maxkatz6 Jul 26, 2024
abea696
Update api baseline
maxkatz6 Jul 26, 2024
a1aa70b
Merge branch 'master' into bump-tmds-dbus-sourcegenerator
affederaffe Jul 27, 2024
34910ab
Merge branch 'master' into bump-tmds-dbus-sourcegenerator
affederaffe Aug 15, 2024
d4d115c
Bump Tmds.DBus stack
affederaffe Aug 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions api/Avalonia.FreeDesktop.nupkg.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Tmds.DBus.SourceGenerator.PropertyChanges`1</Target>
<Left>baseline/netstandard2.0/Avalonia.FreeDesktop.dll</Left>
<Right>target/netstandard2.0/Avalonia.FreeDesktop.dll</Right>
</Suppression>
</Suppressions>
4 changes: 2 additions & 2 deletions src/Avalonia.FreeDesktop/Avalonia.FreeDesktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Tmds.DBus.Protocol" Version="0.16.0" />
<PackageReference Include="Tmds.DBus.SourceGenerator" Version="0.0.15" PrivateAssets="all" />
<PackageReference Include="Tmds.DBus.Protocol" Version="0.20.0" />
<PackageReference Include="Tmds.DBus.SourceGenerator" Version="0.0.19" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Avalonia.FreeDesktop/DBusIme/Fcitx/FcitxICWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ public ValueTask<IDisposable> WatchCommitStringAsync(Action<Exception?, string>

public ValueTask<IDisposable> WatchForwardKeyAsync(Action<Exception?, (uint keyval, uint state, int type)> handler) =>
_old?.WatchForwardKeyAsync(handler)
?? _modern?.WatchForwardKeyAsync((e, ev) => handler.Invoke(e, (ev.keyval, ev.state, ev.type ? 1 : 0)))
?? _modern?.WatchForwardKeyAsync((e, ev) => handler.Invoke(e, (ev.Keyval, ev.State, ev.Type ? 1 : 0)))
?? new ValueTask<IDisposable>(Disposable.Empty);

public ValueTask<IDisposable> WatchUpdateFormattedPreeditAsync(
Action<Exception?, ((string?, int)[]? str, int cursorpos)> handler) =>
_old?.WatchUpdateFormattedPreeditAsync(handler!)
?? _modern?.WatchUpdateFormattedPreeditAsync(handler!)
?? new ValueTask<IDisposable>(Disposable.Empty);

public Task SetCapacityAsync(uint flags) =>
_old?.SetCapacityAsync(flags) ?? _modern?.SetCapabilityAsync(flags) ?? Task.CompletedTask;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protected override async Task<bool> Connect(string name)
var resp = await method.CreateICv3Async(GetAppName(),
Process.GetCurrentProcess().Id);

var proxy = new OrgFcitxFcitxInputContext(Connection, name, $"/inputcontext_{resp.icid}");
var proxy = new OrgFcitxFcitxInputContext(Connection, name, $"/inputcontext_{resp.Icid}");
_context = new FcitxICWrapper(proxy);
}
else
Expand Down
21 changes: 10 additions & 11 deletions src/Avalonia.FreeDesktop/DBusIme/IBus/IBusX11TextInputMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,16 @@ private void OnShowPreedit(Exception? obj)
Client.SetPreeditText(_preeditText, _preeditText == null ? null : _preeditCursor);
}

private void OnUpdatePreedit(Exception? arg1, (DBusVariantItem text, uint cursor_pos, bool visible) preeditComponents)
private void OnUpdatePreedit(Exception? arg1, (VariantValue Text, uint CursorPos, bool Visible) preeditComponents)
{
if (preeditComponents.text is { Value: DBusStructItem { Count: >= 3 } structItem } &&
structItem[2] is DBusStringItem stringItem)
if (preeditComponents.Text is { Type: VariantValueType.Struct, Count: >= 3 } structItem && structItem.GetItem(2) is { Type: VariantValueType.String} stringItem)
{
_preeditText = stringItem.Value;
_preeditText = stringItem.GetString();
_preeditCursor = _preeditText != null
? Utf16Utils.CharacterOffsetToStringOffset(_preeditText,
(int)Math.Min(preeditComponents.cursor_pos, int.MaxValue), false)
(int)Math.Min(preeditComponents.CursorPos, int.MaxValue), false)
: 0;

_preeditShown = true;
}
else
Expand Down Expand Up @@ -102,13 +101,13 @@ private void OnForwardKey(Exception? e, (uint keyval, uint keycode, uint state)
});
}

private void OnCommitText(Exception? e, DBusVariantItem variantItem)
private void OnCommitText(Exception? e, VariantValue variantItem)
{
if (_insideReset > 0)
if (_insideReset > 0)
{
// For some reason iBus can trigger a CommitText while being reset.
// Thankfully the signal is sent _during_ Reset call processing,
// so it arrives on-the-wire before Reset call result, so we can
// so it arrives on-the-wire before Reset call result, so we can
// check if we have any pending Reset calls and ignore the signal here
return;
}
Expand All @@ -118,8 +117,8 @@ private void OnCommitText(Exception? e, DBusVariantItem variantItem)
return;
}

if (variantItem.Value is DBusStructItem { Count: >= 3 } structItem && structItem[2] is DBusStringItem stringItem)
FireCommit(stringItem.Value);
if (variantItem.Count >= 3 && variantItem.GetItem(2) is { Type: VariantValueType.String } stringItem)
FireCommit(stringItem.GetString());
}

protected override Task DisconnectAsync() => _service?.DestroyAsync() ?? Task.CompletedTask;
Expand Down
Loading
Loading