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

Unified Diff: ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc

Issue 2838753002: x11: Use opaque window for dnd without composite. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/x/x11_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
index a1118cfeb31a6487a4db94f0ef1e7ced2bd7e617..aae8de194693c39587e11a1d17fe7f617d8027c0 100644
--- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
+++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
@@ -1319,7 +1319,10 @@ void DesktopDragDropClientAuraX11::CreateDragWidget(
const gfx::ImageSkia& image) {
Widget* widget = new Widget;
Widget::InitParams params(Widget::InitParams::TYPE_DRAG);
- params.opacity = Widget::InitParams::TRANSLUCENT_WINDOW;
+ if (ui::IsCompositingManagerPresent())
+ params.opacity = Widget::InitParams::TRANSLUCENT_WINDOW;
+ else
+ params.opacity = Widget::InitParams::OPAQUE_WINDOW;
params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
params.accept_events = false;
@@ -1329,7 +1332,8 @@ void DesktopDragDropClientAuraX11::CreateDragWidget(
widget->set_focus_on_creation(false);
widget->set_frame_type(Widget::FRAME_TYPE_FORCE_NATIVE);
widget->Init(params);
- widget->SetOpacity(kDragWidgetOpacity);
+ if (params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW)
+ widget->SetOpacity(kDragWidgetOpacity);
widget->GetNativeWindow()->SetName("DragWindow");
drag_image_size_ = image.size();
« no previous file with comments | « ui/base/x/x11_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698