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

MouseOver issue with Custom Caption Buttons on Second Monitor #22

Open
Tenweex opened this issue Dec 20, 2024 · 0 comments
Open

MouseOver issue with Custom Caption Buttons on Second Monitor #22

Tenweex opened this issue Dec 20, 2024 · 0 comments

Comments

@Tenweex
Copy link

Tenweex commented Dec 20, 2024

Description of the issue:
When using the EleCho.WpfSuite package to create custom caption buttons in a WPF application, everything works correctly on the primary monitor. However, as soon as I move the window to a second monitor, the following issues occur:

  • The mouseover behavior of the custom caption buttons (e.g., Snap Layout on the Maximize button) stops working.
  • The buttons are no longer clickable.
  • A standard button added to the window (not using the package-specific features) continues to function correctly.
    This issue appears to only affect buttons with properties such as ws:WindowOption.IsMinimumButton, ws:WindowOption.IsMaximumButton, or ws:WindowOption.IsCloseButton.

Steps to reproduce:

  1. Create a WPF window using the code below.
  2. Run the application on a primary monitor and verify that the custom caption buttons work correctly (mouseover and click).
  3. Move the window to a second monitor.
  4. Observe that the custom caption buttons no longer respond to mouseover or click events.

Reproduction code:

<Window x:Class="WPF_test01.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:WPF_test01"
        xmlns:ws="https://schemas.elecho.dev/wpfsuite"
        mc:Ignorable="d"
        ws:WindowOption.Backdrop="Mica"
        ws:WindowOption.IsCaptionMenuVisible="False"
        ws:WindowOption.IsDarkMode="True"
        Background="Transparent"
        Title="MainWindow"
        Height="300"
        Width="450">
    <WindowChrome.WindowChrome>
        <WindowChrome GlassFrameThickness="-1" />
    </WindowChrome.WindowChrome>
    <Grid>
        <StackPanel WindowChrome.IsHitTestVisibleInChrome="True"
                    VerticalAlignment="Top"
                    HorizontalAlignment="Right"
                    Orientation="Horizontal"
                    Height="30">
            <Button x:Name="MinimumButton"
                    FontFamily="Segoe Fluent Icons"
                    Content="&#xE921;"
                    Width="40"
                    ws:WindowOption.IsMinimumButton="True"
                    Click="MinimumButton_Click" />
            <Button x:Name="IsMaximumButton"
                    FontFamily="Segoe Fluent Icons"
                    Content="&#xE922;"
                    Width="40"
                    ws:WindowOption.IsMaximumButton="True"
                    Click="IsMaximumButton_Click" />
            <Button x:Name="IsCloseButton"
                    FontFamily="Segoe Fluent Icons"
                    Content="&#xE8BB;"
                    Width="40"
                    ws:WindowOption.IsCloseButton="True"
                    Click="IsCloseButton_Click" />
        </StackPanel>

        <Button Content="Random button"
                Height="50"
                Width="100"
                ToolTip="Test"/>
    </Grid>
</Window>

Video demonstrating the Issue:

2024-12-21-00-26-01.mp4

Additional information:

  • OS: Windows 11 Professional
    • Version: 23H2
    • Build: 22631.4602
    • Experience: Windows Feature Experience Pack 1000.22700.1055.0
  • Screen Resolutions:
    • Primary monitor: 1920x1080, scaling 100%
    • Secondary monitor: 1920x1080, scaling 100%
    • Note: The issue persists even when the primary monitor is 4K with 150% scaling and the secondary monitor is 1920x1080 with 100% scaling.
  • Package Version: 0.9.14
  • .NET Version: .NET Core 8.0

This issue seems to be related to the interaction between the package and Windows' native behavior when moving a window to a secondary monitor. Thank you for your assistance!

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

No branches or pull requests

1 participant