~skypce/indicator-session/indicator-session

« back to all changes in this revision

Viewing changes to src/user-menu-mgr.c

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2012-03-06 16:06:57 UTC
  • Revision ID: package-import@ubuntu.com-20120306160657-wenbva5fs20lhhxs
Tags: 0.3.92-0ubuntu2
* Backport r243 and r244, should fix the restart required status update
  once aptdaemon is fixed to correctly emit signals (lp: #942104)
* debian/patches/restore_session_lock.patch, debian/rules:
  - replace by a backport of the official commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
285
285
        return TRUE;
286
286
}
287
287
 
 
288
/* Check to see if the lockdown key is protecting from
 
289
   locking the screen.  If not, lock it. */
 
290
static void
 
291
lock_if_possible (void) {
 
292
        ensure_settings_client ();
 
293
 
 
294
        if (!g_settings_get_boolean (settings, LOCKDOWN_KEY_SCREENSAVER)) {
 
295
                lock_screen(NULL, 0, NULL);
 
296
        }
 
297
 
 
298
        return;
 
299
}
 
300
 
 
301
 
288
302
/* Starts a new generic session */
289
303
static void
290
304
activate_new_session (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data)
291
305
{
292
 
        users_service_dbus_show_greeter (USERS_SERVICE_DBUS(user_data));
 
306
        lock_if_possible();
 
307
 
 
308
  users_service_dbus_show_greeter (USERS_SERVICE_DBUS(user_data));
 
309
 
 
310
        return;
293
311
}
294
312
 
295
313
/* Activates a session for a particular user. */
299
317
  UserData *user = (UserData *)user_data;
300
318
  UsersServiceDbus *service = user->service;
301
319
 
 
320
  lock_if_possible();
 
321
 
302
322
  users_service_dbus_activate_user_session (service, user);
303
323
}
304
324
 
386
406
  UserMenuMgr* user_mgr = USER_MENU_MGR(user_data);  
387
407
  UsersServiceDbus *service = user_mgr->users_dbus_interface;
388
408
 
389
 
  users_service_dbus_activate_guest_session(service);
 
409
        lock_if_possible();
 
410
  
 
411
  if (users_service_dbus_activate_guest_session(service)) {
 
412
    return;
 
413
  }
390
414
}
391
415
 
392
416