linux: Make modal dialog show more smoothly
authorCheng Zhao <zcbenz@gmail.com>
Sun, 19 Jun 2016 08:49:31 +0000 (17:49 +0900)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 20 Jun 2016 02:16:41 +0000 (11:16 +0900)
atom/browser/native_window_views.cc

index 5cb005a..0dcef46 100644 (file)
@@ -837,9 +837,10 @@ void NativeWindowViews::SetParentWindow(NativeWindow* parent) {
 
 void NativeWindowViews::SetModal(bool modal) {
 #if defined(USE_X11)
+  SetWindowType(GetAcceleratedWidget(), modal ? "dialog" : "normal");
+  Show();
   SetWMSpecState(GetAcceleratedWidget(), modal,
                  GetAtom("_NET_WM_STATE_MODAL"));
-  SetWindowType(GetAcceleratedWidget(), modal ? "dialog" : "normal");
 #endif
 }