Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Fri, 23 Mar 2018 10:56:14 +0000 (11:56 +0100)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 23 Mar 2018 10:56:14 +0000 (11:56 +0100)
1  2 
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_window.c
source/blender/windowmanager/wm.h
source/blender/windowmanager/wm_window.h

Simple merge
index a173281b7d05439b0ed0682cd6ae0192f2df9d23,408229e501ceec79d02d5999c4ea6895d8809e8b..4c3a89f76fa168841ee0f52a282d6bea22010cc9
@@@ -468,29 -457,13 +495,14 @@@ void wm_window_close(bContext *C, wmWin
                        break;
        }
  
-       if (tmpwin == NULL)
-               do_exit = 1;
-       if ((U.uiflag & USER_QUIT_PROMPT) && !wm->file_saved && !G.background && do_exit) {
-               /* We have unsaved changes and we're quitting */
-               if(GHOST_SupportsNativeDialogs() == 0) {
-                       wm_confirm_quit(C);
-               }
-               else {
-                       if (!GHOST_confirmQuit(win->ghostwin))
-                               return;
-               }
-       }
-       else if (do_exit) {
-               /* No changes but we're quitting */
-               /* let WM_exit do all freeing, for correct quit.blend save */
-               WM_exit(C);
+       if (tmpwin == NULL) {
+               wm_quit_with_optional_confirmation_prompt(C, win);
        }
        else {
 -              /* We're just closing a window */
 -              bScreen *screen = win->screen;
 -              
 +              bScreen *screen = WM_window_get_active_screen(win);
 +              WorkSpace *workspace = WM_window_get_active_workspace(win);
 +              WorkSpaceLayout *layout = BKE_workspace_active_layout_get(win->workspace_hook);
 +
                BLI_remlink(&wm->windows, win);
                
                wm_draw_window_clear(win);
Simple merge
index 75595eb8817342f02c832c4b646318dcb945bce9,5209af87960bebc82a96d74b36ca8b5badd224ce..b0c7021c4960459af40ef5c9c20d4be6c2155414
@@@ -81,14 -76,10 +81,14 @@@ void               wm_window_IME_end       (wmWindow *win)
  
  /* *************** window operators ************** */
  int                   wm_window_close_exec(bContext *C, struct wmOperator *op);
 -int                   wm_window_duplicate_exec(bContext *C, struct wmOperator *op);
  int                   wm_window_fullscreen_toggle_exec(bContext *C, struct wmOperator *op);
- void          wm_confirm_quit(bContext *C);
+ void          wm_quit_with_optional_confirmation_prompt(bContext *C, wmWindow *win) ATTR_NONNULL();
  
 +const struct EnumPropertyItem *wm_window_new_screen_itemf(
 +        bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free);
 +int                   wm_window_new_exec(bContext *C, struct wmOperator *op);
 +int                   wm_window_new_invoke(bContext *C, struct wmOperator *op, const struct wmEvent *event);
 +
  /* Initial (unmaximized) size to start with for
   * systems that can't find it for themselves (X11).
   * Clamped by real desktop limits */