macOS: Use sheet window as modal window

This commit is contained in:
Cheng Zhao 2016-06-20 14:49:24 +09:00
parent 1866dbe608
commit e33e4be257
8 changed files with 81 additions and 112 deletions

View file

@ -806,6 +806,8 @@ void NativeWindowViews::SetMenu(ui::MenuModel* menu_model) {
}
void NativeWindowViews::SetParentWindow(NativeWindow* parent) {
NativeWindow::SetParentWindow(parent);
#if defined(USE_X11)
XDisplay* xdisplay = gfx::GetXDisplay();
XSetTransientForHint(
@ -830,6 +832,7 @@ void NativeWindowViews::SetParentWindow(NativeWindow* parent) {
}
void NativeWindowViews::SetModal(bool modal) {
NativeWindow::SetModal(modal);
#if defined(USE_X11)
SetWindowType(GetAcceleratedWidget(), modal ? "dialog" : "normal");
Show();