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

Unified Diff: remoting/host/it2me/it2me_confirmation_dialog_win.cc

Issue 2418613003: Adding 'Always on top' behavior to the It2Me Confirmation Dialog (Closed)
Patch Set: Updating comments Created 4 years, 2 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: remoting/host/it2me/it2me_confirmation_dialog_win.cc
diff --git a/remoting/host/it2me/it2me_confirmation_dialog_win.cc b/remoting/host/it2me/it2me_confirmation_dialog_win.cc
index 7f74dc4b2e4a81d5829fd435de726e61b7861b96..7a7aa9a809b06bd2e23b410c0ff1c0b5008b789e 100644
--- a/remoting/host/it2me/it2me_confirmation_dialog_win.cc
+++ b/remoting/host/it2me/it2me_confirmation_dialog_win.cc
@@ -203,6 +203,19 @@ It2MeConfirmationDialogWin::TaskDialogCallbackProc(HWND hwnd,
SetForegroundWindow(hwnd);
dialog->is_foreground_window_ = false;
}
+
+ if (!dialog->is_foreground_window_) {
+ // Ensure the dialog is always at the top of the top-most window stack,
+ // even if it doesn't have focus, so the user can always see it.
+ BringWindowToTop(hwnd);
+ }
+ } else if (notification == TDN_CREATED) {
+ // After the dialog has been created, but before it is visible, set its
+ // z-order so it will be a top-most window and have always on top behavior.
+ if (!SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0,
+ SWP_NOMOVE | SWP_NOSIZE)) {
+ PLOG(ERROR) << "SetWindowPos() failed";
+ }
}
return S_OK;
« 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