403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.60
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/cinnamon-screensaver/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/cinnamon-screensaver/__pycache__/manager.cpython-310.pyc
o

�Zb4?�@s�ddlmZmZmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddl
Z
ddlmZddlZddlmZmZmZddlmZddlmZGdd�dej�ZdS)	�)�Gdk�GObject�GLib�GioN)�Stage)�utils�settings�trackers)�FocusNavigator)�
GrabHelpercs.eZdZdZdejjdeffiZ�fdd�Z	dd�Z
dd	�ZdCdd�Zd
d�Z
dDdd�Zdd�Zdd�Zdd�Zdd�ZdDdd�Zdd�Zdd�ZdDdd �Zd!d"�ZdDd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Z d5d6�Z!d7d8�Z"d9d:�Z#d;d<�Z$d=d>�Z%d?d@�Z&dAdB�Z'�Z(S)E�ScreensaverManagerz�
    The ScreensaverManager is the central point where most major decision are made,
    and where ScreensaverService requests are acted upon.
    �active-changedNcs~tt|���d|_d|_d|_d|_dt_dt_	dt_
t|�|_t
�|_tj|_t���|jd|j�tj|_t�|�dS)NrFzidle-changed)�superr�__init__�activated_timestamp�stage�fb_pid�fb_failed_to_start�status�Active�Locked�Awaker�grab_helperr
�	focus_nav�
singletons�
SessionClient�session_clientr	�con_tracker_get�connect�on_session_idle_changed�CinnamonClient�cinnamon_client�LoginClientResolver��self��	__class__��*/usr/share/cinnamon-screensaver/manager.pyrs"
�zScreensaverManager.__init__cC�tjS)zS
        Return if we're Locked - we could be Active without being locked.
        )rrr#r'r'r(�	is_locked7szScreensaverManager.is_lockedcCs(|rdt_|��dSdt_|��dS)NTF)rr�spawn_fallback_window�kill_fallback_window)r$�lockedr'r'r(�
set_locked=s
zScreensaverManager.set_locked�cCsVtjs|�d|�r|��t��r|�d�dSdSt��r#|�d�|j�|�dS)a
        Initiate locking (activating first if necessary.)  Return True if we were
        already active and just need to set the lock flag (or we were already locked
        as well).  Return False if we're not active, and need to construct a stage, etc...
        TF)	rr�
set_active�stop_lock_delayr�
user_can_lockr.r�set_message)r$�msgr'r'r(�lockEs
�
zScreensaverManager.lockcCs|�d�|�d�dt_dS)z5
        Initiate unlocking and deactivating
        FN)r0r.rrr#r'r'r(�unlock]s


zScreensaverManager.unlockcCs�|r?tjs7|j��|j�d�r2|js#tj�	��
�|�||j�dS|j�
|j�|j�|�dSdt_dS|j�|�dS|jrR|�|j�tj�	���gt_|j��dS)a�
        Activates or deactivates the screensaver.  Activation involves:
            - sending a request to Cinnamon to exit Overview or Expo -
              this could prevent a successful screen grab and keep the
              screensaver from activating.
            - grabbing the keyboard and mouse.
            - creating the screensaver Stage.
        Deactivation involves:
            - destroying the screensaver stage.
            - releasing our keyboard and mouse grabs.
        FT)rrr!�exit_expo_and_overviewr�	grab_rootrr�Application�get_default�hold�spawn_stage�on_spawn_stage_complete�activater3�
despawn_stage�on_despawn_stage_complete�release�focusWidgets)r$�activer4r'r'r(r0es*
�
zScreensaverManager.set_activecCr))zh
        Return whether we're Active or not (showing) - this is not
        necessarily Locked.
        )rrr#r'r'r(�
get_active�szScreensaverManager.get_activecCs |jdkrtt��|j�SdS)zI
        Return how long we've been activated, or 0 if we're not
        r)r�int�timer#r'r'r(�get_active_time�s
z"ScreensaverManager.get_active_timecCs�tjsdStjrtjstd�tjr2|j��r2tjr!tjs!td�|j��|j	�
�|j��dStjr9td�t�
��d|j�dS)a:
        Called upon any key, motion or button event, does different things
        depending on our current state.

        If we're idle:
            - do nothing

        If we're locked:
            - show the unlock widget (if it's already visible, this also has
              the effect of resetting the unlock timeout - see Stage.py)
            - show the mouse pointer, so the user can navigate the unlock screen.

        If we're Active but not Locked, simply deactivate (destroying the Stage
        and returning the screensaver back to idle mode.)
        Nzmanager: user activity, wakingz&manager: locked, raising unlock widgetz/manager: not locked, queueing idle deactivation�idle-deactivate)rr�Debugr�printrr�initialize_pam�raise_unlock_widgetr�
release_mouse�maybe_update_layoutr	�timer_tracker_get�add_idle�idle_deactivater#r'r'r(�simulate_user_activity�s


�z)ScreensaverManager.simulate_user_activitycCs|�d�t���d�dS)NFrH)r0r	rO�cancelr#r'r'r(rQ�s
z"ScreensaverManager.idle_deactivatecCs\zt||�|_|j�|�WdSty-td�t��|j��dt	_
|��YdSw)z�
        Create the Stage and begin fading it in.  This may run quickly, in the case of
        user-initiated activation, or slowly, when the session has gone idle.
        z#Could not spawn screensaver stage:
FN)rrr>�	ExceptionrJ�	traceback�	print_excrrArr�
cancel_timers)r$�away_message�callbackr'r'r(r<�s
�zScreensaverManager.spawn_stagecCsH|jdkrdStjrtd�|j��r|�|�dS|j�d|j�dS)Nrz!manager: spawning fallback window�realize)rrrIrJr�get_realized�_real_spawn_fallback_windowrr#r'r'r(r+�s

z(ScreensaverManager.spawn_fallback_windowc	
Cszd}d}t��dd�}g}zmt�ddg��d�}|�d�D]?}|�|�rLd|vr=d|vr=|��d�dd	�}|�|�qd|vrK|��d�dd	�}qd|vr]|�|��d�dd	��q|�	�|dkrzt
dd
�D]}t|�|vryt|�}nqkWnty�}zt
dt|��WYd}~nd}~ww|dkr�ztjd}Wnty�d
}Ynw|dkr�|dkr�dnd}||gS)N��wz-hzutf-8�
zcinnamon-session�tty�r/�z(Failed to get tty numbers using w -h: %s�XDG_VTNR�7�2�1)r�
get_user_name�
subprocess�check_output�decode�split�
startswith�replace�append�sort�range�strrTrJ�os�environ�KeyError)	r$�session_tty�term_tty�username�used_tty�
tty_output�line�i�er'r'r(�get_tty_vals�sL
�������zScreensaverManager.get_tty_valsc
Cs�|jdkrdS|��\}}tj�tjd�t|j�	��
��||g}z
t�|�d|_Wntj
yG}zd|_td|j�WYd}~nd}~wwz
|j�|j�WdSYdS)Nrzcs-backup-lockerTz0Could not start screensaver fallback process: %s)rr}rr�path�join�config�
libexecdirrqr�
get_window�get_xidr�spawn_async�ErrorrrJ�message�disconnect_by_funcr\)r$r�datarvru�argvr|r'r'r(r\s&
���z.ScreensaverManager._real_spawn_fallback_windowcCs�|jdkr
|js
dStjrtd�ztjrtd�|jdkr&t�|jd�n|jr-td��Wn8tyftjr<td�tj	�
td��}|�td��|�
tjdd	��|�tjj�tj���d
|�Ynwz
t�|jtj�WnYd|_d|_dS)Nrz manager: killing fallback windowz2manager: checking if fallback window exists first.zFallback window failed to startzVmanager: fallback window terminated before the main screensaver, something went wrong!z-Cinnamon Screensaver has experienced an errorz�The 'cs-backup-locker' process terminated before the screensaver did. Please report this issue and try to describe any actions you may have performed prior to this occurring.zdialog-error)�namezcinnamon-screensaverF)rrrrIrJrr�kill�ProcessLookupErrorr�Notification�new�_�set_body�set_icon�
ThemedIcon�set_priority�NotificationPriority�URGENTr9r:�send_notification�signal�SIGTERM)r$�notificationr'r'r(r,s6
��
z'ScreensaverManager.kill_fallback_windowcCs|j��|j�|�dS)z1
        Begin destruction of the stage.
        N)r�cancel_unlocking�
deactivate)r$rYr'r'r(r?As
z ScreensaverManager.despawn_stagecCs&|��dt_|�dd�|��dS)a<
        Called after the stage become visible.  All user events are now
        redirected to GrabHelper, our status is updated, our active timer
        is started, and emit an active-changed signal (Which is listened to
        by our ConsoleKit client if we're using it, and our own ScreensaverService.)
        Tr
N)�
grab_stagerr�emit�start_timersr#r'r'r(r=Hsz*ScreensaverManager.on_spawn_stage_completecCsdtjdk}dt_|r|�dd�|��|j��d|_tjr%t���	�tj
r0t����dSdS)z�
        Called after the stage has been hidden - the stage is destroyed, our status
        is updated, timer is canceled and active-changed is fired.
        TFr
N)
rrr�rWr�
destroy_stager	�
DEBUG_SIGNALSr�dump_connections_list�DEBUG_TIMERSrO�dump_timer_list)r$�
was_activer'r'r(r@Ws

�z,ScreensaverManager.on_despawn_stage_completecCs&|jdkr|j�|j��d�dSdS)z�
        Makes a hard grab on the Stage window, all keyboard and mouse events are dispatched or eaten
        by us now.
        NT)rr�move_to_windowr�r#r'r'r(r�ns
�zScreensaverManager.grab_stagecCs*|jdkrdStjrtd�|j��dS)a
        Tells the stage to check its canvas size and make sure its windows are up-to-date.  This is called
        when our login manager tells us its "Active" property has changed.  We are always connected to the
        login manager, so we first check if we have a stage.
        Nz>manager: queuing stage refresh (login manager reported active?)rrrIrJ�queue_refresh_stager#r'r'r(�update_stagevs

zScreensaverManager.update_stagecCst��|_|��dS)z�
        Stamps our current time starts our lock delay timer (the elapsed time to allow after
        activation, to lock the computer.)
        N)rFr�start_lock_delayr#r'r'r(r��s
zScreensaverManager.start_timerscCsd|_|��dS)zU
        Zeros out our activated timestamp and cancels our lock delay timer.
        rN)rr1r#r'r'r(rW�sz ScreensaverManager.cancel_timerscCs|��|j��dS)zX
        Return to sleep (not Awake) - hides the pointer and the unlock widget.
        N)r�rr�r#r'r'r(�cancel_unlock_widget�sz'ScreensaverManager.cancel_unlock_widgetcCstjrtd�|�d�dS)zJ
        Updates the lock status when our timer has hit its limit
        z+manager: locking after delay ('lock-delay')TF)rrIrJr.r#r'r'r(�on_lock_delay_timeout�s
z(ScreensaverManager.on_lock_delay_timeoutcCsLt��sdSt��sdSt��}|dkr|��dSt���d||j�dS)z�
        Setup the lock delay timer based on user prefs - if there is
        no delay, or if idle locking isn't enabled, we run the callback
        immediately, or simply return, respectively.
        Nr�idle-lock-delay)	r�get_idle_lock_enabledrr2�get_idle_lock_delayr�r	rO�
start_seconds)r$�
lock_delayr'r'r(r��s
�z#ScreensaverManager.start_lock_delaycCst���d�dS)z/
        Cancels the lock delay timer.
        r�N)r	rOrSr#r'r'r(r1�sz"ScreensaverManager.stop_lock_delaycC�|j�|�dS)zL
        Forwards a captured key event to the stage->unlock dialog.
        N)r�queue_dialog_key_event)r$�eventr'r'r(r���z)ScreensaverManager.queue_dialog_key_eventcCr�)z>
        Forwards a tab event to the focus navigator.
        N)r�navigate)r$�shiftedr'r'r(�propagate_tab_event�r�z&ScreensaverManager.propagate_tab_eventcCs|j��dS)zO
        Forwards an activation event (return) to the focus navigator.
        N)r�activate_focusr#r'r'r(�propagate_activation�sz'ScreensaverManager.propagate_activationcCs
|j��S)zN
        Returns the currently focused widget from the FocusNavigator
        )r�get_focused_widgetr#r'r'r(r��s
z%ScreensaverManager.get_focused_widgetcCs6tjrtdt|��|rtjs|�d�dSdSdS)z�
        Call back for the session client - initiates a slow fade-in
        for the stage when the session goes idle.  Cancels the stage fade-in
        if idle becomes False before it has completed its animation.
        z"manager: session idle-changed - %sTN)rrIrJrqrr0)r$�proxy�idler'r'r(r�s

�z*ScreensaverManager.on_session_idle_changed)r/)N))�__name__�
__module__�__qualname__�__doc__r�SignalFlags�RUN_LAST�bool�__gsignals__rr*r.r5r6r0rDrGrRrQr<r+r}r\r,r?r=r@r�r�r�rWr�r�r�r1r�r�r�r�r�
__classcell__r'r'r%r(rsF�

%	$

'
"r)�
gi.repositoryrrrrrFrUrrr�rhr��	constants�crrrr�utilrrr	�util.focusNavigatorr
�util.grabHelperr�Objectrr'r'r'r(�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit