Browse Source

fix a few minor bugs in the default theme. dont worry about return value after injecting heartbeat script.

sisyphus
Dustin Falgout 8 years ago
parent
commit
796e78a980
  1. 7
      src/greeter.c
  2. 2
      themes/antergos/index.html
  3. 20
      themes/antergos/js/greeter.js

7
src/greeter.c

@ -194,13 +194,6 @@ theme_heartbeat_script_loaded_cb(GObject *object,
return; return;
} }
context = webkit_javascript_result_get_global_context(js_result);
value = webkit_javascript_result_get_value(js_result);
if (! JSValueIsNull(context, value) && ! JSValueIsUndefined(context, value)) {
g_warning("Error running javascript: unexpected return value.");
}
webkit_javascript_result_unref(js_result); webkit_javascript_result_unref(js_result);
} }

2
themes/antergos/index.html

@ -179,7 +179,7 @@
<td> <td>
<div class="alert alert-danger fade in"> <div class="alert alert-danger fade in">
<button type="button" class="close cancel_auth" data-dismiss="alert" aria-hidden="true">&nbsp;&times;</button> <button type="button" class="close cancel_auth" data-dismiss="alert" aria-hidden="true">&nbsp;&times;</button>
<span id="showMsg"></span> <p id="showMsg"></p>
</div> </div>
</td> </td>
</tr> </tr>

20
themes/antergos/js/greeter.js

@ -567,7 +567,7 @@ class AntergosTheme {
<i class="fa fa-${actions[ action ]}"></i> <i class="fa fa-${actions[ action ]}"></i>
</a>`; </a>`;
if ( lightdm[ cmd ] ) { if ( lightdm[ cmd ]() ) {
$( template ).appendTo( $( this.$actions_container ) ).click( this.system_action_handler ); $( template ).appendTo( $( this.$actions_container ) ).click( this.system_action_handler );
} }
} // END for (var [action, icon] of actions) } // END for (var [action, icon] of actions)
@ -672,8 +672,8 @@ class AntergosTheme {
_util.log( `Starting authentication for ${user_id}.` ); _util.log( `Starting authentication for ${user_id}.` );
_self.selected_user = user_id; _self.selected_user = user_id;
// CSS hack to workaround webkit bug
if ( $( _self.$user_list ).children().length > 3 ) { if ( $( _self.$user_list ).children().length > 3 ) {
// Reset columns since only the selected user is visible right now.
$( _self.$user_list ).css( 'column-count', 'initial' ).parent().css( 'max-width', '50%' ); $( _self.$user_list ).css( 'column-count', 'initial' ).parent().css( 'max-width', '50%' );
} }
$( selector ).addClass( 'hovered' ).siblings().hide(); $( selector ).addClass( 'hovered' ).siblings().hide();
@ -709,8 +709,8 @@ class AntergosTheme {
_util.log( 'Cancelled authentication.' ); _util.log( 'Cancelled authentication.' );
// CSS hack to work-around webkit bug
if ( $( _self.$user_list ).children().length > 3 ) { if ( $( _self.$user_list ).children().length > 3 ) {
// Make the user list two columns instead of one.
$( _self.$user_list ).css( 'column-count', '2' ).parent().css( 'max-width', '85%' ); $( _self.$user_list ).css( 'column-count', '2' ).parent().css( 'max-width', '85%' );
} }
@ -739,9 +739,6 @@ class AntergosTheme {
if ( lightdm.is_authenticated ) { if ( lightdm.is_authenticated ) {
// The user entered the correct password. Let's log them in. // The user entered the correct password. Let's log them in.
// But first, we need to exit the theme heartbeat to prevent a race condition.
_util.stop_theme_heartbeat();
$( 'body' ).fadeOut( 1000, () => { $( 'body' ).fadeOut( 1000, () => {
lightdm.login( lightdm.authentication_user, selected_session ); lightdm.login( lightdm.authentication_user, selected_session );
} ); } );
@ -754,9 +751,12 @@ class AntergosTheme {
submit_password( event ) { submit_password( event ) {
lightdm.respond( $( '#passwordField' ).val() ); let passwd = $( '#passwordField' ).val();
$( '#passwordArea' ).hide(); $( '#passwordArea' ).hide();
$( '#timerArea' ).show(); $( '#timerArea' ).show();
lightdm.respond( passwd );
} }
@ -796,10 +796,10 @@ class AntergosTheme {
$modal.find( '.btn-primary' ).text( _util.translations[ action ] ).click( action, ( event ) => { $modal.find( '.btn-primary' ).text( _util.translations[ action ] ).click( action, ( event ) => {
$( this ).off( 'click' ); $( this ).off( 'click' );
// Stop theme heartbeat to prevent race condition. $( 'body' ).fadeOut( 1000, () => {
_util.stop_theme_heartbeat();
lightdm[event.data](); lightdm[event.data]();
}); });
} );
$modal.find( '.btn-default' ).click( () => { $modal.find( '.btn-default' ).click( () => {
$( this ).next().off( 'click' ); $( this ).next().off( 'click' );
} ); } );
@ -809,7 +809,7 @@ class AntergosTheme {
user_list_collapse_handler() { user_list_collapse_handler() {
_self.user_list_visible = _self.$user_list.hasClass( 'in' ) ? true : false; _self.user_list_visible = _self.$user_list.hasClass( 'in' );
} }

Loading…
Cancel
Save