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

Unified Diff: chrome/browser/ui/gtk/panels/panel_gtk.cc

Issue 17397006: Fix the problem that some stacked panels might not be brought to the top when a collapsed panel is … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedback Created 7 years, 6 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/gtk/panels/panel_gtk.cc
diff --git a/chrome/browser/ui/gtk/panels/panel_gtk.cc b/chrome/browser/ui/gtk/panels/panel_gtk.cc
index 4361cf931c7f10049d9166322bb3081b6847b7ab..26ae46d1a25a1533a892a8df1b85860785434dce 100644
--- a/chrome/browser/ui/gtk/panels/panel_gtk.cc
+++ b/chrome/browser/ui/gtk/panels/panel_gtk.cc
@@ -195,7 +195,7 @@ void SetFrameSize(const gfx::Size& new_size) {
frame_size.SetSize(new_size.width(), new_size.height());
}
-}
+} // namespace
// static
NativePanel* Panel::CreateNativePanel(Panel* panel,
@@ -608,7 +608,30 @@ gboolean PanelGtk::OnTitlebarButtonPressEvent(
if (event->type != GDK_BUTTON_PRESS)
return TRUE;
- gdk_window_raise(gtk_widget_get_window(GTK_WIDGET(window_)));
+ // If the panel is in a stack, bring all other panels in the stack to the
+ // top.
+ StackedPanelCollection* stack = panel_->stack();
+ if (stack) {
+ for (StackedPanelCollection::Panels::const_iterator iter =
+ stack->panels().begin();
+ iter != stack->panels().end(); ++iter) {
+ Panel* panel = *iter;
+ GtkWindow* gtk_window = panel->GetNativeWindow();
+ // If a panel is collapsed, we make it not to take focus. For such window,
+ // it cannot be brought to the top by calling gdk_window_raise. To work
+ // around this issue, we make it always-on-top first and then put it back
+ // to normal. Note that this trick has been done for all panels in the
+ // stack, regardless of whether it is collapsed or not.
+ // There is one side-effect to this approach: if the panel being pressed
+ // on is collapsed, clicking on the client area of the last active
+ // window will not raise it above these panels.
+ gtk_window_set_keep_above(gtk_window, true);
+ gtk_window_set_keep_above(gtk_window, false);
+ }
+ } else {
+ gdk_window_raise(gtk_widget_get_window(GTK_WIDGET(window_)));
+ }
+
EnsureDragHelperCreated();
drag_helper_->InitialTitlebarMousePress(event, titlebar_->widget());
return TRUE;
« 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