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

Unified Diff: src/platform/window_manager/mock_chrome.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.h ('k') | src/platform/window_manager/panel_bar.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/window_manager/mock_chrome.cc
diff --git a/src/platform/window_manager/mock_chrome.cc b/src/platform/window_manager/mock_chrome.cc
index c6da47fcd37e092abce63f76eb6eff9f8589dd9c..e05389d98c409017bcc0907e3bd337d42c3b4bd1 100644
--- a/src/platform/window_manager/mock_chrome.cc
+++ b/src/platform/window_manager/mock_chrome.cc
@@ -744,7 +744,10 @@ bool PanelTitlebar::on_button_press_event(GdkEventButton* event) {
mouse_down_ = true;
mouse_down_abs_x_ = event->x_root;
mouse_down_abs_y_ = event->y_root;
- mouse_down_offset_x_ = event->x;
+
+ int width = 1, height = 1;
+ get_size(width, height);
+ mouse_down_offset_x_ = event->x - width;
mouse_down_offset_y_ = event->y;
dragging_ = false;
return true;
@@ -796,7 +799,7 @@ bool PanelTitlebar::on_motion_notify_event(GdkEventMotion* event) {
}
}
if (dragging_) {
- WmIpc::Message msg(WmIpc::Message::WM_MOVE_PANEL);
+ WmIpc::Message msg(WmIpc::Message::WM_NOTIFY_PANEL_DRAGGED);
msg.set_param(0, panel_->xid());
msg.set_param(1, event->x_root - mouse_down_offset_x_);
msg.set_param(2, event->y_root - mouse_down_offset_y_);
@@ -883,6 +886,9 @@ MockChrome::MockChrome()
atom_cache_(new AtomCache(xconn_.get())),
wm_ipc_(new WmIpc(xconn_.get(), atom_cache_.get())),
window_under_floating_tab_(NULL) {
+ WmIpc::Message msg(WmIpc::Message::WM_NOTIFY_IPC_VERSION);
+ msg.set_param(0, 1);
+ wm_ipc_->SendMessage(wm_ipc_->wm_window(), msg);
}
ChromeWindow* MockChrome::CreateWindow(int width, int height) {
« no previous file with comments | « src/platform/window_manager/mock_chrome.h ('k') | src/platform/window_manager/panel_bar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698