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

Unable to resize the app window with content extended into title bar #8414

Closed
daniDevKr opened this issue Apr 10, 2023 · 3 comments
Closed
Labels
area-Windowing bug Something isn't working team-CompInput Issue for IXP (Composition, Input) team

Comments

@daniDevKr
Copy link

Describe the bug

When i try to resize the app window with content extended into title bar the window not resize.
The pointer changes from resize pointer to selection pointer.

Steps to reproduce the bug

  1. I go to the top of the window app bar and appear the resize pointer;
  2. I click the left button of the mouse and the pointer changes to default selection pointer;

Expected behavior

When the pointer go to the top of the window app bar the pointer changes in resize pointer.
At the left click the pointer not change in default selection pointer and moving the mouse down the window resizes.

Screenshots

Registrazione.2023-04-10.174401.mp4

NuGet package version

Windows App SDK 1.2.5: 1.2.230313.1

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022

Additional context

Source code

MainWindow.cs



// Copyright (c) Microsoft Corporation and Contributors.
// Licensed under the MIT License.
using Microsoft.UI;           // Needed for WindowId
using Microsoft.UI.Windowing; // Needed for AppWindow
using Microsoft.UI.Xaml;
using System;
using WinRT.Interop;          // Needed for XAML/HWND interop

// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.

namespace WindowCustomTitleBarSample
{
    /// <summary>
    /// An empty window that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainWindow : Window
    {

        private AppWindow m_AppWindow;



        public MainWindow()
        {
            this.InitializeComponent();


            m_AppWindow = GetAppWindowForCurrentWindow();
            // Check to see if customization is supported.
            // The method returns true on Windows 10 since Windows App SDK 1.2, and on all versions of
            // Windows App SDK on Windows 11.
            if (AppWindowTitleBar.IsCustomizationSupported())
            {
                var titleBar = m_AppWindow.TitleBar;
                // Hide default title bar.
                titleBar.ExtendsContentIntoTitleBar = true;
                titleBar.PreferredHeightOption = TitleBarHeightOption.Tall;
                  
            }
            else
            {
                // In the case that title bar customization is not supported, hide the custom title bar
                // element.
                AppTitleBar.Visibility = Visibility.Collapsed;
            }
        }

       


        private AppWindow GetAppWindowForCurrentWindow()
        {
            IntPtr hWnd = WindowNative.GetWindowHandle(this);
            WindowId wndId = Win32Interop.GetWindowIdFromWindow(hWnd);
            return AppWindow.GetFromWindowId(wndId);
        }
    }
}

MainWindow.xaml

<Window
    x:Class="WindowCustomTitleBarSample.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:WindowCustomTitleBarSample"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid>
        <StackPanel Orientation="Horizontal" x:Name="AppTitleBar">
            <TextBlock Margin="10">Example menu</TextBlock>
        
        
        </StackPanel>
    </Grid>
</Window>
@YexuanXiao
Copy link

The same thing also happens in Windows App Sdk 1.3.

@bpulliam bpulliam transferred this issue from microsoft/WindowsAppSDK Apr 20, 2023
@bpulliam bpulliam added bug Something isn't working team-Rendering Issue for the Rendering team fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. area-Windowing and removed team-Rendering Issue for the Rendering team fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. labels Apr 20, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Apr 20, 2023
@bpulliam bpulliam added team-CompInput Issue for IXP (Composition, Input) team and removed needs-triage Issue needs to be triaged by the area owners labels Apr 20, 2023
@bogdan-patraucean
Copy link

I'm having the same issue on 1.3.

@bogdan-patraucean
Copy link

bogdan-patraucean commented Sep 16, 2023

@jhonToni it's fixed now with the latest release of WInAppSdk 1.4. I think you can close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Windowing bug Something isn't working team-CompInput Issue for IXP (Composition, Input) team
Projects
None yet
Development

No branches or pull requests

4 participants