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

Issue 9318018: Panels not getting focus on Linux when expanded from API on Linux. (Closed)

Created:
8 years, 10 months ago by prasadt
Modified:
8 years, 10 months ago
CC:
chromium-reviews, jennb, jianli, dcheng
Visibility:
Public.

Description

Panels not getting focus on Linux when expanded from API on Linux. When panel goes to minimized state, we set the window to not accept focus. We do this to prevent panel getting focus assigned by the OS in minimized state. When panel gets expanded programmatically, we're not changing the window state to be able to accept focus. Fixed by having PanelBrowserWindowGtk listen to expansion state change notification. BUG=112030 TEST=Repro steps in bug. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=120797

Patch Set 1 #

Total comments: 4

Patch Set 2 : Code review. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -10 lines) Patch
M chrome/browser/ui/gtk/browser_window_gtk.cc View 1 1 chunk +0 lines, -3 lines 2 comments Download
M chrome/browser/ui/panels/panel_browser_window_gtk.h View 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/ui/panels/panel_browser_window_gtk.cc View 1 4 chunks +17 lines, -7 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
prasadt
8 years, 10 months ago (2012-02-01 00:20:56 UTC) #1
jennb
I wish there was a way to do this without watching for expansion state notifications. ...
8 years, 10 months ago (2012-02-01 00:31:47 UTC) #2
prasadt
http://codereview.chromium.org/9318018/diff/1/chrome/browser/ui/panels/panel_browser_window_gtk.cc File chrome/browser/ui/panels/panel_browser_window_gtk.cc (right): http://codereview.chromium.org/9318018/diff/1/chrome/browser/ui/panels/panel_browser_window_gtk.cc#newcode245 chrome/browser/ui/panels/panel_browser_window_gtk.cc:245: gtk_widget_get_window(GTK_WIDGET(window())), accept_focus); On 2012/02/01 00:31:47, jennb wrote: > This ...
8 years, 10 months ago (2012-02-01 00:37:47 UTC) #3
prasadt
On 2012/02/01 00:31:47, jennb wrote: > I wish there was a way to do this ...
8 years, 10 months ago (2012-02-01 00:39:43 UTC) #4
Dmitry Titov
lgtm with a question. http://codereview.chromium.org/9318018/diff/1/chrome/browser/ui/panels/panel_browser_window_gtk.cc File chrome/browser/ui/panels/panel_browser_window_gtk.cc (right): http://codereview.chromium.org/9318018/diff/1/chrome/browser/ui/panels/panel_browser_window_gtk.cc#newcode247 chrome/browser/ui/panels/panel_browser_window_gtk.cc:247: BrowserWindowGtk::Observe(type, source, details); Having this ...
8 years, 10 months ago (2012-02-01 01:30:57 UTC) #5
prasadt
estade - Please take a look at browser_window_gtk.cc changes. http://codereview.chromium.org/9318018/diff/1/chrome/browser/ui/panels/panel_browser_window_gtk.cc File chrome/browser/ui/panels/panel_browser_window_gtk.cc (right): http://codereview.chromium.org/9318018/diff/1/chrome/browser/ui/panels/panel_browser_window_gtk.cc#newcode247 chrome/browser/ui/panels/panel_browser_window_gtk.cc:247: ...
8 years, 10 months ago (2012-02-01 01:52:27 UTC) #6
Dmitry Titov
lgtm++
8 years, 10 months ago (2012-02-01 21:55:24 UTC) #7
Evan Stade
http://codereview.chromium.org/9318018/diff/6001/chrome/browser/ui/gtk/browser_window_gtk.cc File chrome/browser/ui/gtk/browser_window_gtk.cc (left): http://codereview.chromium.org/9318018/diff/6001/chrome/browser/ui/gtk/browser_window_gtk.cc#oldcode1267 chrome/browser/ui/gtk/browser_window_gtk.cc:1267: default: I don't understand why you are deleting this ...
8 years, 10 months ago (2012-02-01 22:19:02 UTC) #8
prasadt
http://codereview.chromium.org/9318018/diff/6001/chrome/browser/ui/gtk/browser_window_gtk.cc File chrome/browser/ui/gtk/browser_window_gtk.cc (left): http://codereview.chromium.org/9318018/diff/6001/chrome/browser/ui/gtk/browser_window_gtk.cc#oldcode1267 chrome/browser/ui/gtk/browser_window_gtk.cc:1267: default: On 2012/02/01 22:19:02, Evan Stade wrote: > I ...
8 years, 10 months ago (2012-02-01 22:40:30 UTC) #9
Evan Stade
instead you should return after handling the notification
8 years, 10 months ago (2012-02-02 23:10:49 UTC) #10
prasadt
On 2012/02/02 23:10:49, Evan Stade wrote: > instead you should return after handling the notification ...
8 years, 10 months ago (2012-02-02 23:22:23 UTC) #11
prasadt
On 2012/02/02 23:22:23, prasadt wrote: > On 2012/02/02 23:10:49, Evan Stade wrote: > > instead ...
8 years, 10 months ago (2012-02-03 23:40:43 UTC) #12
Evan Stade
if (notification_type == PANEL_FOO_BAR) { foo(); return; } else if (notification_type == GENERIC_FOO_BAR_THAT_BROWSER_WINDOW_GTK_ALSO_REGISTERED_FOR) { bar(); ...
8 years, 10 months ago (2012-02-06 20:27:08 UTC) #13
prasadt
On 2012/02/06 20:27:08, Evan Stade wrote: > if (notification_type == PANEL_FOO_BAR) { > foo(); > ...
8 years, 10 months ago (2012-02-06 21:06:06 UTC) #14
Evan Stade
8 years, 10 months ago (2012-02-07 17:29:31 UTC) #15
On 2012/02/06 21:06:06, prasadt wrote:
> On 2012/02/06 20:27:08, Evan Stade wrote:
> > if (notification_type == PANEL_FOO_BAR) {
> >   foo();
> >   return;
> > } else if (notification_type ==
> > GENERIC_FOO_BAR_THAT_BROWSER_WINDOW_GTK_ALSO_REGISTERED_FOR) {
> >   bar();
> >   // no return
> > }
> > 
> > BrowserWindowGtk::Observe(...);
> 
> That works. But that'd be coupling the base and derived class implementations
> too closely. Anytime you add a new notification to
> PanelBrowserWindowGtk::Observe, you'll need to refer to the base class
> implementation to see if it should be propagated or not.

well, yea, derived classes do tend to depend on their parents.

> Similarly if you add a
> new notification to BrowserWindowGtk::Observe, you'll need to check
> PanelBrowserWindowGtk::Observe to make sure that its not being eaten by the
> derived class. That feels broken to me.

The code change would not be in BrowserWindowGtk, it would be adding/removing a
return in PanelBrowserWindowGtk, so this is actually another example where the
derived class has to have knowledge of the workings of the base class, which is
entirely reasonable. In fact with the patch you have, you're not really dodging
the situation you just described: if BrowserWindowGtk suddenly starts observing
a new notification which PanelBrowserWindowGtk already uses, it seems equally
likely that the new behavior will somehow break PanelBrowserWindowGtk.

but I guess I don't really care that much, so lgtm.

Powered by Google App Engine
This is Rietveld 408576698