Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1893)

Unified Diff: chrome/browser/ui/views/app_list/app_list_controller_win.cc

Issue 12326154: [win] Clicking on the taskbar icon should hide the launcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Works, and neater to boot Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/app_list/app_list_controller_win.cc
diff --git a/chrome/browser/ui/views/app_list/app_list_controller_win.cc b/chrome/browser/ui/views/app_list/app_list_controller_win.cc
index 6d5dce28440413066f22f15b7f1518a9d0e489a6..ee9360153c864ab91faf300ab94247d98073752d 100644
--- a/chrome/browser/ui/views/app_list/app_list_controller_win.cc
+++ b/chrome/browser/ui/views/app_list/app_list_controller_win.cc
@@ -699,16 +699,31 @@ void AppListController::CheckTaskbarOrViewHasFocus() {
HWND app_list_hwnd = GetAppListHWND();
- // Get the focused window, and check if it is one of these windows. Keep
- // checking it's parent until either we find one of these windows, or there
- // is no parent left.
+ // Get the focused window. According to MSDN this will be NULL in some cases,
+ // "such as when a window is losing activation". In these cases we do not hide
+ // the launcher. In other cases, we will keep the launcher open if:
+ // - a jump list window has focus, or
+ // - the right mouse button is down and the taskbar has focus, or
+ // - the launcher has regained focus.
+ // This is enough to allow the launcher to be pinned via the right click menu.
HWND focused_hwnd = GetForegroundWindow();
+ if (!focused_hwnd)
+ return;
+
while (focused_hwnd) {
if (focused_hwnd == jump_list_hwnd ||
- focused_hwnd == taskbar_hwnd ||
focused_hwnd == app_list_hwnd) {
return;
}
+ if (focused_hwnd == taskbar_hwnd) {
+ int right_button =
+ GetSystemMetrics(SM_SWAPBUTTON) ? VK_LBUTTON : VK_RBUTTON;
+ bool right_button_down = GetAsyncKeyState(right_button) < 0;
+ if (right_button_down)
+ return;
+
+ break;
+ }
focused_hwnd = GetParent(focused_hwnd);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698