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

Side by Side Diff: ui/views/widget/desktop_aura/x11_window_event_filter.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/widget/desktop_aura/x11_window_event_filter.h" 5 #include "ui/views/widget/desktop_aura/x11_window_event_filter.h"
6 6
7 #include <X11/extensions/XInput.h> 7 #include <X11/extensions/XInput.h>
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/Xatom.h> 9 #include <X11/Xatom.h>
10 #include <X11/Xlib.h> 10 #include <X11/Xlib.h>
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 event->StopPropagation(); 144 event->StopPropagation();
145 } 145 }
146 } 146 }
147 147
148 void X11WindowEventFilter::OnClickedMaximizeButton(ui::MouseEvent* event) { 148 void X11WindowEventFilter::OnClickedMaximizeButton(ui::MouseEvent* event) {
149 aura::Window* target = static_cast<aura::Window*>(event->target()); 149 aura::Window* target = static_cast<aura::Window*>(event->target());
150 views::Widget* widget = views::Widget::GetWidgetForNativeView(target); 150 views::Widget* widget = views::Widget::GetWidgetForNativeView(target);
151 if (!widget) 151 if (!widget)
152 return; 152 return;
153 153
154 gfx::Screen* screen = gfx::Screen::GetNativeScreen();
155 gfx::Rect display_work_area = 154 gfx::Rect display_work_area =
156 screen->GetDisplayNearestWindow(target).work_area(); 155 gfx::Screen::GetScreen()->GetDisplayNearestWindow(target).work_area();
157 gfx::Rect bounds = widget->GetWindowBoundsInScreen(); 156 gfx::Rect bounds = widget->GetWindowBoundsInScreen();
158 if (event->IsMiddleMouseButton()) { 157 if (event->IsMiddleMouseButton()) {
159 bounds.set_y(display_work_area.y()); 158 bounds.set_y(display_work_area.y());
160 bounds.set_height(display_work_area.height()); 159 bounds.set_height(display_work_area.height());
161 widget->SetBounds(bounds); 160 widget->SetBounds(bounds);
162 event->StopPropagation(); 161 event->StopPropagation();
163 } else if (event->IsRightMouseButton()) { 162 } else if (event->IsRightMouseButton()) {
164 bounds.set_x(display_work_area.x()); 163 bounds.set_x(display_work_area.x());
165 bounds.set_width(display_work_area.width()); 164 bounds.set_width(display_work_area.width());
166 widget->SetBounds(bounds); 165 widget->SetBounds(bounds);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 event.xclient.data.l[4] = 0; 230 event.xclient.data.l[4] = 0;
232 231
233 XSendEvent(xdisplay_, x_root_window_, False, 232 XSendEvent(xdisplay_, x_root_window_, False,
234 SubstructureRedirectMask | SubstructureNotifyMask, 233 SubstructureRedirectMask | SubstructureNotifyMask,
235 &event); 234 &event);
236 235
237 return true; 236 return true;
238 } 237 }
239 238
240 } // namespace views 239 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698