terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Maximized Windows Terminal interferes with display of auto-hidden Windows Taskbar

Open harp-intel opened this issue 2 years ago • 3 comments

Windows Terminal version

1.15.2002.0

Windows build number

10.0.19044.1826

Other Software

No response

Steps to reproduce

  1. Configure Windows taskbar to auto-hide.
  2. Start Windows Terminal.
  3. Maximize Windows Terminal.
  4. Note that moving mouse pointer to edge of screen where taskbar would normally appear does not un-hide taskbar.

Additional configuration information (not sure if relevant):

  • Failure occurs on laptop with or without 2nd monitor connected.
  • Failure occurs when Windows Terminal is maximized on laptop screen.
  • Failure does NOT occur when Windows Terminal is maximized on 2nd monitor.
  • Taskbar configured to display only on laptop screen.
  • Taskbar positioned at bottom of laptop screen.

Expected Behavior

Taskbar is shown when mouse pointer is moved to edge of screen.

Actual Behavior

Taskbar is not shown (un-hidden) when mouse pointer is moved to edge of screen.

harp-intel avatar Aug 05 '22 00:08 harp-intel

As noted in #11789

See also: #4857

Note to future code archeologists: This doesn't seem to work for fullscreen on the primary display. However, testing a bunch of other apps with fullscreen modes and an auto-hiding taskbar has shown that none of them reveal the taskbar from fullscreen mode. This includes Edge, Firefox, Chrome, Sublime Text, Powerpoint - none seemed to support this. This does however work fine for maximized

That mentions fullscreen specifically, not maximized. Not sure if that's the same root cause at this time.

zadjii-msft avatar Aug 10 '22 21:08 zadjii-msft

I'm having the same issue as described above. I've noticed that it only happens when the title bar is hidden

image

Additional information: The error occurs when display scaling is set to 125%. When display scaling is set to 100% the error no longer occurs. Additionally, when returning to 125% display scaling, the error no longer occurs.

Update: changing the display scaling to 100% and then back to 125% seems to have fixed the issue for the current windows session, even after restarting the application.

bortlicenseplates avatar Oct 26 '22 09:10 bortlicenseplates

Also experiencing this, version 1.15.2875.0. Workaround disabling "Hide the title bar" worked, but it leaves me with unsightly and useless title bar. Changing Windows scaling didn't work.

TomasChmelik avatar Dec 06 '22 05:12 TomasChmelik

@ekoschik Hey, you're the User32 wizard, is this the auto-hide taskbar thing we were talking about like a month ago?

zadjii-msft avatar May 03 '23 21:05 zadjii-msft

NonClientIslandWindow::_OnNcCalcSize makes me think that yes, the tabs in the titlebar do have some effect here

zadjii-msft avatar May 03 '23 21:05 zadjii-msft

@zadjii-msft yes, this is the auto-hide taskbar problem I was referring to before, which should be fixed by the code in _OnNcCalcSize under the comment // GH#1438 - Attempt to detect if there's an autohide taskbar.

Some additional info in case its helpful.

  • 'Fullscreen' is not a Win32 state, like Maximized/Minimized. Instead, the system treats a window that covers its monitor to be fullscreen. When a window is fullscreen, the taskbar on that monitor moves below the fullscreen window (by making itself not topmost), which allows fullscreen videos, remote desktop, etc, to cover the taskbar (without being topmost themselves).

  • Auto hide taskbar changes the work area to the monitor rect (as if there was no taskbar). This means that maximized windows are larger than the monitor rect. By default, windows maximize to the work area expanded by the resize borders, which is smaller than the monitor rect if there is a taskbar but larger than the monitor rect without a taskbar. A transparent taskbar window sits at the bottom 2px of the monitor, which allows it to be invoked by receiving mouse input.

  • Traditional maximized windows have a title bar (and fullscreen windows do not), and this distinction is used by the fullscreen detection to differentiate maximized/fullscreen windows. Terminal can hide its taskbar using WM_NCCALCSIZE, but this makes the client rect (when maximized on an auto hide taskbar) cover the monitor rect. And this fools the fullscreen detection into thinking the window is fullscreen.

  • The workaround added to _OnNcCalcSize detects this case and adjusts the client rect to make it NOT cover the monitor, which fixes invoking the auto hide taskbar. This causes a few pixels un-drawn below the window (and this is visible to the user since they can see through to the windows/background image behind the maximized Terminal window).

  • This workaround will not be needed in future OS releases, see PR 8684017 in the OS repo.

ekoschik avatar May 07 '23 21:05 ekoschik

Right on, thanks for the comprehensive summary ☺

zadjii-msft avatar May 12 '23 15:05 zadjii-msft

@zadjii-msft yes, this is the auto-hide taskbar problem I was referring to before, which should be fixed by the code in _OnNcCalcSize under the comment // GH#1438 - Attempt to detect if there's an autohide taskbar.

Some additional info in case its helpful.

* 'Fullscreen' is not a Win32 state, like Maximized/Minimized. Instead, the system treats a window that covers its monitor to be fullscreen. When a window is fullscreen, the taskbar on that monitor moves below the fullscreen window (by making itself not topmost), which allows fullscreen videos, remote desktop, etc, to cover the taskbar (without being topmost themselves).

* Auto hide taskbar changes the work area to the monitor rect (as if there was no taskbar). This means that maximized windows are larger than the monitor rect. By default, windows maximize to the work area expanded by the resize borders, which is smaller than the monitor rect if there is a taskbar but larger than the monitor rect without a taskbar. A transparent taskbar window sits at the bottom 2px of the monitor, which allows it to be invoked by receiving mouse input.

* Traditional maximized windows have a title bar (and fullscreen windows do not), and this distinction is used by the fullscreen detection to differentiate maximized/fullscreen windows. Terminal can hide its taskbar using WM_NCCALCSIZE, but this makes the client rect (when maximized on an auto hide taskbar) cover the monitor rect. And this fools the fullscreen detection into thinking the window is fullscreen.

* The workaround added to _OnNcCalcSize detects this case and adjusts the client rect to make it NOT cover the monitor, which fixes invoking the auto hide taskbar. This causes a few pixels un-drawn below the window (and this is visible to the user since they can see through to the windows/background image behind the maximized Terminal window).

* This workaround will not be needed in future OS releases, see PR 8684017 in the OS repo.

Would it please be possible to have this code only triggered with a user settings such as something like "ignore taskbar status", "ignore hidden taskbar" or similar? The fact the app drawing space is reduced when a hidden taskbar is detected can be super detrimental in some screen resolutions and font sizes combination and makes some terminal app lose a whole row. And of course it also leaves an empty line at the bottom, that with bright wallpapers can be very disturbing. It would be great if this would be an option and that one would not have to remove the code and recompile the app just to avoid this "feature" that for most is actually a bug.

Thank you guys! 👍

HattDroid avatar Dec 16 '23 13:12 HattDroid