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

Unified Diff: chrome/browser/ui/panels/panel_browser_window_gtk.cc

Issue 8595003: Have panels respond to changes in work area on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
Index: chrome/browser/ui/panels/panel_browser_window_gtk.cc
diff --git a/chrome/browser/ui/panels/panel_browser_window_gtk.cc b/chrome/browser/ui/panels/panel_browser_window_gtk.cc
index c9342e02c86ccdf031a714d97855f9a16d7598d2..857b50be4dad669e98a67a7ed186f033f2dce7f4 100644
--- a/chrome/browser/ui/panels/panel_browser_window_gtk.cc
+++ b/chrome/browser/ui/panels/panel_browser_window_gtk.cc
@@ -70,6 +70,7 @@ PanelBrowserWindowGtk::~PanelBrowserWindowGtk() {
DestroyDragWidget();
}
panel_->OnNativePanelClosed();
+ ui::WorkAreaWatcherX::RemoveObserver(this);
}
void PanelBrowserWindowGtk::Init() {
@@ -92,6 +93,15 @@ void PanelBrowserWindowGtk::Init() {
G_CALLBACK(OnTitlebarButtonPressEventThunk), this);
g_signal_connect(titlebar_widget(), "button-release-event",
G_CALLBACK(OnTitlebarButtonReleaseEventThunk), this);
+
+ // Strictly speaking we should have a single observer for work area changed
Dmitry Titov 2011/11/18 04:56:37 Not sure that long comment has to be here. If it's
prasadt 2011/11/18 22:31:42 Just a clarification in case someone wonders why i
+ // notification. There are a few reasons for doing it this way:
+ // 1) Keep it consistent with the way we do it on other platforms.
+ // 2) This is a rare enough event to create a separate class with
+ // implementations for all platforms.
+ // 3) It may not be possible to listen to this event without assoicating it
+ // with a window on all platforms.
+ ui::WorkAreaWatcherX::AddObserver(this);
}
bool PanelBrowserWindowGtk::GetWindowEdge(int x, int y, GdkWindowEdge* edge) {
@@ -225,6 +235,10 @@ BrowserWindowGtk::TitleDecoration PanelBrowserWindowGtk::GetWindowTitle(
}
}
+void PanelBrowserWindowGtk::WorkAreaChanged() {
+ panel_->manager()->OnDisplayChanged();
+}
+
void PanelBrowserWindowGtk::ShowPanel() {
Show();
}

Powered by Google App Engine
This is Rietveld 408576698