2014-05-29 19:15:34 +02:00
|
|
|
Index: desktop_aura/desktop_screen_win.cc
|
|
|
|
===================================================================
|
|
|
|
--- desktop_aura/desktop_screen_win.cc (revision 272007)
|
|
|
|
+++ desktop_aura/desktop_screen_win.cc (working copy)
|
|
|
|
@@ -54,6 +54,8 @@
|
2013-12-07 02:55:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
HWND DesktopScreenWin::GetHWNDFromNativeView(gfx::NativeView window) const {
|
|
|
|
+ if (!window)
|
|
|
|
+ return NULL;
|
2014-04-04 18:50:38 +02:00
|
|
|
aura::WindowTreeHost* host = window->GetHost();
|
|
|
|
return host ? host->GetAcceleratedWidget() : NULL;
|
2013-12-07 02:55:22 +01:00
|
|
|
}
|
2014-05-29 19:15:34 +02:00
|
|
|
Index: desktop_aura/desktop_window_tree_host_win.cc
|
|
|
|
===================================================================
|
|
|
|
--- desktop_aura/desktop_window_tree_host_win.cc (revision 272007)
|
|
|
|
+++ desktop_aura/desktop_window_tree_host_win.cc (working copy)
|
|
|
|
@@ -129,7 +129,9 @@
|
2014-02-19 17:27:54 +01:00
|
|
|
native_widget_delegate_);
|
|
|
|
|
|
|
|
HWND parent_hwnd = NULL;
|
2014-04-04 18:50:38 +02:00
|
|
|
- if (params.parent && params.parent->GetHost())
|
|
|
|
+ if (params.parent_widget)
|
2014-02-19 17:27:54 +01:00
|
|
|
+ parent_hwnd = params.parent_widget;
|
2014-04-04 18:50:38 +02:00
|
|
|
+ else if (params.parent && params.parent->GetHost())
|
|
|
|
parent_hwnd = params.parent->GetHost()->GetAcceleratedWidget();
|
|
|
|
|
|
|
|
message_handler_->set_remove_standard_frame(params.remove_standard_frame);
|
2014-05-29 19:15:34 +02:00
|
|
|
Index: desktop_aura/desktop_window_tree_host_x11.cc
|
|
|
|
===================================================================
|
|
|
|
--- desktop_aura/desktop_window_tree_host_x11.cc (revision 272007)
|
|
|
|
+++ desktop_aura/desktop_window_tree_host_x11.cc (working copy)
|
|
|
|
@@ -143,7 +143,8 @@
|
2014-05-22 23:01:22 +02:00
|
|
|
window_parent_(NULL),
|
2014-05-29 19:15:34 +02:00
|
|
|
window_shape_(NULL),
|
|
|
|
custom_window_shape_(false),
|
2014-05-22 23:01:22 +02:00
|
|
|
- urgency_hint_set_(false) {
|
|
|
|
+ urgency_hint_set_(false),
|
|
|
|
+ xwindow_destroyed_(false) {
|
|
|
|
}
|
|
|
|
|
|
|
|
DesktopWindowTreeHostX11::~DesktopWindowTreeHostX11() {
|
2014-05-29 19:15:34 +02:00
|
|
|
@@ -332,7 +333,8 @@
|
2014-05-22 23:01:22 +02:00
|
|
|
// Actually free our native resources.
|
|
|
|
if (ui::PlatformEventSource::GetInstance())
|
|
|
|
ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
|
|
|
|
- XDestroyWindow(xdisplay_, xwindow_);
|
|
|
|
+ if (!xwindow_destroyed_)
|
|
|
|
+ XDestroyWindow(xdisplay_, xwindow_);
|
|
|
|
xwindow_ = None;
|
|
|
|
|
|
|
|
desktop_native_widget_aura_->OnHostClosed();
|
2014-05-29 19:15:34 +02:00
|
|
|
@@ -998,9 +1000,13 @@
|
|
|
|
}
|
|
|
|
}
|
2014-05-22 23:01:22 +02:00
|
|
|
|
|
|
|
+ gfx::AcceleratedWidget parent_widget = params.parent_widget;
|
|
|
|
+ if (parent_widget == gfx::kNullAcceleratedWidget)
|
|
|
|
+ parent_widget = x_root_window_;
|
|
|
|
+
|
|
|
|
bounds_ = params.bounds;
|
|
|
|
xwindow_ = XCreateWindow(
|
|
|
|
- xdisplay_, x_root_window_,
|
|
|
|
+ xdisplay_, parent_widget,
|
|
|
|
bounds_.x(), bounds_.y(),
|
|
|
|
bounds_.width(), bounds_.height(),
|
|
|
|
0, // border width
|
2014-05-29 19:15:34 +02:00
|
|
|
@@ -1503,6 +1509,10 @@
|
2014-05-22 23:01:22 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
+ case DestroyNotify:
|
|
|
|
+ xwindow_destroyed_ = true;
|
|
|
|
+ CloseNow();
|
|
|
|
+ break;
|
|
|
|
case FocusOut:
|
|
|
|
if (xev->xfocus.mode != NotifyGrab) {
|
|
|
|
ReleaseCapture();
|
2014-05-29 19:15:34 +02:00
|
|
|
Index: desktop_aura/desktop_window_tree_host_x11.h
|
|
|
|
===================================================================
|
|
|
|
--- desktop_aura/desktop_window_tree_host_x11.h (revision 272007)
|
|
|
|
+++ desktop_aura/desktop_window_tree_host_x11.h (working copy)
|
|
|
|
@@ -319,6 +319,9 @@
|
2014-05-22 23:01:22 +02:00
|
|
|
// the frame when |xwindow_| gains focus or handles a mouse button event.
|
|
|
|
bool urgency_hint_set_;
|
|
|
|
|
|
|
|
+ // True if the xwindow has already been destroyed.
|
|
|
|
+ bool xwindow_destroyed_;
|
|
|
|
+
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11);
|
|
|
|
};
|
|
|
|
|
2014-05-29 19:15:34 +02:00
|
|
|
Index: widget.cc
|
|
|
|
===================================================================
|
|
|
|
--- widget.cc (revision 272007)
|
|
|
|
+++ widget.cc (working copy)
|
|
|
|
@@ -116,6 +116,7 @@
|
2014-02-07 00:36:29 +01:00
|
|
|
show_state(ui::SHOW_STATE_DEFAULT),
|
|
|
|
double_buffer(false),
|
|
|
|
parent(NULL),
|
2014-05-22 23:01:22 +02:00
|
|
|
+ parent_widget(gfx::kNullAcceleratedWidget),
|
2014-02-07 00:36:29 +01:00
|
|
|
native_widget(NULL),
|
2014-02-19 17:27:54 +01:00
|
|
|
desktop_window_tree_host(NULL),
|
2014-02-07 00:36:29 +01:00
|
|
|
top_level(false),
|
2014-05-29 19:15:34 +02:00
|
|
|
@@ -141,6 +142,7 @@
|
2014-02-06 23:33:18 +01:00
|
|
|
show_state(ui::SHOW_STATE_DEFAULT),
|
|
|
|
double_buffer(false),
|
|
|
|
parent(NULL),
|
2014-05-22 23:01:22 +02:00
|
|
|
+ parent_widget(gfx::kNullAcceleratedWidget),
|
2014-02-06 23:33:18 +01:00
|
|
|
native_widget(NULL),
|
2014-02-19 17:27:54 +01:00
|
|
|
desktop_window_tree_host(NULL),
|
2014-02-06 23:33:18 +01:00
|
|
|
top_level(false),
|
2014-05-29 19:15:34 +02:00
|
|
|
@@ -398,7 +400,12 @@
|
2014-03-12 15:36:18 +01:00
|
|
|
Minimize();
|
|
|
|
} else if (params.delegate) {
|
|
|
|
SetContentsView(params.delegate->GetContentsView());
|
|
|
|
- SetInitialBoundsForFramelessWindow(params.bounds);
|
|
|
|
+ if (params.parent_widget) {
|
|
|
|
+ // Set the bounds directly instead of applying an inset.
|
|
|
|
+ SetBounds(params.bounds);
|
|
|
|
+ } else {
|
|
|
|
+ SetInitialBoundsForFramelessWindow(params.bounds);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
native_widget_initialized_ = true;
|
|
|
|
}
|
2014-05-29 19:15:34 +02:00
|
|
|
Index: widget.h
|
|
|
|
===================================================================
|
|
|
|
--- widget.h (revision 272007)
|
|
|
|
+++ widget.h (working copy)
|
|
|
|
@@ -213,6 +213,7 @@
|
2013-12-07 02:55:22 +01:00
|
|
|
// Should the widget be double buffered? Default is false.
|
|
|
|
bool double_buffer;
|
|
|
|
gfx::NativeView parent;
|
|
|
|
+ gfx::AcceleratedWidget parent_widget;
|
|
|
|
// Specifies the initial bounds of the Widget. Default is empty, which means
|
|
|
|
// the NativeWidget may specify a default size. If the parent is specified,
|
|
|
|
// |bounds| is in the parent's coordinate system. If the parent is not
|