[mutter/bilelmoussaoui/drop-zenity] Core: Drop the default close dialog implementation




commit c27d63bccf94b653ea683ee514dbe16c51d30c91
Author: Bilal Elmoussaoui <belmouss redhat com>
Date:   Tue Apr 12 14:24:15 2022 +0200

    Core: Drop the default close dialog implementation
    
    If the MetaPlugin doesn't implement it, we don't show anything.

 src/compositor/meta-plugin-manager.c         |   2 +-
 src/core/delete.c                            |   2 +
 src/core/meta-close-dialog-default-private.h |  37 ----
 src/core/meta-close-dialog-default.c         | 280 ---------------------------
 src/meson.build                              |   2 -
 src/meta/meta-plugin.h                       |   2 +
 6 files changed, 5 insertions(+), 320 deletions(-)
---
diff --git a/src/compositor/meta-plugin-manager.c b/src/compositor/meta-plugin-manager.c
index 94d62c2126..72b8b466db 100644
--- a/src/compositor/meta-plugin-manager.c
+++ b/src/compositor/meta-plugin-manager.c
@@ -396,7 +396,7 @@ meta_plugin_manager_create_close_dialog (MetaPluginManager *plugin_mgr,
   if (klass->create_close_dialog)
     return klass->create_close_dialog (plugin, window);
 
-  return meta_close_dialog_default_new (window);
+  return NULL;
 }
 
 MetaInhibitShortcutsDialog *
diff --git a/src/core/delete.c b/src/core/delete.c
index 81537dfe55..ceaa8d6eec 100644
--- a/src/core/delete.c
+++ b/src/core/delete.c
@@ -56,6 +56,8 @@ meta_window_ensure_close_dialog (MetaWindow *window)
   display = window->display;
   window->close_dialog = meta_compositor_create_close_dialog (display->compositor,
                                                               window);
+  if (!window->close_dialog)
+    return;
   g_signal_connect (window->close_dialog, "response",
                     G_CALLBACK (close_dialog_response_cb), window);
 }
diff --git a/src/meson.build b/src/meson.build
index 7b456f524f..45b427e47a 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -382,8 +382,6 @@ mutter_sources = [
   'core/meta-clipboard-manager.c',
   'core/meta-clipboard-manager.h',
   'core/meta-close-dialog.c',
-  'core/meta-close-dialog-default.c',
-  'core/meta-close-dialog-default-private.h',
   'core/meta-context-main.c',
   'core/meta-context-main.h',
   'core/meta-context-private.h',
diff --git a/src/meta/meta-plugin.h b/src/meta/meta-plugin.h
index 663a75fa9d..127d8709fb 100644
--- a/src/meta/meta-plugin.h
+++ b/src/meta/meta-plugin.h
@@ -223,6 +223,8 @@ struct _MetaPluginClass
    *
    * Virtual function called to create a "force quit" dialog
    * on non-responsive clients.
+   * 
+   * If not implemnted or it returns a NULL, no dialog will be displayed.
    */
   MetaCloseDialog * (* create_close_dialog) (MetaPlugin *plugin,
                                              MetaWindow *window);


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