summaryrefslogtreecommitdiffstats
path: root/chrome/views/window.cc
diff options
context:
space:
mode:
authorbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-11 17:46:07 +0000
committerbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-11 17:46:07 +0000
commit621adaae105bee50e90d58accbe4d52f6bd8139c (patch)
tree90d49a019e072a16f61263e761a75fb648c0d4a0 /chrome/views/window.cc
parent59b872f5f1d071077e57b828162e9246c2a5c255 (diff)
downloadchromium_src-621adaae105bee50e90d58accbe4d52f6bd8139c.zip
chromium_src-621adaae105bee50e90d58accbe4d52f6bd8139c.tar.gz
chromium_src-621adaae105bee50e90d58accbe4d52f6bd8139c.tar.bz2
Add support for ChromeViews::Windows to disable inactive rendering. This is for the new frames to make it so when infobubbles are activated the window frame isn't deactivated.
B=1318343 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@659 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/window.cc')
-rw-r--r--chrome/views/window.cc33
1 files changed, 21 insertions, 12 deletions
diff --git a/chrome/views/window.cc b/chrome/views/window.cc
index 66f3f93..47b4444 100644
--- a/chrome/views/window.cc
+++ b/chrome/views/window.cc
@@ -158,20 +158,19 @@ bool Window::IsMinimized() const {
void Window::EnableClose(bool enable) {
EnableMenuItem(::GetSystemMenu(GetHWND(), false),
- SC_CLOSE,
- enable ? MF_ENABLED : MF_GRAYED);
+ SC_CLOSE, enable ? MF_ENABLED : MF_GRAYED);
// Let the window know the frame changed.
SetWindowPos(NULL, 0, 0, 0, 0,
- SWP_FRAMECHANGED |
- SWP_NOACTIVATE |
- SWP_NOCOPYBITS |
- SWP_NOMOVE |
- SWP_NOOWNERZORDER |
- SWP_NOREPOSITION |
- SWP_NOSENDCHANGING |
- SWP_NOSIZE |
- SWP_NOZORDER);
+ SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOCOPYBITS |
+ SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOREPOSITION |
+ SWP_NOSENDCHANGING | SWP_NOSIZE | SWP_NOZORDER);
+}
+
+void Window::DisableInactiveRendering(bool disable) {
+ disable_inactive_rendering_ = disable;
+ if (!disable_inactive_rendering_)
+ DefWindowProc(GetHWND(), WM_NCACTIVATE, FALSE, 0);
}
void Window::UpdateWindowTitle() {
@@ -275,7 +274,8 @@ Window::Window(WindowDelegate* window_delegate)
is_modal_(false),
restored_enabled_(false),
is_always_on_top_(false),
- window_closed_(false) {
+ window_closed_(false),
+ disable_inactive_rendering_(false) {
InitClass();
DCHECK(window_delegate_);
window_delegate_->window_.reset(this);
@@ -368,6 +368,15 @@ LRESULT Window::OnEraseBkgnd(HDC dc) {
return 1;
}
+LRESULT Window::OnNCActivate(BOOL active) {
+ if (disable_inactive_rendering_) {
+ disable_inactive_rendering_ = false;
+ return DefWindowProc(GetHWND(), WM_NCACTIVATE, TRUE, 0);
+ }
+ // Otherwise just do the default thing.
+ return HWNDViewContainer::OnNCActivate(active);
+}
+
LRESULT Window::OnNCHitTest(const CPoint& point) {
// First, give the ClientView a chance to test the point to see if it is part
// of the non-client area.