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

Side by Side Diff: ui/aura/root_window_host_linux.cc

Issue 9958152: Consolidate win/x dispatchers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 8 years, 8 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 | Annotate | Revision Log
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/aura/root_window_host_linux.h" 5 #include "ui/aura/root_window_host_linux.h"
6 6
7 #include <X11/cursorfont.h> 7 #include <X11/cursorfont.h>
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/extensions/Xfixes.h> 9 #include <X11/extensions/Xfixes.h>
10 #include <X11/extensions/Xrandr.h> 10 #include <X11/extensions/Xrandr.h>
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 UnConfineCursor(); 341 UnConfineCursor();
342 342
343 XDestroyWindow(xdisplay_, xwindow_); 343 XDestroyWindow(xdisplay_, xwindow_);
344 344
345 // Clears XCursorCache. 345 // Clears XCursorCache.
346 ui::GetXCursor(ui::kCursorClearXCursorCache); 346 ui::GetXCursor(ui::kCursorClearXCursorCache);
347 347
348 XFreeCursor(xdisplay_, invisible_cursor_); 348 XFreeCursor(xdisplay_, invisible_cursor_);
349 } 349 }
350 350
351 base::MessagePumpDispatcher::DispatchStatus RootWindowHostLinux::Dispatch( 351 base::DispatchStatus RootWindowHostLinux::Dispatch(
352 XEvent* xev) { 352 const base::NativeEvent& event) {
353 XEvent* xev = event;
353 bool handled = false; 354 bool handled = false;
354 355
355 // See crbug.com/109884. 356 // See crbug.com/109884.
356 // CheckXEventForConsistency(xev); 357 // CheckXEventForConsistency(xev);
357 358
358 switch (xev->type) { 359 switch (xev->type) {
359 case Expose: 360 case Expose:
360 root_window_->ScheduleFullDraw(); 361 root_window_->ScheduleFullDraw();
361 handled = true; 362 handled = true;
362 break; 363 break;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 } else { 499 } else {
499 break; 500 break;
500 } 501 }
501 } 502 }
502 503
503 MouseEvent mouseev(xev); 504 MouseEvent mouseev(xev);
504 handled = root_window_->DispatchMouseEvent(&mouseev); 505 handled = root_window_->DispatchMouseEvent(&mouseev);
505 break; 506 break;
506 } 507 }
507 } 508 }
508 return handled ? base::MessagePumpDispatcher::EVENT_PROCESSED : 509 return handled ? base::EVENT_PROCESSED : base::EVENT_IGNORED;
509 base::MessagePumpDispatcher::EVENT_IGNORED;
510 } 510 }
511 511
512 void RootWindowHostLinux::SetRootWindow(RootWindow* root_window) { 512 void RootWindowHostLinux::SetRootWindow(RootWindow* root_window) {
513 root_window_ = root_window; 513 root_window_ = root_window;
514 } 514 }
515 515
516 gfx::AcceleratedWidget RootWindowHostLinux::GetAcceleratedWidget() { 516 gfx::AcceleratedWidget RootWindowHostLinux::GetAcceleratedWidget() {
517 return xwindow_; 517 return xwindow_;
518 } 518 }
519 519
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 return new RootWindowHostLinux(bounds); 709 return new RootWindowHostLinux(bounds);
710 } 710 }
711 711
712 // static 712 // static
713 gfx::Size RootWindowHost::GetNativeScreenSize() { 713 gfx::Size RootWindowHost::GetNativeScreenSize() {
714 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay(); 714 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay();
715 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); 715 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0));
716 } 716 }
717 717
718 } // namespace aura 718 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698