static gboolean on_close_button_clicked(GtkWidget* widget, GdkEvent* event, gpointer data) { meta_verbose("%s\n", __func__); DeepinWorkspaceOverview* self = (DeepinWorkspaceOverview*)data; DeepinWorkspaceOverviewPrivate* priv = self->priv; if (!priv->ready) return FALSE; MetaWindow* meta_window = meta_deepin_cloned_widget_get_window(priv->hovered_clone); for (int i = 0; i < priv->monitors->len; i++) { MonitorData* md = (MonitorData*)g_ptr_array_index(priv->monitors, i); if (!md->clones) continue; for (gint i = 0; i < md->clones->len; i++) { MetaDeepinClonedWidget* clone = g_ptr_array_index(md->clones, i); if (clone == priv->hovered_clone) { g_ptr_array_remove(md->clones, clone); gtk_container_remove(GTK_CONTAINER(self), clone); meta_window_delete(meta_window, CurrentTime); priv->hovered_clone = NULL; _hide_close_button(self); g_idle_add((GSourceFunc)on_idle, self); return TRUE; } } } return TRUE; }
void meta_core_delete (Display *xdisplay, Window frame_xwindow, guint32 timestamp) { MetaWindow *window = get_window (xdisplay, frame_xwindow); meta_window_delete (window, timestamp); }
/** * cinnamon_app_request_quit: * @app: A #CinnamonApp * * Initiate an asynchronous request to quit this application. * The application may interact with the user, and the user * might cancel the quit request from the application UI. * * This operation may not be supported for all applications. * * Returns: %TRUE if a quit request is supported for this application */ gboolean cinnamon_app_request_quit (CinnamonApp *app) { GSList *iter; if (cinnamon_app_get_state (app) != CINNAMON_APP_STATE_RUNNING) return FALSE; /* TODO - check for an XSMP connection; we could probably use that */ for (iter = app->running_state->windows; iter; iter = iter->next) { MetaWindow *win = iter->data; if (!cinnamon_window_tracker_is_window_interesting (win)) continue; meta_window_delete (win, cinnamon_global_get_current_time (cinnamon_global_get ())); } return TRUE; }