0af108211c
This patch fixes the "apps vanish from alt-TAB bug". If a "package system" rips away and possibly replaces .desktop files at some random time, we have historically used inotify to detect this and reread state (in a racy way, but...). In GNOME 2, this was generally not too problematic because the menu widget was totally separate from the list of windows - and the data they operate on was disjoint as well. In GNOME 3 we unify these, and this creates architectural problems because the windows are tied to the app. What this patch tries to do is, when rereading the application state, if we have a running application, we keep that app around instead of making a new instance. This ensures we preserve any state such as the set of open windows. This requires moving the running state into ShellAppSystem. Adjust callers as necessary, and while we're at it drop the unused "contexts" stuff. This is just a somewhat quick band-aid; a REAL fix would require us having low-level control over application installation. As long as we're on top of random broken tar+wget wrappers, it will be gross. A slight future improvement to this patch would add an explicit "merge" between the old and new data. I think probably we always keep around the ShellApp corresponding to a given ID, but replace its GMenuTreeEntry. https://bugzilla.gnome.org/show_bug.cgi?id=657990
58 lines
2.4 KiB
C
58 lines
2.4 KiB
C
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
#ifndef __SHELL_WINDOW_TRACKER_H__
|
|
#define __SHELL_WINDOW_TRACKER_H__
|
|
|
|
#include <glib-object.h>
|
|
#include <glib.h>
|
|
#include <meta/window.h>
|
|
|
|
#include "shell-app.h"
|
|
#include "shell-app-system.h"
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
typedef struct _ShellWindowTracker ShellWindowTracker;
|
|
typedef struct _ShellWindowTrackerClass ShellWindowTrackerClass;
|
|
typedef struct _ShellWindowTrackerPrivate ShellWindowTrackerPrivate;
|
|
|
|
#define SHELL_TYPE_WINDOW_TRACKER (shell_window_tracker_get_type ())
|
|
#define SHELL_WINDOW_TRACKER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SHELL_TYPE_WINDOW_TRACKER, ShellWindowTracker))
|
|
#define SHELL_WINDOW_TRACKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_WINDOW_TRACKER, ShellWindowTrackerClass))
|
|
#define SHELL_IS_WINDOW_TRACKER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), SHELL_TYPE_WINDOW_TRACKER))
|
|
#define SHELL_IS_WINDOW_TRACKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_WINDOW_TRACKER))
|
|
#define SHELL_WINDOW_TRACKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_WINDOW_TRACKER, ShellWindowTrackerClass))
|
|
|
|
struct _ShellWindowTrackerClass
|
|
{
|
|
GObjectClass parent_class;
|
|
};
|
|
|
|
GType shell_window_tracker_get_type (void) G_GNUC_CONST;
|
|
|
|
ShellWindowTracker* shell_window_tracker_get_default(void);
|
|
|
|
ShellApp *shell_window_tracker_get_window_app (ShellWindowTracker *tracker, MetaWindow *metawin);
|
|
|
|
ShellApp *shell_window_tracker_get_app_from_pid (ShellWindowTracker *tracker, int pid);
|
|
|
|
gboolean shell_window_tracker_is_window_interesting (MetaWindow *window);
|
|
|
|
const char *_shell_window_tracker_get_app_context (ShellWindowTracker *tracker, ShellApp *app);
|
|
|
|
GSList *shell_window_tracker_get_startup_sequences (ShellWindowTracker *tracker);
|
|
|
|
/* Hidden typedef for SnStartupSequence */
|
|
typedef struct _ShellStartupSequence ShellStartupSequence;
|
|
#define SHELL_TYPE_STARTUP_SEQUENCE (shell_startup_sequence_get_type ())
|
|
GType shell_startup_sequence_get_type (void);
|
|
|
|
const char *shell_startup_sequence_get_id (ShellStartupSequence *sequence);
|
|
ShellApp *shell_startup_sequence_get_app (ShellStartupSequence *sequence);
|
|
const char *shell_startup_sequence_get_name (ShellStartupSequence *sequence);
|
|
gboolean shell_startup_sequence_get_completed (ShellStartupSequence *sequence);
|
|
ClutterActor *shell_startup_sequence_create_icon (ShellStartupSequence *sequence, guint size);
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __SHELL_WINDOW_TRACKER_H__ */
|