mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
x11/sm: Drop the zenity confirmation dialog
Quoting Ray Strode: we don't expose a way to explicitly save the session in gnome anymore afaik, and I don't think it's going to show on log out because I believe we use the FORCE flag from the log out dialog. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2370>
This commit is contained in:
parent
749b9be98a
commit
4dee531b68
@ -29,6 +29,5 @@ src/wayland/meta-wayland-tablet-pad.c
|
||||
src/x11/meta-x11-display.c
|
||||
src/x11/meta-x11-errors.c
|
||||
src/x11/meta-x11-selection-input-stream.c
|
||||
src/x11/session.c
|
||||
src/x11/window-props.c
|
||||
src/x11/xprops.c
|
||||
|
@ -69,7 +69,6 @@ meta_window_release_saved_state (const MetaWindowSessionInfo *info)
|
||||
|
||||
#include "core/display-private.h"
|
||||
#include "meta/main.h"
|
||||
#include "meta/util.h"
|
||||
#include "meta/workspace.h"
|
||||
|
||||
typedef struct _MetaIceConnection
|
||||
@ -87,7 +86,6 @@ static void save_state (void);
|
||||
static char* load_state (const char *previous_save_file);
|
||||
static void regenerate_save_file (void);
|
||||
static const char* full_save_file (void);
|
||||
static void warn_about_lame_clients_and_finish_interact (gboolean shutdown);
|
||||
static void disconnect (void);
|
||||
|
||||
/* This is called when data is available on an ICE connection. */
|
||||
@ -597,7 +595,9 @@ interact_callback (SmcConn smc_conn, SmPointer client_data)
|
||||
|
||||
current_state = STATE_DONE_WITH_INTERACT;
|
||||
|
||||
warn_about_lame_clients_and_finish_interact (shutdown);
|
||||
SmcInteractDone (session_connection, False /* don't cancel logout */);
|
||||
|
||||
save_yourself_possibly_done (shutdown, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1734,105 +1734,4 @@ full_save_file (void)
|
||||
return full_save_path;
|
||||
}
|
||||
|
||||
static int
|
||||
windows_cmp_by_title (MetaWindow *a,
|
||||
MetaWindow *b)
|
||||
{
|
||||
return g_utf8_collate (a->title, b->title);
|
||||
}
|
||||
|
||||
static void
|
||||
finish_interact (gboolean shutdown)
|
||||
{
|
||||
if (current_state == STATE_DONE_WITH_INTERACT) /* paranoia */
|
||||
{
|
||||
SmcInteractDone (session_connection, False /* don't cancel logout */);
|
||||
|
||||
save_yourself_possibly_done (shutdown, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
dialog_closed (GPid pid, int status, gpointer user_data)
|
||||
{
|
||||
gboolean shutdown = GPOINTER_TO_INT (user_data);
|
||||
|
||||
if (WIFEXITED (status) && WEXITSTATUS (status) == 0) /* pressed "OK" */
|
||||
{
|
||||
finish_interact (shutdown);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
warn_about_lame_clients_and_finish_interact (gboolean shutdown)
|
||||
{
|
||||
GSList *lame = NULL;
|
||||
GSList *windows;
|
||||
GSList *lame_details = NULL;
|
||||
GSList *tmp;
|
||||
GSList *columns = NULL;
|
||||
GPid pid;
|
||||
|
||||
windows = meta_display_list_windows (meta_get_display (), META_LIST_DEFAULT);
|
||||
tmp = windows;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
MetaWindow *window;
|
||||
|
||||
window = tmp->data;
|
||||
|
||||
/* only complain about normal windows, the others
|
||||
* are kind of dumb to worry about
|
||||
*/
|
||||
if (window->sm_client_id == NULL &&
|
||||
window->type == META_WINDOW_NORMAL)
|
||||
lame = g_slist_prepend (lame, window);
|
||||
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
g_slist_free (windows);
|
||||
|
||||
if (lame == NULL)
|
||||
{
|
||||
/* No lame apps. */
|
||||
finish_interact (shutdown);
|
||||
return;
|
||||
}
|
||||
|
||||
columns = g_slist_prepend (columns, (gpointer)"Window");
|
||||
columns = g_slist_prepend (columns, (gpointer)"Class");
|
||||
|
||||
lame = g_slist_sort (lame, (GCompareFunc) windows_cmp_by_title);
|
||||
|
||||
tmp = lame;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
MetaWindow *w = tmp->data;
|
||||
|
||||
lame_details = g_slist_prepend (lame_details,
|
||||
w->res_class ? w->res_class : (gpointer)"");
|
||||
lame_details = g_slist_prepend (lame_details,
|
||||
w->title);
|
||||
|
||||
tmp = tmp->next;
|
||||
}
|
||||
g_slist_free (lame);
|
||||
|
||||
pid = meta_show_dialog("--list",
|
||||
_("These windows do not support “save current setup” "
|
||||
"and will have to be restarted manually next time "
|
||||
"you log in."),
|
||||
"240",
|
||||
meta_get_display()->x11_display->screen_name,
|
||||
NULL, NULL, NULL,
|
||||
None,
|
||||
columns,
|
||||
lame_details);
|
||||
|
||||
g_slist_free (lame_details);
|
||||
|
||||
g_child_watch_add (pid, dialog_closed, GINT_TO_POINTER (shutdown));
|
||||
}
|
||||
|
||||
#endif /* HAVE_SM */
|
||||
|
Loading…
Reference in New Issue
Block a user