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

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: 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 // TODO(oshima): Clear the root when the window is moved or
515 // resized while the extended desktop is disabled.
516 // crbug.com/152003.
517 if (base::chromeos::IsRunningOnChromeOS()) {
518 XSetWindowBackground(xdisplay_,
519 x_root_window_,
520 BlackPixel(xdisplay_, DefaultScreen(xdisplay_)));
521 XClearWindow(xdisplay_, x_root_window_);
522 // Set the background back to None to preserve content.
523 XSetWindowBackgroundPixmap(xdisplay_, x_root_window_, None);
Daniel Erat 2012/09/25 19:10:57 it's not obvious to me why this is necessary. can
oshima 2012/09/25 19:33:28 According to @marcheu, we intentionally set backgr
Daniel Erat 2012/09/25 19:54:41 Got it, thanks. Wonder if it'd be cleaner to just
oshima 2012/09/25 20:45:09 Done.
524 }
514 break; 525 break;
515 } 526 }
516 case GenericEvent: 527 case GenericEvent:
517 DispatchXI2Event(event); 528 DispatchXI2Event(event);
518 break; 529 break;
519 case MapNotify: { 530 case MapNotify: {
520 // If there's no window manager running, we need to assign the X input 531 // If there's no window manager running, we need to assign the X input
521 // focus to our host window. 532 // focus to our host window.
522 if (!IsWindowManagerPresent() && focus_when_shown_) 533 if (!IsWindowManagerPresent() && focus_when_shown_)
523 XSetInputFocus(xdisplay_, xwindow_, RevertToNone, CurrentTime); 534 XSetInputFocus(xdisplay_, xwindow_, RevertToNone, CurrentTime);
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 ui::ViewProp::GetValue(accelerated_widget, kRootWindowHostLinuxKey)); 1030 ui::ViewProp::GetValue(accelerated_widget, kRootWindowHostLinuxKey));
1020 } 1031 }
1021 1032
1022 // static 1033 // static
1023 gfx::Size RootWindowHost::GetNativeScreenSize() { 1034 gfx::Size RootWindowHost::GetNativeScreenSize() {
1024 ::Display* xdisplay = base::MessagePumpAuraX11::GetDefaultXDisplay(); 1035 ::Display* xdisplay = base::MessagePumpAuraX11::GetDefaultXDisplay();
1025 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); 1036 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0));
1026 } 1037 }
1027 1038
1028 } // namespace aura 1039 } // 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