Skip to content

GridSplitter does not capture input #2719

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

Open
stefankueng opened this issue Dec 24, 2018 · 6 comments
Open

GridSplitter does not capture input #2719

stefankueng opened this issue Dec 24, 2018 · 6 comments
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior no-recent-activity 📉 Open Issues that require attention
Milestone

Comments

@stefankueng
Copy link

stefankueng commented Dec 24, 2018

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

When moving a GridSplitter, the mouse pointer often moves outside the GridSplitter-Area, which is expected. But when that happens, the controls beside the GridSplitter still get pointer events.

Expected behavior

I would expect other controls to not receive pointer events at all during dragging a GridSplitter.

Minimal reproduction of the problem with instructions

Minimal Project: Create new "Windows Template Studio" c# project in VS, project type "Blank", leave the rest as default. Then edit the MainPage.xaml:

<Page
    x:Class="App1.Views.MainPage"
    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:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
    Style="{StaticResource PageStyle}"
    mc:Ignorable="d">
    <Grid
        x:Name="ContentArea"
        Margin="{StaticResource MediumLeftRightMargin}">
        <Grid.RowDefinitions>
            <RowDefinition Height="40*"/>
            <RowDefinition Height="10"/>
            <RowDefinition Height="40*"/>
        </Grid.RowDefinitions>

        <Grid x:Name="top" PointerMoved="Top_PointerMoved" Background="White" ManipulationMode="All" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
        <controls:GridSplitter x:Name="splitter" Grid.Row="1"/>
        <Grid x:Name="bottom" Grid.Row="2" PointerMoved="Bottom_PointerMoved" Background="AliceBlue" ManipulationMode="All" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
    </Grid>
</Page>

Views.zip

and in the code-behind (MainPage.xaml.cs):

private void Top_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
    System.Diagnostics.Debug.WriteLine("pointer moved top");
}

private void Bottom_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
    System.Diagnostics.Debug.WriteLine("pointer moved bottom");
}

Run the project, then move the GridSplitter. You'll get lots of debug messages printed while dragging the splitter.

Environment

Nuget Package(s): 
Microsoft.Toolkit.Uwp.UI.Controls

Package Version(s): 
latest stable: 5.0.0

Windows 10 Build Number:
- [x] October 2018 Update (17763)

App min and target version:
- [x] April 2018 Update (17134)
- [x] October 2018 Update (17763)

Device form factor:
- [x] Desktop

Visual Studio 
- [x] 2017 (version: 15.9.4)
@skendrot
Copy link
Contributor

skendrot commented Dec 28, 2018

I'm not sure how this is a bug. If I depress the mouse on a button and move the mouse off the button the controls will receive mouse events as well

@stefankueng
Copy link
Author

I think it's a bug: while dragging the splitter, the mouse should ideally stay on the splitter (the splitter moves with the mouse), but due to lags the splitter is usually a little behind. But in that case I don't want mouse events to happen on other controls.

If you depress the mouse on a button and then move the mouse off the button, but you expect the button to move (you're dragging the button), then you wouldn't expect other controls to receive mouse events, do you?

For example: if you drag a scrollbar bar and you move slightly off the bar into the main window while you're dragging it, the main window won't receive mouse events either - because at that time you're dragging the scrollbar bar.

My problem is this: While dragging the splitter, the resized panels receive mouse events, namely pointer-move events. One of the resizing panels then interprets these events: uses moves mouse while having the left mouse button pressed. And since it's an ink panel it draws garbage with the currently active pen-style and color. And it's garbage because the user was dragging the splitter, not drawing.

@michael-hawker michael-hawker added this to the 5.1 milestone Jan 8, 2019
@windowstoolkitbot
Copy link

This issue seems inactive. Do you need help to complete this issue?

@Bmartin2013 Bmartin2013 added bug 🐛 An unexpected issue that highlights incorrect behavior GridSplitter labels Jan 25, 2019
@windowstoolkitbot
Copy link

This issue seems inactive. Do you need help to complete this issue?

@michael-hawker michael-hawker removed this from the 5.1 milestone Feb 7, 2019
@windowstoolkitbot
Copy link

This issue seems inactive. It will automatically be closed in 14 days if there is no activity.

@windowstoolkitbot
Copy link

Issue is inactive. It was automatically closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior no-recent-activity 📉 Open Issues that require attention
Projects
None yet
Development

No branches or pull requests

6 participants