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

Investigate Acrylic in titlebar / not using a HRGN for the titlebar #4744

Closed
rashil2000 opened this issue Feb 28, 2020 · 7 comments · Fixed by #5485
Closed

Investigate Acrylic in titlebar / not using a HRGN for the titlebar #4744

rashil2000 opened this issue Feb 28, 2020 · 7 comments · Fixed by #5485
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@rashil2000
Copy link
Contributor

rashil2000 commented Feb 28, 2020

Description of the new feature/enhancement

The title says it all.
This is another really good thing that Windows Terminal could borrow from felixse/FluentTerminal.
This would basically expand the current terminal's background (including all the modifications done to it, for example a custom background image or opacity level) over to the titlebar (including the minimize, maximize and close icons).
This would make it consistent with other Windows apps following Fluent Design (think of the Settings app and its titlebar), apart from making it look really cool.
Attached here is a screenshot of Fluent Terminal (with acrylic blur and without any background image):

Screenshot (145)

Proposed technical implementation details (optional)

While digging for similar requests (I couldn't find an issue that addressed this specifically), I read somewhere that such a thing isn't possible given the architecture. Well, if that's the case, too bad. But I'm still opening the issue so that this remains documented somewhere separately.

@rashil2000 rashil2000 added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Feb 28, 2020
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Feb 28, 2020
@zadjii-msft
Copy link
Member

This is actually something that's already discussed in #1375, the megathread that probably mentioned

The title bar isn't acrylic, sorry, that one probably can't happen given our architecture

We'd love to make the titlebar acrylic like this, but give the platform limitations, this unfortunately won't be possible.

There's also #3327, which as a part of that thread is tracking changing the titlebar background to match the terminal control. This includes issues #3774, #702, which are both pretty similar.

I'm going to mark this as
/dup #702, #3774, #3327

Thanks!

@ghost
Copy link

ghost commented Feb 28, 2020

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed Feb 28, 2020
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Feb 28, 2020
@1kjo
Copy link
Contributor

1kjo commented Feb 28, 2020

@zadjii-msft I think I found a way to make the title bar acrylic and still allow the window to be moved with the drag bar. I posted it here: #2100 (comment):

replace the SetWindowRgn trickery by a completely transparent, invisible window that we put on top of the drag bar and that catches all of the mouse events

I didn't try applying that solution to the terminal yet but I tried prototyping a solution on a repo on my GitHub and it seems to work: https://github.com/greg904/LearnXamlIslands (if ever you look at it, ignore the _top_border_window and the big space at the top of the window, it's because I'm also using that repo to prototype other things).

GIF of a prototype with the idea above implemented (again, ignore the big space at the top):
test

So I think it is possible to do it.

@rashil2000
Copy link
Contributor Author

Hey @zadjii-msft, would you mind reopening this to take @greg904's work into consideration?

@zadjii-msft
Copy link
Member

Woah okay that's incredible. I've been a little MIA for the last month so I missed that comment. I'd love to see if that would work! I'm trying to remember a far off, long ago conversation we had with someone on the input team that said this might not work in all scenarios. Something about the "move-size" loop was said.

If you can get that working without the standard titlebar / working in the Terminal, I'd certainly be stoked. I guess I'll use this issue to track that investigation. If that pans out, we could probably just close #2100. If this doesn't work out, then we'll still need a solution to #2100 before we ship 1.0.

@zadjii-msft zadjii-msft reopened this Feb 28, 2020
@zadjii-msft zadjii-msft changed the title Make titlebar flush with the terminal window Investigate Acrylic in titlebar / not using a HRGN for the titlebar Feb 28, 2020
@zadjii-msft zadjii-msft added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. labels Feb 28, 2020
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Feb 28, 2020
@DHowett-MSFT
Copy link
Contributor

@greg904 I am in love with this idea. Sorry I didn't say that on your other titlebar PR. 😄

@1kjo 1kjo mentioned this issue Mar 2, 2020
3 tasks
@ghost ghost added the In-PR This issue has a related PR label Mar 2, 2020
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Apr 24, 2020
DHowett-MSFT pushed a commit that referenced this issue Apr 24, 2020
Also known as "Kill HRGN II: Kills Regions Dead (#5485)"

Copying the description from @greg904 in #4778.

--- 8< ---
My understanding is that the XAML framework uses another way of getting
mouse input that doesn't work with `WM_SYSCOMMAND` with `SC_MOVE`. It
looks like it "steals" our mouse messages like `WM_LBUTTONDOWN`.

Before, we were cutting (with `HRGN`s) the drag bar part of the XAML
islands window in order to catch mouse messages and be able to implement
the drag bar that can move the window. However this "cut" doesn't only
apply to input (mouse messages) but also to the graphics so we had to
paint behind with the same color as the drag bar using GDI to hide the
fact that we were cutting the window.

The main issue with this is that we have to replicate exactly the
rendering on the XAML drag bar using GDI and this is bad because:
1. it's hard to keep track of the right color: if a dialog is open, it
   will cover the whole window including the drag bar with a transparent
   white layer and it's hard to keep track of those things.
2. we can't do acrylic with GDI

So I found another method, which is to instead put a "drag window"
exactly where the drag bar is, but on top of the XAML islands window (in
Z order). I've found that this lets us receive the `WM_LBUTTONDOWN`
messages.
--- >8 ---

Dustin's notes: I've based this on the implementation of the input sink
window in the UWP application frame host.

Tested manually in all configurations (debug, release) with snap,
drag, move, double-click and double-click on the resize handle. Tested
at 200% scale.

Closes #4744
Closes #2100
Closes #4778 (superseded.)
@ghost ghost removed the In-PR This issue has a related PR label Apr 24, 2020
@ghost ghost added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Apr 24, 2020
@ghost
Copy link

ghost commented May 5, 2020

🎉This issue was addressed in #5485, which has now been successfully released as Windows Terminal Release Candidate v0.11.1251.0 (1.0rc1).:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants