[mutter] stage/x11: Terminate using MetaContext instead of meta_quit()



commit 4be9bc9db4b03941028162a0ee166a13e6dbd035
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Wed Mar 3 15:59:03 2021 +0100

    stage/x11: Terminate using MetaContext instead of meta_quit()
    
    Done for the nested backend when clicking the close button.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861>

 src/backends/x11/meta-stage-x11.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/backends/x11/meta-stage-x11.c b/src/backends/x11/meta-stage-x11.c
index ef6fd0320a..4111c86762 100644
--- a/src/backends/x11/meta-stage-x11.c
+++ b/src/backends/x11/meta-stage-x11.c
@@ -39,7 +39,7 @@
 #include "cogl/cogl-mutter.h"
 #include "cogl/cogl.h"
 #include "core/display-private.h"
-#include "meta/main.h"
+#include "meta/meta-context.h"
 #include "meta/meta-x11-errors.h"
 
 #define STAGE_X11_IS_MAPPED(s)  ((((MetaStageX11 *) (s))->wm_state & STAGE_X11_WITHDRAWN) == 0)
@@ -618,12 +618,14 @@ meta_stage_x11_translate_event (MetaStageX11 *stage_x11,
   gboolean res = FALSE;
   ClutterBackendX11 *clutter_backend_x11;
   ClutterStage *stage;
+  MetaBackend *backend;
 
   stage_cogl = meta_x11_get_stage_window_from_window (xevent->xany.window);
   if (stage_cogl == NULL)
     return FALSE;
 
   stage = stage_cogl->wrapper;
+  backend = stage_x11->backend;
   clutter_backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend);
 
   switch (xevent->type)
@@ -723,7 +725,6 @@ meta_stage_x11_translate_event (MetaStageX11 *stage_x11,
                */
               if (META_IS_BACKEND_X11_CM (stage_x11->backend))
                 {
-                  MetaBackend *backend = stage_x11->backend;
                   MetaRenderer *renderer = meta_backend_get_renderer (backend);
                   MetaRendererX11Cm *renderer_x11_cm =
                     META_RENDERER_X11_CM (renderer);
@@ -771,7 +772,7 @@ meta_stage_x11_translate_event (MetaStageX11 *stage_x11,
 
       g_return_val_if_fail (META_IS_STAGE_X11_NESTED (stage_x11),
                             FALSE);
-      meta_quit (META_EXIT_SUCCESS);
+      meta_context_terminate (meta_backend_get_context (backend));
       res = FALSE;
       break;
 
@@ -787,7 +788,7 @@ meta_stage_x11_translate_event (MetaStageX11 *stage_x11,
             {
               g_return_val_if_fail (META_IS_STAGE_X11_NESTED (stage_x11),
                                     FALSE);
-              meta_quit (META_EXIT_SUCCESS);
+              meta_context_terminate (meta_backend_get_context (backend));
               res = FALSE;
             }
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]