Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Fix Airspace issue #296

Closed
jeremyVignelles opened this issue Sep 12, 2017 · 9 comments
Closed

Fix Airspace issue #296

jeremyVignelles opened this issue Sep 12, 2017 · 9 comments

Comments

@jeremyVignelles
Copy link
Collaborator

jeremyVignelles commented Sep 12, 2017

Many users have reported Airspace issues while using this library. One issue to rule them all and in the darkness bind them.

Sample code (taken from #41):

<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Wpf="clr-namespace:Vlc.DotNet.Wpf;assembly=Vlc.DotNet.Wpf" x:Class="LivestreamViewer.MainWindow"
        Title="MainWindow" Height="449" Width="753">
    <Grid>
        <Wpf:VlcControl x:Name="vlc" Margin="0,0,0,13" Panel.ZIndex="-1"/>
        <Grid x:Name="overlayGrid" HorizontalAlignment="Stretch" Height="25" Margin="0,0,0,0" VerticalAlignment="Bottom">
            <Rectangle Fill="Black" HorizontalAlignment="Stretch" Margin="0,0,0,0" Stroke="Black" VerticalAlignment="Stretch" IsHitTestVisible="False" Opacity="0.5"/>
        </Grid>
    </Grid>
</Window>

Technical explanations:

Following issues are impacted (and will be closed):

Proposed workarounds/hacks (untested):

@adamfierek
Copy link

https://github.com/kolorowezworki/Airhack
Try this. It's quite dirty, but it works ;)

@jeremyVignelles
Copy link
Collaborator Author

Thanks for providing a workaround! I'll keep this open until this is fixed or considered as an acceptable solution (I'd prefer the first option)

@adamfierek
Copy link

We cannot fix airspace. Maybe we can fix VLC control, but not general problem with Winforms. This is caused by the method of rendering WPF and Winforms controls and windows. I think, at the moment, we can base only on workarounds.

@jeremyVignelles
Copy link
Collaborator Author

This could be fixed by #249 : If there is no reference to winforms, then there is no airspace issue, am I wrong? the option I'm thinking of is using DirectX to do the rendering, rather than using WinForm/HWND. vlc-winrt is already using that technique for win10 apps

@adamfierek
Copy link

adamfierek commented Sep 13, 2017

Sure. No Winforms/Win32Api == no airspace. DirectX is rendered the similar way to WPF. Avoiding problem is avoid, not solve ;) #249 is not about fixing airspace, rather about making something very new and different of current solution. We can use HWND of WPF Window directly and it will not need a reference to Windows.Forms, but airspace effect will not disappear. My workaround is for general mixing Winforms and WPF, not only for Vlc.DotNet control ;)

This was referenced Sep 13, 2017
@jeremyVignelles
Copy link
Collaborator Author

A comment in #257 shows a workaround for the Airspace issue in stackoverflow : https://stackoverflow.com/questions/5978917/render-wpf-control-on-top-of-windowsformshost/23662410#23662410

@JUSTHassan
Copy link

A powerful workaround https://stackoverflow.com/a/43695349/1576027

<interop:AirspaceDecorator AirspaceMode="Redirect" Background="White" IsInputRedirectionEnabled="True" IsOutputRedirectionEnabled="True"> <Wpf:VlcControl x:Name="vlcControl" Margin="0,0,0,0"/> </interop:AirspaceDecorator>

@jeremyVignelles
Copy link
Collaborator Author

Will be solved in 3.0.0 when #365 gets merged

@jeremyVignelles
Copy link
Collaborator Author

Should be fixed in 3.0.0-develop250

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants