-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Make the window name _quake
special
#9785
Changes from 6 commits
7560ee3
8d9c1f1
2db7fd5
04a4249
87c6c2d
34f0dfd
2a1b468
1e43eef
beb96e3
d3861c5
02e4ef7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2049,9 +2049,17 @@ namespace winrt::TerminalApp::implementation | |
// - <none> | ||
void TerminalPage::ToggleFocusMode() | ||
{ | ||
_isInFocusMode = !_isInFocusMode; | ||
_UpdateTabView(); | ||
_FocusModeChangedHandlers(*this, nullptr); | ||
_SetFocusMode(!_isInFocusMode); | ||
} | ||
|
||
void TerminalPage::_SetFocusMode(const bool inFocusMode) | ||
{ | ||
if (inFocusMode != FocusMode()) | ||
{ | ||
_isInFocusMode = inFocusMode || IsQuakeWindow(); | ||
_UpdateTabView(); | ||
_FocusModeChangedHandlers(*this, nullptr); | ||
} | ||
} | ||
|
||
// Method Description: | ||
|
@@ -2260,7 +2268,7 @@ namespace winrt::TerminalApp::implementation | |
|
||
bool TerminalPage::FocusMode() const | ||
{ | ||
return _isInFocusMode; | ||
return _isInFocusMode || IsQuakeWindow(); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems a bit weird to me. If QM is always in FM, why do we need to make this change at all? Shouldn't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea that's weird |
||
|
||
bool TerminalPage::Fullscreen() const | ||
|
@@ -2596,10 +2604,21 @@ namespace winrt::TerminalApp::implementation | |
} | ||
void TerminalPage::WindowName(const winrt::hstring& value) | ||
{ | ||
const bool oldIsQuakeMode = IsQuakeWindow(); | ||
if (_WindowName != value) | ||
{ | ||
_WindowName = value; | ||
_PropertyChangedHandlers(*this, WUX::Data::PropertyChangedEventArgs{ L"WindowNameForDisplay" }); | ||
|
||
// If we're entering quake mode, or leaving it | ||
if (IsQuakeWindow() != oldIsQuakeMode) | ||
{ | ||
// If we're entering QM from ~FM, then this will enter FM | ||
zadjii-msft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// If we're entering QM from FM, then this will do nothing | ||
// If we're leaving QM (we're already in FM), then this will do nothing | ||
_SetFocusMode(_isInFocusMode); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A continuation of my confusion from above, why not do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. meh, this one gets to be more explicit in what it's trying to do because it's already inside the TerminalPage. Technically, yes, |
||
_IsQuakeWindowChangedHandlers(*this, nullptr); | ||
} | ||
} | ||
} | ||
|
||
|
@@ -2735,4 +2754,9 @@ namespace winrt::TerminalApp::implementation | |
WindowRenamer().IsOpen(false); | ||
} | ||
} | ||
|
||
bool TerminalPage::IsQuakeWindow() const | ||
{ | ||
return WindowName() == L"_quake"; | ||
zadjii-msft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why
ToggleFocusMode
and not something likeEnableFocusMode
orSetFocusMode(true)
? QM will always be in focus mode right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frankly, I hadn't written
_SetFocusMode
yet when I added this line 😋There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, but that's a private member on TerminalPage... meh, I just didn't feel like adding another method that'll only have one usage right here