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

Borderless Window Inconsistency between Wpf and Gtk #1928

Closed
Sarund9 opened this issue Apr 16, 2021 · 7 comments · Fixed by #2344
Closed

Borderless Window Inconsistency between Wpf and Gtk #1928

Sarund9 opened this issue Apr 16, 2021 · 7 comments · Fixed by #2344
Milestone

Comments

@Sarund9
Copy link

Sarund9 commented Apr 16, 2021

From the Discusion:
Borderless Window? #1926

We found something that might be considered an Issue

This window is in "borderless" mode, but it still contains a border in Wpf.
Borderless Window
Is this intended behaviour of a Wpf window?
According to Documentation, this Window in Gtk does not have a Border at all.
This might be considered a platform inconsistency.

@cwensley
Copy link
Member

This is the default of WPF when creating resizable windows. It doesn't have a border if it is not resizable. To change it, you could do something like:

// in your startup code:
Eto.Style.Add<Eto.Wpf.Forms.FormHandler>("noborder", handler => {
  System.Windows.WindowChrome.SetWindowChrome(handler.Control, 
    new System.Windows.WindowChrome { ResizeBorderThickness = new System.Windows.Thickness(2) }
  )
});

// when creating your window:

myWindow.Style = "noborder";

@Sarund9
Copy link
Author

Sarund9 commented Apr 21, 2021

That breaks the MenuBar (Items can't be clicked on)

@cwensley
Copy link
Member

You'll have to play around with the WindowChrome properties then, perhaps don't allow resizing at the top of the window by using new Thickness(2, 0, 2, 2).

@InfinityGhost
Copy link

Could just disable resizing and then there's no border at all, which IMO should be the default behavior to match GTK.

@Sarund9
Copy link
Author

Sarund9 commented Apr 21, 2021

You'll have to play around with the WindowChrome properties then, perhaps don't allow resizing at the top of the window by using new Thickness(2, 0, 2, 2).

A Thickness of 0 still does not allow clicking on the menus.

Could just disable resizing and then there's no border at all, which IMO should be the default behavior to match GTK.

That does work, but i want a resizable window with no borders

@InfinityGhost
Copy link

InfinityGhost commented Apr 21, 2021

Potentially could override the OnMouseDown function on the window class itself, and check it the cursor position is at the edge of the window and resize from there.

@cwensley
Copy link
Member

This should be easier to do, regardless of the default. I think my suggestions aren't quite working correctly so it needs to be figured out.

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

Successfully merging a pull request may close this issue.

3 participants