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

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

Issue 10981024: Clear root window when the aura root window is moved/resized (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: guard with OS_CHROMEOS Created 8 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/Xfixes.h> 8 #include <X11/extensions/Xfixes.h>
9 #include <X11/extensions/XInput2.h> 9 #include <X11/extensions/XInput2.h>
10 #include <X11/extensions/Xrandr.h> 10 #include <X11/extensions/Xrandr.h>
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 p.SetPoint(0, 0); 504 p.SetPoint(0, 0);
505 XWarpPointer( 505 XWarpPointer(
506 xdisplay_, None, x_root_window_, 0, 0, 0, 0, p.x(), p.y()); 506 xdisplay_, None, x_root_window_, 0, 0, 0, 0, p.x(), p.y());
507 } 507 }
508 ConfineCursorToRootWindow(); 508 ConfineCursorToRootWindow();
509 } 509 }
510 if (size_changed) 510 if (size_changed)
511 delegate_->OnHostResized(bounds.size()); 511 delegate_->OnHostResized(bounds.size());
512 if (origin_changed) 512 if (origin_changed)
513 delegate_->OnHostMoved(bounds_.origin()); 513 delegate_->OnHostMoved(bounds_.origin());
514 #if defined(OS_CHROMEOS)
515 // TODO(oshima): Clear the root when the window is moved or
516 // resized while the extended desktop is disabled.
517 // crbug.com/152003.
518 if (base::chromeos::IsRunningOnChromeOS()) {
519 XGCValues gc_values = {0};
520 gc_values.foreground = BlackPixel(xdisplay_, DefaultScreen(xdisplay_));
521 GC gc = XCreateGC(xdisplay_, x_root_window_, GCForeground, &gc_values);
522 XFillRectangle(xdisplay_, x_root_window_, gc,
523 x_root_bounds_.x(),
524 x_root_bounds_.y(),
525 x_root_bounds_.width(),
526 x_root_bounds_.height());
527 XFreeGC(xdisplay_, gc);
528 }
529 #endif
514 break; 530 break;
515 } 531 }
516 case GenericEvent: 532 case GenericEvent:
517 DispatchXI2Event(event); 533 DispatchXI2Event(event);
518 break; 534 break;
519 case MapNotify: { 535 case MapNotify: {
520 // If there's no window manager running, we need to assign the X input 536 // If there's no window manager running, we need to assign the X input
521 // focus to our host window. 537 // focus to our host window.
522 if (!IsWindowManagerPresent() && focus_when_shown_) 538 if (!IsWindowManagerPresent() && focus_when_shown_)
523 XSetInputFocus(xdisplay_, xwindow_, RevertToNone, CurrentTime); 539 XSetInputFocus(xdisplay_, xwindow_, RevertToNone, CurrentTime);
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 ui::ViewProp::GetValue(accelerated_widget, kRootWindowHostLinuxKey)); 1035 ui::ViewProp::GetValue(accelerated_widget, kRootWindowHostLinuxKey));
1020 } 1036 }
1021 1037
1022 // static 1038 // static
1023 gfx::Size RootWindowHost::GetNativeScreenSize() { 1039 gfx::Size RootWindowHost::GetNativeScreenSize() {
1024 ::Display* xdisplay = base::MessagePumpAuraX11::GetDefaultXDisplay(); 1040 ::Display* xdisplay = base::MessagePumpAuraX11::GetDefaultXDisplay();
1025 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); 1041 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0));
1026 } 1042 }
1027 1043
1028 } // namespace aura 1044 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698