Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about the CLI. #20

Closed
Vernetzt opened this issue Oct 21, 2024 · 8 comments
Closed

Question about the CLI. #20

Vernetzt opened this issue Oct 21, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@Vernetzt
Copy link

Going to word this more as a question as this could be me doing something incorrectly but the CLI seems to fail under conditions I assumed would work.

Are these invalid arguments or is this a problem somewhere else? With the examples below I get an "unexpected error" window that crashes before I can click "show details".

Using current portable release added to PATH. Same results when attempted in the executable's directory as well.

Command
works hourglass -w minimized 1h40
works hourglass -w minimized -t "test" 1h40
fails hourglass 1h40
fails hourglass -w last 1h40
fails hourglass -t "test" 1h40
fails hourglass -w normal 1h40
fails hourglass -w normal 5
works hourglass -w minimized 5
works hourglass -w last
fails hourglass -w last 5
@i2van
Copy link
Owner

i2van commented Oct 22, 2024

I tested all the commands and everything works as expected using local build and release build.

Please skip to this comment first.

Could you please answer these questions?

  1. What is your Windows version? Run winver (GUI) or ver (CLI) to find out.
  2. Which .NET Framework version is installed? Run reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" /s and look for Release REG_DWORD. You might need admin rights for that, so run this command elevated.
  3. What is your regional settings?
  4. Is where Hourglass command output is the same file you are using?

@i2van
Copy link
Owner

i2van commented Oct 22, 2024

Could you take a look for Hourglass-Crash*.txt files in %TEMP% (usually it is the %USERPROFILE%\AppData\Local\Temp)?

@i2van i2van added the question Further information is requested label Oct 22, 2024
@i2van
Copy link
Owner

i2van commented Oct 22, 2024

Looks like you build project yourself. There is a bug in VS Preview, workaround.

Released version does not have this issue.

@i2van i2van added the documentation Improvements or additions to documentation label Oct 22, 2024
@Vernetzt
Copy link
Author

Build was grabbed from the current release HourglassPortable.zip

Windows 11 Pro 23H2 22631.4317
.NET 4.8.09032
Region US EN
where points to the correct location

Log

System.InvalidOperationException: Cannot perform this operation while dispatcher processing is suspended.
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority)
   at Hourglass.Windows.TimerWindow.OnActivated(EventArgs e)
   at System.Windows.Window.WmActivate(IntPtr wParam)
   at System.Windows.Window.WindowFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

@i2van i2van closed this as completed in 388eb4e Oct 22, 2024
@i2van
Copy link
Owner

i2van commented Oct 22, 2024

Could you please test with binaries from this build?

Unfortunately, I don't have Win 11 to test.

@i2van i2van reopened this Oct 22, 2024
@Vernetzt
Copy link
Author

I have narrowed it down to the theme selection being the cause. Any Dark theme causes this to happen including custom themes.

Same custom theme works if setting <IsUserThemeDark>false</IsUserThemeDark> in Hourglass.config

@Vernetzt
Copy link
Author

Vernetzt commented Oct 22, 2024

388eb4e seems to fix the issue for me.

Selecting any dark theme option or creating a custom one no longer crashes when using any combination of CLI arguments that previously led to errors.

@i2van i2van closed this as completed in 4e4bdfe Oct 22, 2024
@i2van i2van added bug Something isn't working and removed documentation Improvements or additions to documentation question Further information is requested labels Oct 22, 2024
@i2van
Copy link
Owner

i2van commented Oct 22, 2024

Fixed in 1.15.41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants