[mutter/bilelmoussaoui/drop-zenity: 1/3] core: Drop the default close dialog implementation




commit 5884b0a872a68606739d7dc0ef7fe0282cc4e430
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.

 po/POTFILES.in                               |   1 -
 src/compositor/meta-plugin-manager.c         |   3 +-
 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 +
 7 files changed, 5 insertions(+), 322 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index f51e98dd0a..2df2675d88 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -17,7 +17,6 @@ src/compositor/meta-background.c
 src/core/bell.c
 src/core/display.c
 src/core/keybindings.c
-src/core/meta-close-dialog-default.c
 src/core/meta-context-main.c
 src/core/meta-pad-action-mapper.c
 src/core/mutter.c
diff --git a/src/compositor/meta-plugin-manager.c b/src/compositor/meta-plugin-manager.c
index 94d62c2126..bec5cd4559 100644
--- a/src/compositor/meta-plugin-manager.c
+++ b/src/compositor/meta-plugin-manager.c
@@ -29,7 +29,6 @@
 #include "backends/x11/meta-clutter-backend-x11.h"
 #include "compositor/compositor-private.h"
 #include "compositor/meta-module.h"
-#include "core/meta-close-dialog-default-private.h"
 #include "core/meta-inhibit-shortcuts-dialog-default-private.h"
 #include "core/window-private.h"
 #include "meta/meta-x11-errors.h"
@@ -396,7 +395,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..b3e05b809c 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 implemented 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]