~robert-ancell/lightdm/enable-tests

« back to all changes in this revision

Viewing changes to src/seat.c

  • Committer: Tarmac
  • Author(s): Robert Ancell
  • Date: 2013-08-08 22:23:33 UTC
  • mfrom: (1749.1.3 seat-lock)
  • Revision ID: tarmac-20130808222333-3nao2tjwmdj6dkh0
Fix session locking broken in 1.7.5. Fixes: https://bugs.launchpad.net/bugs/1209107.

Approved by Robert Ancell, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
    /* The sessions on this seat */
46
46
    GList *sessions;
47
47
 
 
48
    /* The last session set to active */
 
49
    Session *active_session;
 
50
 
48
51
    /* The session to set active when it starts */
49
52
    Session *session_to_activate;
50
53
  
179
182
 
180
183
    g_return_if_fail (seat != NULL);
181
184
 
 
185
    /* Unlock this session */
 
186
    if (session != seat->priv->active_session && !IS_GREETER (session))
 
187
        session_unlock (session);
 
188
 
182
189
    SEAT_GET_CLASS (seat)->set_active_session (seat, session);
183
190
 
184
191
    /* Stop any greeters */
195
202
            session_stop (s);
196
203
        }
197
204
    }
 
205
 
 
206
    /* Lock previous sessions */
 
207
    if (seat->priv->active_session)
 
208
    {
 
209
        if (session != seat->priv->active_session && !IS_GREETER (seat->priv->active_session))
 
210
            session_lock (seat->priv->active_session);
 
211
        g_object_unref (seat->priv->active_session);
 
212
    }
 
213
    seat->priv->active_session = g_object_ref (session);
198
214
}
199
215
 
200
216
Session *
503
519
 
504
520
    g_signal_handlers_disconnect_matched (session, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, seat);
505
521
    seat->priv->sessions = g_list_remove (seat->priv->sessions, session);
 
522
    if (session == seat->priv->active_session)
 
523
    {
 
524
        g_object_unref (seat->priv->active_session);
 
525
        seat->priv->active_session = NULL;
 
526
    }
 
527
    if (session == seat->priv->session_to_activate)
 
528
    {
 
529
        g_object_unref (seat->priv->session_to_activate);
 
530
        seat->priv->session_to_activate = NULL;
 
531
    }
506
532
 
507
533
    display_server = session_get_display_server (session);
508
534
    if (!display_server)
1535
1561
        g_signal_handlers_disconnect_matched (session, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, self);
1536
1562
    }
1537
1563
    g_list_free_full (self->priv->sessions, g_object_unref);
 
1564
    if (self->priv->active_session)
 
1565
        g_object_unref (self->priv->active_session);
1538
1566
    if (self->priv->session_to_activate)
1539
1567
        g_object_unref (self->priv->session_to_activate);
1540
1568