mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Ignore title changes from dev tools client
Previously the generic developer tools message would be set as the window title when opened and only removed once the active edit session was changed.
This commit is contained in:
@@ -17,8 +17,9 @@
|
||||
AtomCefClient::AtomCefClient(){
|
||||
}
|
||||
|
||||
AtomCefClient::AtomCefClient(bool handlePasteboardCommands) {
|
||||
AtomCefClient::AtomCefClient(bool handlePasteboardCommands, bool ignoreTitleChanges) {
|
||||
m_HandlePasteboardCommands = handlePasteboardCommands;
|
||||
m_IgnoreTitleChanges = ignoreTitleChanges;
|
||||
}
|
||||
|
||||
AtomCefClient::~AtomCefClient() {
|
||||
|
||||
@@ -16,7 +16,7 @@ class AtomCefClient : public CefClient,
|
||||
public CefRequestHandler {
|
||||
public:
|
||||
AtomCefClient();
|
||||
AtomCefClient(bool handlePasteboardCommands);
|
||||
AtomCefClient(bool handlePasteboardCommands, bool ignoreTitleChanges);
|
||||
virtual ~AtomCefClient();
|
||||
|
||||
CefRefPtr<CefBrowser> GetBrowser() { return m_Browser; }
|
||||
@@ -103,6 +103,7 @@ class AtomCefClient : public CefClient,
|
||||
protected:
|
||||
CefRefPtr<CefBrowser> m_Browser;
|
||||
bool m_HandlePasteboardCommands = false;
|
||||
bool m_IgnoreTitleChanges = false;
|
||||
|
||||
void FocusNextWindow();
|
||||
void FocusPreviousWindow();
|
||||
|
||||
@@ -99,6 +99,8 @@ void AtomCefClient::Confirm(int replyId,
|
||||
|
||||
|
||||
void AtomCefClient::OnTitleChange(CefRefPtr<CefBrowser> browser, const CefString& title) {
|
||||
if (m_IgnoreTitleChanges) return;
|
||||
|
||||
NSWindow *window = [browser->GetHost()->GetWindowHandle() window];
|
||||
[window setTitle:[NSString stringWithUTF8String:title.ToString().c_str()]];
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
[_splitView addSubview:_devToolsView];
|
||||
[_splitView adjustSubviews];
|
||||
|
||||
_cefDevToolsClient = new AtomCefClient(true);
|
||||
_cefDevToolsClient = new AtomCefClient(true, true);
|
||||
std::string devtools_url = _cefClient->GetBrowser()->GetHost()->GetDevToolsURL(true);
|
||||
[self addBrowserToView:_devToolsView url:devtools_url.c_str() cefHandler:_cefDevToolsClient];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user