Skip to content

Commit

Permalink
Session type removed from Cinnamon C code
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertJP committed Jul 23, 2012
1 parent 93dadee commit 0d5e63c
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 88 deletions.
14 changes: 0 additions & 14 deletions src/cinnamon-enum-types.c
Expand Up @@ -54,20 +54,6 @@ cinnamon_cursor_get_type(void) {
} }
return enum_type_id; return enum_type_id;
} }
GType
cinnamon_session_type_get_type(void) {
static GType enum_type_id = 0;
if (G_UNLIKELY (!enum_type_id))
{
static const GEnumValue values[] = {
{ CINNAMON_SESSION_USER, "CINNAMON_SESSION_USER", "user" },
{ CINNAMON_SESSION_GDM, "CINNAMON_SESSION_GDM", "gdm" },
{ 0, NULL, NULL }
};
enum_type_id = g_enum_register_static("CinnamonSessionType", values);
}
return enum_type_id;
}
/* enumerations from "./cinnamon-mobile-providers.h" */ /* enumerations from "./cinnamon-mobile-providers.h" */
#include "./cinnamon-mobile-providers.h" #include "./cinnamon-mobile-providers.h"
GType GType
Expand Down
3 changes: 0 additions & 3 deletions src/cinnamon-enum-types.h
Expand Up @@ -19,9 +19,6 @@ GType cinnamon_stage_input_mode_get_type (void) G_GNUC_CONST;
GType cinnamon_cursor_get_type (void) G_GNUC_CONST; GType cinnamon_cursor_get_type (void) G_GNUC_CONST;
#define CINNAMON_TYPE_CURSOR (cinnamon_cursor_get_type()) #define CINNAMON_TYPE_CURSOR (cinnamon_cursor_get_type())


GType cinnamon_session_type_get_type (void) G_GNUC_CONST;
#define CINNAMON_TYPE_SESSION_TYPE (cinnamon_session_type_get_type())

/* enumerations from "./cinnamon-mobile-providers.h" */ /* enumerations from "./cinnamon-mobile-providers.h" */
GType cinnamon_mobile_access_method_type_get_type (void) G_GNUC_CONST; GType cinnamon_mobile_access_method_type_get_type (void) G_GNUC_CONST;
#define CINNAMON_TYPE_MOBILE_ACCESS_METHOD_TYPE (cinnamon_mobile_access_method_type_get_type()) #define CINNAMON_TYPE_MOBILE_ACCESS_METHOD_TYPE (cinnamon_mobile_access_method_type_get_type())
Expand Down
3 changes: 0 additions & 3 deletions src/cinnamon-global-private.h
Expand Up @@ -16,9 +16,6 @@ GjsContext *_cinnamon_global_get_gjs_context (CinnamonGlobal *global);
gboolean _cinnamon_global_check_xdnd_event (CinnamonGlobal *global, gboolean _cinnamon_global_check_xdnd_event (CinnamonGlobal *global,
XEvent *xev); XEvent *xev);


void _cinnamon_global_set_session_type (CinnamonGlobal *global,
CinnamonSessionType session_type);

/* Used for async screenshot grabbing */ /* Used for async screenshot grabbing */
typedef struct _screenshot_data { typedef struct _screenshot_data {
CinnamonGlobal *global; CinnamonGlobal *global;
Expand Down
46 changes: 0 additions & 46 deletions src/cinnamon-global.c
Expand Up @@ -59,8 +59,6 @@ struct _CinnamonGlobal {
MetaScreen *meta_screen; MetaScreen *meta_screen;
GdkScreen *gdk_screen; GdkScreen *gdk_screen;


CinnamonSessionType session_type;

/* We use this window to get a notification from GTK+ when /* We use this window to get a notification from GTK+ when
* a widget in our process does a GTK+ grab. See * a widget in our process does a GTK+ grab. See
* http://bugzilla.gnome.org/show_bug.cgi?id=570641 * http://bugzilla.gnome.org/show_bug.cgi?id=570641
Expand Down Expand Up @@ -97,7 +95,6 @@ struct _CinnamonGlobal {
enum { enum {
PROP_0, PROP_0,


PROP_SESSION_TYPE,
PROP_OVERLAY_GROUP, PROP_OVERLAY_GROUP,
PROP_SCREEN, PROP_SCREEN,
PROP_GDK_SCREEN, PROP_GDK_SCREEN,
Expand Down Expand Up @@ -144,9 +141,6 @@ cinnamon_global_set_property(GObject *object,
case PROP_STAGE_INPUT_MODE: case PROP_STAGE_INPUT_MODE:
cinnamon_global_set_stage_input_mode (global, g_value_get_enum (value)); cinnamon_global_set_stage_input_mode (global, g_value_get_enum (value));
break; break;
case PROP_SESSION_TYPE:
global->session_type = g_value_get_enum (value);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;
Expand All @@ -163,9 +157,6 @@ cinnamon_global_get_property(GObject *object,


switch (prop_id) switch (prop_id)
{ {
case PROP_SESSION_TYPE:
g_value_set_enum (value, cinnamon_global_get_session_type (global));
break;
case PROP_OVERLAY_GROUP: case PROP_OVERLAY_GROUP:
g_value_set_object (value, meta_get_overlay_group_for_screen (global->meta_screen)); g_value_set_object (value, meta_get_overlay_group_for_screen (global->meta_screen));
break; break;
Expand Down Expand Up @@ -350,14 +341,6 @@ cinnamon_global_class_init (CinnamonGlobalClass *klass)
G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_STRING); G_TYPE_STRING);


g_object_class_install_property (gobject_class,
PROP_SESSION_TYPE,
g_param_spec_enum ("session-type",
"Session Type",
"The type of session",
CINNAMON_TYPE_SESSION_TYPE,
CINNAMON_SESSION_USER,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_OVERLAY_GROUP, PROP_OVERLAY_GROUP,
g_param_spec_object ("overlay-group", g_param_spec_object ("overlay-group",
Expand Down Expand Up @@ -2199,32 +2182,3 @@ cinnamon_global_screenshot_window (CinnamonGlobal *global,


return status == CAIRO_STATUS_SUCCESS; return status == CAIRO_STATUS_SUCCESS;
} }

/**
* cinnamon_global_get_session_type:
* @global: The #CinnamonGlobal.
*
* Gets the type of session cinnamon provides.
*
* The type determines what UI elements are displayed,
* what keybindings work, and generally how Cinnamon
* behaves.
*
* A session type of #CINNAMON_SESSION_USER means cinnamon
* will enable the activities overview, status menu, run dialog,
* etc. This is the default.
*
* A session type of #CINNAMON_SESSION_GDM means cinnamon
* will enable a login dialog and run in a more confined
* way. This type is suitable for the display manager.
*
* Returns the type of session cinnamon is providing.
*/
CinnamonSessionType
cinnamon_global_get_session_type (CinnamonGlobal *global)
{
g_return_val_if_fail (CINNAMON_IS_GLOBAL (global),
CINNAMON_SESSION_USER);

return global->session_type;
}
7 changes: 0 additions & 7 deletions src/cinnamon-global.h
Expand Up @@ -163,13 +163,6 @@ gboolean cinnamon_global_screenshot_window (CinnamonGlobal *global,
void cinnamon_global_screenshot (CinnamonGlobal *global, void cinnamon_global_screenshot (CinnamonGlobal *global,
const char *filename, const char *filename,
CinnamonGlobalScreenshotCallback callback); CinnamonGlobalScreenshotCallback callback);
typedef enum {
CINNAMON_SESSION_USER,
CINNAMON_SESSION_GDM
} CinnamonSessionType;

CinnamonSessionType cinnamon_global_get_session_type (CinnamonGlobal *global);

G_END_DECLS G_END_DECLS


#endif /* __CINNAMON_GLOBAL_H__ */ #endif /* __CINNAMON_GLOBAL_H__ */
16 changes: 1 addition & 15 deletions src/main.c
Expand Up @@ -35,8 +35,6 @@ extern GType gnome_cinnamon_plugin_get_type (void);


#define OVERRIDES_SCHEMA "org.cinnamon.overrides" #define OVERRIDES_SCHEMA "org.cinnamon.overrides"


static gboolean is_gdm_mode = FALSE;

static void static void
cinnamon_dbus_init (gboolean replace) cinnamon_dbus_init (gboolean replace)
{ {
Expand Down Expand Up @@ -237,12 +235,6 @@ GOptionEntry gnome_cinnamon_options[] = {
N_("Print version"), N_("Print version"),
NULL NULL
}, },
{
"gdm-mode", 0, 0, G_OPTION_ARG_NONE,
&is_gdm_mode,
N_("Mode used by GDM for login screen"),
NULL
},
{ NULL } { NULL }
}; };


Expand All @@ -266,7 +258,6 @@ main (int argc, char **argv)
{ {
GOptionContext *ctx; GOptionContext *ctx;
GError *error = NULL; GError *error = NULL;
CinnamonSessionType session_type;
int ecode; int ecode;
TpDebugSender *sender; TpDebugSender *sender;


Expand Down Expand Up @@ -332,12 +323,7 @@ main (int argc, char **argv)
g_log_set_default_handler (default_log_handler, sender); g_log_set_default_handler (default_log_handler, sender);


/* Initialize the global object */ /* Initialize the global object */
if (is_gdm_mode) _cinnamon_global_init (NULL);
session_type = CINNAMON_SESSION_GDM;
else
session_type = CINNAMON_SESSION_USER;

_cinnamon_global_init ("session-type", session_type, NULL);


ecode = meta_run (); ecode = meta_run ();


Expand Down

0 comments on commit 0d5e63c

Please sign in to comment.