| Modifier and Type | Class and Description |
|---|---|
| public static interface | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private long | |
| private static int | |
| private long | endSessionResponseCounter
1) Prevents old answers to new signals. |
| private long | |
| private Callback | |
| private long | |
| private boolean | |
| private List | |
| private long | |
| private SessionManagerDBus. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private String | |
| private boolean | |
| private long | Returns: Pointer to dbus proxy, 0 if failed.Creates a connection to the session manager. |
| private boolean | |
| public void | |
| private static String | |
| private static String | |
| private long | Returns: Error string in case of error, null if successful.Receives events from session manager. |
| private void | |
| private void | |
| private void | |
| private boolean | |
| private String | Returns: Error string in case of error, null if successful.Issues 'RegisterClient' dbus request to register with session manager. |
| private boolean | |
| public void | |
| private void | |
| private boolean | |
| private synchronized void | |
| private long |
| clientObjectPath | back to summary |
|---|---|
| private String clientObjectPath | |
| clientProxy | back to summary |
|---|---|
| private long clientProxy | |
| dbusTimeoutMsec | back to summary |
|---|---|
| private static int dbusTimeoutMsec | |
| endSessionResponseCounter | back to summary |
|---|---|
| private long endSessionResponseCounter 1) Prevents old answers to new signals. For example, if signal's handler asks user, it can stay for a while and when it's closed it could be the other signal already. 2) Makes sure answer is given on System.exit() | |
| endSessionResponseWanted | back to summary |
|---|---|
| private long endSessionResponseWanted | |
| g_signal_callback | back to summary |
|---|---|
| private Callback g_signal_callback | |
| g_signal_callbackid | back to summary |
|---|---|
| private long g_signal_callbackid | |
| isGnome | back to summary |
|---|---|
| private boolean isGnome | |
| listeners | back to summary |
|---|---|
| private List<SessionManagerDBus. | |
| sessionManagerProxy | back to summary |
|---|---|
| private long sessionManagerProxy | |
| shutdownHook | back to summary |
|---|---|
| private SessionManagerDBus. | |
| SessionManagerDBus | back to summary |
|---|---|
| public SessionManagerDBus() | |
| addListener | back to summary |
|---|---|
| public void addListener(SessionManagerDBus. Subscribes display for session manager events. Display will receive SWT.Close and will be able to hint that the session should not end. Please note that time limit imposed by session manager is 1 second. Final cleanup should happen at Display.dispose(). Display will be disposed before session ends, allowing final cleanup to happen. Please note that time limit imposed by session manager is 10 seconds. | |
| claimDesktopAutostartID | back to summary |
|---|---|
| private String claimDesktopAutostartID() Gets the value of 'DESKTOP_AUTOSTART_ID'. This environment variable is set by session manager if the application was auto started (because it is configured to run automatically for every session). The variable helps session manager to match autostart settings with actual applications. For applications that were not started automatically, the variable is expected to be absent. Once used, 'DESKTOP_AUTOSTART_ID' must not leak into child processes, or they will fail to 'RegisterClient'. Note calling this function twice will give empty ID on second call. I think this is reasonable. If second object is created for whatever reason, it's OK to consider it to be a separate client. | |
| connectClientSignal | back to summary |
|---|---|
| private boolean connectClientSignal() | |
| connectSessionManager | back to summary |
|---|---|
| private long connectSessionManager(String dbusName, String objectPath, String interfaceName) Creates a connection to the session manager.
| |
| connectSessionManager | back to summary |
|---|---|
| private boolean connectSessionManager() | |
| dispose | back to summary |
|---|---|
| public void dispose() | |
| extractFreeGError | back to summary |
|---|---|
| private static String extractFreeGError(long errorPtr) | |
| extractVariantTupleS | back to summary |
|---|---|
| private static String extractVariantTupleS(long variant) | |
| g_signal_handler | back to summary |
|---|---|
| private long g_signal_handler(long proxy, long sender_name, long signal_name, long parameters, long user_data) Receives events from session manager. Docs: https://developer.gnome.org/gio/stable/GDBusProxy.html#GDBusProxy-g-signal NOTE: Will be called through native callback.
| |
| handleEndSession | back to summary |
|---|---|
| private void handleEndSession() | |
| handleQueryEndSession | back to summary |
|---|---|
| private void handleQueryEndSession() | |
| handleStop | back to summary |
|---|---|
| private void handleStop() | |
| queryReadyToExit | back to summary |
|---|---|
| private boolean queryReadyToExit() | |
| registerClient | back to summary |
|---|---|
| private String registerClient(String appID, String clientStartupID) Issues 'RegisterClient' dbus request to register with session manager. Saves result to member variable when successful.
| |
| registerClient | back to summary |
|---|---|
| private boolean registerClient() | |
| removeListener | back to summary |
|---|---|
| public void removeListener(SessionManagerDBus. | |
| sendEndSessionResponse | back to summary |
|---|---|
| private void sendEndSessionResponse(boolean is_ok, String reason, long responseID) | |
| start | back to summary |
|---|---|
| private boolean start() | |
| stop | back to summary |
|---|---|
| private synchronized void stop() Un-subscribes from session manager events. Note Both Gnome and XFCE will automatically remove client record when client's process ends, so it's not a big deal if this is not called at all. See comments for this class to find 'dbus-send' commands to verify that. 'synchronized' guards against the rare possible case where some thread calls System.exit() while main thread is in Display.dispose() and both main thread and my 'ShutdownHook' try to run .stop(). | |
| wantEndSessionResponse | back to summary |
|---|---|
| private long wantEndSessionResponse() | |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: false to hint that you're not ready. Session manager can ignore the hint.Are you ready to exit? |
| public void |
| isReadyToExit | back to summary |
|---|---|
| public boolean isReadyToExit() Are you ready to exit? Time limit imposed by session manager is 1 second. Final cleanup should happen in stop().
| |
| stop | back to summary |
|---|---|
| public void stop() Perform final cleanup here. Please note that time limit imposed by session manager is 10 seconds. | |
| Modifier and Type | Field and Description |
|---|---|
| private SessionManagerDBus |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | run()
Overrides java. Implements java. |
| parent | back to summary |
|---|---|
| private SessionManagerDBus parent | |
| ShutdownHook | back to summary |
|---|---|
| public ShutdownHook(SessionManagerDBus parent) | |
| install | back to summary |
|---|---|
| public void install() | |
| remove | back to summary |
|---|---|
| public void remove() | |
| run | back to summary |
|---|---|
| public void run() Overrides java. Implements java. Doc from java. This method is run by the thread when it executes. Subclasses of This method is not intended to be invoked directly. If this thread is a
platform thread created with a
| |