Skip to content

Commit

Permalink
Merge pull request #12520 from unoplatform/mergify/bp/release/stable/…
Browse files Browse the repository at this point in the history
…4.9/pr-12515
  • Loading branch information
jeromelaban authored Jun 3, 2023
2 parents 6a80b75 + b899040 commit 3dafa2f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
7 changes: 6 additions & 1 deletion src/AddIns/Uno.UI.MediaPlayer.Skia.Gtk/VideoView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,12 @@ private void AttachToWidget()

if (_videoWindow is null)
{
throw new InvalidOperationException($"_videoWindow cannot be null");
if (this.Log().IsEnabled(Microsoft.Extensions.Logging.LogLevel.Debug))
{
this.Log().Debug($"{GetHashCode():X8} Skipping AttachToWidget (no video window available)");
}

return;
}

// Reparent the window to the current window, so it appears inside, positioned outside the bounds of the window
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -766,17 +766,21 @@ private void OnControlsBoundsChanged()
_mediaPlayer is { } &&
XamlRoot?.Content is UIElement root)
{
var bounds = new Rect(
0,
0,
m_tpControlPanelGrid.ActualWidth,
_isShowingControls ? m_tpControlPanelGrid.ActualHeight : 0
);
var transportBounds = TransformToVisual(root).TransformBounds(bounds);

_mediaPlayer.SetTransportControlBounds(transportBounds);
var slot = m_tpControlPanelGrid
.TransformToVisual(m_tpControlPanelGrid.Parent as UIElement)
.TransformBounds(m_tpControlPanelGrid.LayoutSlotWithMarginsAndAlignments);
slot.Height += m_tpControlPanelGrid.Padding.Top
+ m_tpControlPanelGrid.Padding.Bottom
+ Margin.Top
+ Margin.Bottom;
if (!_isShowingControls)
{
slot.Height = 0;
}
_mediaPlayer.SetTransportControlBounds(slot);
}
}

private void OnPaneGridTapped(object sender, TappedRoutedEventArgs e)
{
if (ShowAndHideAutomatically)
Expand Down

0 comments on commit 3dafa2f

Please sign in to comment.