-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Support Window.Frame on all platforms #10028
Conversation
b35068b
to
90174ca
Compare
@@ -16,7 +16,8 @@ protected override void ConnectHandler(UI.Xaml.Window platformView) | |||
if (platformView.Content is null) | |||
platformView.Content = new WindowRootViewContainer(); | |||
|
|||
// update the platform window with the user size | |||
// update the platform window with the user size/position | |||
platformView.UpdatePosition(VirtualView); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The real fix for #9703
@rookiejava are you or your team able to confirm that Tizen works as expected? |
internal static void UpdateX(this Window platformWindow, IWindow window) => | ||
platformWindow.UpdateUnsupportedCoordinate(window); | ||
|
||
internal static void UpdateY(this Window platformWindow, IWindow window) => | ||
platformWindow.UpdateUnsupportedCoordinate(window); | ||
|
||
internal static void UpdateWidth(this Window platformWindow, IWindow window) => | ||
platformWindow.UpdateUnsupportedCoordinate(window); | ||
|
||
internal static void UpdateHeight(this Window platformWindow, IWindow window) => | ||
platformWindow.UpdateUnsupportedCoordinate(window); | ||
|
||
internal static void UpdateUnsupportedCoordinate(this Window platformWindow, IWindow window) => | ||
window.FrameChanged(platformWindow.WindowPositionSize.ToDP()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rookiejava are you or your team able to confirm that Tizen works as expected?
No problems with current tizen implementation at the moment. However, we need more investigation for supporing multi window and window resizing on tizen (with NUI), hopefully it should be supported. If we find a way, I will submit separate PR the actual tizen implementation. 🤙
{ | ||
internal static partial class ActivityExtensions | ||
{ | ||
internal static IWindow? GetWindowFromActivity(this Android.App.Activity? activity) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful. Less code is good code.
if (e.MessageId == PlatformMethods.MessageIds.WM_SETTINGCHANGE || | ||
e.MessageId == PlatformMethods.MessageIds.WM_THEMECHANGE) | ||
{ | ||
var mauiApp = MauiWinUIApplication.Current; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced this with
if (IPlatformApplication.Current is IPlatformApplication platformApplication)
var density = newConfig.DensityDpi / DeviceDisplay.BaseLogicalDpi; | ||
mauiWindow.DisplayDensityChanged(density); | ||
} | ||
MauiApplication.Current?.Services?.InvokeLifecycleEvents<AndroidLifecycle.OnConfigurationChanged>(del => del(this, newConfig)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
|
||
return null; | ||
} | ||
=> view?.Context?.GetWindow(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha you were already consolidating.
XF: yea it's really hard to get the window
MAUI: here's like 7 extensions you can use with slightly different names :-p
Description
This PR fixes a few more
Window
issues:Tasks
Known Issues
Screenshots