Jump to content
Not connected, Your IP: 3.236.147.122
Sign in to follow this  
nicolasbrown

ANSWERED Eddie inhibiting Windows restart/logout/shutdown

Recommended Posts

Posted ... (edited)

Eddie indefinitely inhibits/halts Windows when the user tries to restart, log out or shut down. (If Windows is restarting automatically not initiated by user, it will forcefully kill Eddie eventually, but not if the user initiated the restart).

On the restarting screen, the "restart anyway" has to be clicked to proceed every time or Windows waits indefinitely. It can be seen that Eddie is the process "preventing you from restarting" but I cannot take a screenshot of it.

The reason seems to be that Eddie treats these events the same way as when a user normally clicks "Exit" on Eddie - it creates a popup dialog and refuses to end:
image.png.477b8096e63bfc45ece1e642bb898a97.png


Expectation: Eddie should not inhibit the system when the user is doing a restart/logout/shutdown; it should exit quietly like other programs. There is no benefit to the current behavior. The only case programs should inhibit the system this way is when there is something unsaved/uncommitted the user might want to keep (like an open text editor); that is clearly not the case here.

There should be various ways to detect when the system is in process of a restart/logout/shutdown (in contrast to the user clicking "Exit" or clicking the "X" on the main window):

Edited ... by nicolasbrown

Share this post


Link to post

Based on the articles above, suggested patch to Eddie source code (not tested):

diff --git a/common/lang/inv.json b/common/lang/inv.json
index cf2e13a..efeefab 100644
--- a/common/lang/inv.json
+++ b/common/lang/inv.json
@@ -413,6 +413,7 @@
     "StatsVpnTotalUpload": "VPN Total Upload",
     "StatsVpnType": "VPN Type",
     "WindowsSettingsRouteOutEmptyList": "WARNING: not specified routes go outside the tunnel, but you did not specify any route. Continue?",
+    "WindowsSystemSessionEnding": "Received system-session-ending event (restart, shutdown or log off)",
     "CommandCancel": "Cancel",
     "CommandConnect": "Connect to a recommended server",
     "CommandConnectSubtitle": "or choose a specific server in 'Servers' tab.",
@@ -541,4 +542,4 @@
     "WindowsUnlockFirstAuth": "Enter your password to unlock profile",
     "WindowsUnlockTitle": "Unlock",
     "OsWindowsNetworkAdapterDnsDone": "DNS {1} of a network adapter forced ({2}, from {3} to {4})"
-}
\ No newline at end of file
+}
diff --git a/src/Lib.Forms/Forms/Main.cs b/src/Lib.Forms/Forms/Main.cs
index 8ebd80f..5763a92 100644
--- a/src/Lib.Forms/Forms/Main.cs
+++ b/src/Lib.Forms/Forms/Main.cs
@@ -75,6 +75,9 @@ namespace Eddie.Forms.Forms
 
                private bool m_logNeedScrollBottom = false;
 
+               private const int WM_QUERYENDSESSION = 0x11;
+               private static bool isSystemSessionEnding = false;
+
                public Main()
                {
                        OnPreInitializeComponent();
@@ -94,6 +97,16 @@ namespace Eddie.Forms.Forms
                        SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true);
                }
 
+               protected override void WndProc(ref System.Windows.Forms.Message m)
+               {
+                       if (m.Msg == WM_QUERYENDSESSION)
+                       {
+                               Engine.Instance.Logs.Log(LogType.InfoImportant, LanguageManager.GetText("WindowsSystemSessionEnding"));
+                               isSystemSessionEnding = true;
+                       }
+                       base.WndProc(ref m);
+               }
+
                private void DoDispose(IDisposable o)
                {
                        if (o != null)
@@ -652,7 +665,8 @@ namespace Eddie.Forms.Forms
 
                        e.Cancel = true;
 
-                       if (Engine.Instance.AskExitConfirm())
+                       // If the system session is ending (restart/shutdown/logoff), do not inhibit it by creating popups.
+                       if (!isSystemSessionEnding && Engine.Instance.AskExitConfirm())
                        {
                                if (AskYesNo(LanguageManager.GetText("ExitConfirm")) != true)
                                {

Share this post


Link to post
@nicolasbrown

Hello and thank you,

we will point the developer to your messages. In the meantime, from Eddie's settings you can disable the exit confirmation popup dialog to resolve the annoyance.

Kind regards
 

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...