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

Do not add child window to parent when the child window is in the TabbedWindows of parent #2236

Merged
merged 2 commits into from
Jun 30, 2023

Conversation

AkiSakurai
Copy link
Contributor

There is a setting in macos system preferences to group windows as tabs automatically. And tabbed windows is not compatible to AddChildWindow relationship.

…bedWindows of parent.

There is a setting in macos system preferences to group windows as tabs automatically. And tabbed windows is not compatible to AddChildWindow relationship.
@cwensley
Copy link
Member

cwensley commented Jun 3, 2022

afaik, you can certainly have child windows that are also themselves tabs. Do you have some code to reproduce the issue this is supposed to solve?
Tabbed Child Windows

@AkiSakurai
Copy link
Contributor Author

AkiSakurai commented Jun 4, 2022

using System;
using Eto.Forms;
using Eto.Drawing;

namespace Tutorial1
{
	public class MyForm : Form
	{
		static bool firstShown = true;

		public MyForm(Window parent = null)
		{

			if(parent != null)
			{
				this.Owner = parent;
			}

			if(firstShown)
			{
				firstShown = false;
				Application.Instance.InvokeAsync(() => (new MyForm(this)).Show());
				
			}
			// Set ClientSize instead of Size, as each platform has different window border sizes
			ClientSize = new Size(600, 400);

			// Title to show in the title bar
			Title = "Hello, Eto.Forms";

			// Content of the form
			Content = new Label { Text = "Some content", VerticalAlignment = VerticalAlignment.Center, TextAlignment = TextAlignment.Center };
		}
	}

	class Program
	{
		[STAThread]
		public static void Main(string[] args)
		{
			new Application().Run(new MyForm());
		}
	}
}

using System;
using Eto.Forms;
using Eto.Drawing;

namespace Tutorial1
{
	public class MyForm : Form
	{
		static bool firstShown = true;

		public MyForm(Window parent = null)
		{

			if(parent != null)
			{
				this.Owner = parent;
			}

			if(firstShown)
			{
				firstShown = false;
				Application.Instance.InvokeAsync(() => (new MyForm(this)).Show());
				
			}
			// Set ClientSize instead of Size, as each platform has different window border sizes
			ClientSize = new Size(600, 400);

			// Title to show in the title bar
			Title = "Hello, Eto.Forms";

			// Content of the form
			Content = new Label { Text = "Some content", VerticalAlignment = VerticalAlignment.Center, TextAlignment = TextAlignment.Center };
		}
	}

	class Program
	{
		[STAThread]
		public static void Main(string[] args)
		{
			new Application().Run(new MyForm());
		}
	}
}

If you click on the parent tab, the tabbar is gone, click again the whole window is gone

Screen.Recording.2022-06-04.at.7.49.44.AM.mp4

@AkiSakurai
Copy link
Contributor Author

AkiSakurai commented Jun 4, 2022

Also, I just tested your test program, it fails too.
Maybe it is bug introduced by new macos version?
My os version is monterey 12.4.

@AkiSakurai
Copy link
Contributor Author

Just tested on high sierra, the issue exists.

@cwensley
Copy link
Member

Hm, yeah you're right. Clicking on the "parent" window causes them to disappear, but then switching to another app then back brings them back. I'll have to investigate why that's happening, you should certainly be able to have a child window even when using tabs.

@cwensley cwensley merged commit 6a3e075 into picoe:develop Jun 30, 2023
@cwensley
Copy link
Member

Sorry this took so long to get in! Thanks for the contribution!

@cwensley cwensley added the bug label Jun 30, 2023
@cwensley cwensley added this to the 2.8.0 milestone Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants