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

Unified Diff: src/platform/window_manager/panel_bar.cc

Issue 527005: wm: Make WM_MOVE_PANEL use top-right coordinates. (Closed)
Patch Set: fix a poorly-worded sentence Created 10 years, 11 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 | « src/platform/window_manager/mock_chrome.cc ('k') | src/platform/window_manager/window_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/window_manager/panel_bar.cc
diff --git a/src/platform/window_manager/panel_bar.cc b/src/platform/window_manager/panel_bar.cc
index bca015f12bfcb2ef0492ce96d46ae8953c7710eb..52c4211149d06876606d3f70ee137f909db3f07c 100644
--- a/src/platform/window_manager/panel_bar.cc
+++ b/src/platform/window_manager/panel_bar.cc
@@ -343,12 +343,12 @@ bool PanelBar::HandleChromeMessage(const WmIpc::Message& msg) {
}
break;
}
- case WmIpc::Message::WM_MOVE_PANEL: {
+ case WmIpc::Message::WM_NOTIFY_PANEL_DRAGGED: {
XWindow xid = msg.param(0);
Window* win = wm_->GetWindow(xid);
if (!win) {
- LOG(WARNING) << "Ignoring WM_MOVE_PANEL message for unknown window "
- << XidStr(xid);
+ LOG(WARNING) << "Ignoring WM_NOTIFY_PANEL_DRAGGED message for unknown "
+ << "window " << XidStr(xid);
return true;
}
int x = msg.param(1);
@@ -520,7 +520,10 @@ void PanelBar::MoveDraggedPanel() {
return;
const int drag_x = dragged_panel_event_coalescer_.x();
- dragged_panel_->MoveX(drag_x + dragged_panel_->titlebar_width(), false, 0);
+ dragged_panel_->MoveX((wm_->wm_ipc_version() >= 1) ?
+ drag_x :
+ drag_x + dragged_panel_->titlebar_width(),
+ false, 0);
// When an expanded panel is being dragged, we don't move the other
// panels to make room for it until the drag is done.
@@ -533,7 +536,9 @@ void PanelBar::MoveDraggedPanel() {
CHECK(dragged_it != collapsed_panels_.end());
// Next, check if the center of the panel has moved over another panel.
- const int center_x = drag_x + 0.5 * dragged_panel_->titlebar_width();
+ const int center_x = (wm_->wm_ipc_version() >= 1) ?
+ drag_x - 0.5 * dragged_panel_->titlebar_width() :
+ drag_x + 0.5 * dragged_panel_->titlebar_width();
Panels::iterator it = collapsed_panels_.begin();
for (; it != collapsed_panels_.end(); ++it) {
int snapped_left = 0, snapped_right = 0;
« no previous file with comments | « src/platform/window_manager/mock_chrome.cc ('k') | src/platform/window_manager/window_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698