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

Extra window created #111

Closed
MikaelStalvik opened this issue Aug 6, 2023 · 5 comments · May be fixed by #115
Closed

Extra window created #111

MikaelStalvik opened this issue Aug 6, 2023 · 5 comments · May be fixed by #115
Labels
4.0 bug Something isn't working
Milestone

Comments

@MikaelStalvik
Copy link

MikaelStalvik commented Aug 6, 2023

When setting up the most simple sample WPF application with .NET 7 a ghost window with the title "OpenTK Window" will be created parallell to the MainWindow.

This extra window is visible on the taskbar as well as from the Task Manager when expaning the process.

Changing to the extra window doesn't do much but can sometimes leave traces of contents on it.

Expected result
No extra window shall be created.

Configuration used

  • OpenTK 4.8.0
  • OpenTK.GLWpfControl 4.2.3
  • .NET7
  • Windows 11

Sample code
MainWindow.xaml
<Window x:Class="OpenTkWpf7.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:OpenTkWpf7" xmlns:glWpfControl="clr-namespace:OpenTK.Wpf;assembly=GLWpfControl" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> <Grid> <glWpfControl:GLWpfControl x:Name="OpenTkControl" Render="OpenTkControl_OnRender"/> </Grid> </Window>

MainWindow.xaml.cs

public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            var settings = new GLWpfControlSettings
            {
                MajorVersion = 3,
                MinorVersion = 1,
            };
            OpenTkControl.Start(settings);
        }

        private void OpenTkControl_OnRender(TimeSpan obj)
        {
        }
    }

@Svabik
Copy link
Contributor

Svabik commented Aug 13, 2023

I have to add to this - I was observing that window in the past too (previous versions of GLWpfControl and OpenTK). But it was visible only when my application started a function using full CPU - making UI irresponsive. The black rectangle appeared in top left screen corner.
Last week I have upgraded the OpenTK Only - and since then I observe exactly what MikaelStalvik describes. Very annoying.

@YamingZ
Copy link

YamingZ commented Aug 25, 2023

I also encountered this extra window called OpenTK Window, is there any way to remove it?

@MikaelStalvik
Copy link
Author

After some digging, it seems like this happens becuase of some change in OpenTK itself, not this control.
Reverting to OpenTK 4.7.7removes the problem.

Possibly this issue needs to be raised for the OpenTK control itself?

@NogginBops NogginBops added this to the 4.3.0 milestone Oct 26, 2023
@NogginBops NogginBops added bug Something isn't working 4.0 labels Oct 26, 2023
@NogginBops
Copy link
Member

I think that #115 should solve this issue, as the window visibility bug should be fixed in 4.8.0+.

@NogginBops NogginBops linked a pull request Oct 26, 2023 that will close this issue
1 task
@MikaelStalvik
Copy link
Author

Yes, version 4.8.1 seems to have resolved this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.0 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants