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

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

Issue 9463003: aura-x11: Add custom web cursor support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 10 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 <algorithm> 9 #include <algorithm>
10 10
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 current_cursor_ = cursor; 543 current_cursor_ = cursor;
544 544
545 // Custom web cursors are handled directly. 545 // Custom web cursors are handled directly.
546 if (cursor == kCursorCustom) 546 if (cursor == kCursorCustom)
547 return; 547 return;
548 548
549 if (cursor_shown_) 549 if (cursor_shown_)
550 SetCursorInternal(cursor); 550 SetCursorInternal(cursor);
551 } 551 }
552 552
553 void RootWindowHostLinux::SetCustomCursor(const gfx::PlatformCursor& cursor) {
554 if (cursor_shown_)
555 XDefineCursor(xdisplay_, xwindow_, cursor);
556 }
557
553 void RootWindowHostLinux::ShowCursor(bool show) { 558 void RootWindowHostLinux::ShowCursor(bool show) {
554 if (show == cursor_shown_) 559 if (show == cursor_shown_)
555 return; 560 return;
556 cursor_shown_ = show; 561 cursor_shown_ = show;
557 SetCursorInternal(show ? current_cursor_ : kCursorNone); 562 SetCursorInternal(show ? current_cursor_ : kCursorNone);
558 } 563 }
559 564
560 gfx::Point RootWindowHostLinux::QueryMouseLocation() { 565 gfx::Point RootWindowHostLinux::QueryMouseLocation() {
561 ::Window root_return, child_return; 566 ::Window root_return, child_return;
562 int root_x_return, root_y_return, win_x_return, win_y_return; 567 int root_x_return, root_y_return, win_x_return, win_y_return;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 return new RootWindowHostLinux(bounds); 659 return new RootWindowHostLinux(bounds);
655 } 660 }
656 661
657 // static 662 // static
658 gfx::Size RootWindowHost::GetNativeScreenSize() { 663 gfx::Size RootWindowHost::GetNativeScreenSize() {
659 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay(); 664 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay();
660 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); 665 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0));
661 } 666 }
662 667
663 } // namespace aura 668 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698