lepoco / lepoco/wpfui

Maximise does not respect the taskbar when using a borderless window with a TitleBar control

Open
#545 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
9.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

When using a borderless window, ie WindowStyle="None", and using a TitleBar control to provide the maximize/minimize/close buttons, when maximizing the window it fills the entire screen instead of stopping at the taskbar.

To Reproduce

Create a borderless window with a TitleBar:

<ui:UiWindow x:Class="MyApp.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:MyApp" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" mc:Ignorable="d" Title="MyApp" Height="700" Width="1100" MinHeight="580" MinWidth="1100" WindowStyle="None" Background="Transparent" AllowsTransparency="True" ResizeMode="CanResizeWithGrip" WindowStartupLocation="CenterScreen"> <Grid> <Grid.RowDefinitions.../> <Grid.ColumnDefinitions..../> <ui:TitleBar Grid.ColumnSpan="2" Grid.Row="0" Title="MyApp" Foreground="#03DAC5" FontSize="18" CanMaximize="True" UseSnapLayout="True"/>

Use the Maximize button in the TitleBar to maximize the window.

Expected behavior

Maximized window should stop at the Taskbar area.

Screenshots

Instead of stopping at the taskbar:

image

The window covers the entire screen including the taskbar:

image

OS version

Windows 10/11

.NET version

4.8

WPF-UI NuGet version

2.0.3

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the borderless WindowStyle="None" example and inspect the TitleBar maximize handling. Verify the maximized window bounds on Windows 10/11, with completion defined as the window stopping above the taskbar rather than covering it.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.