aarzilli / gdlv

GUI frontend for Delve
Other
1.32k stars 48 forks source link

layout is changed when window is minimized #53

Closed djdv closed 3 years ago

djdv commented 3 years ago

Example: https://www.youtube.com/watch?v=vLXF9g-1O4k

I've been experiencing this for a while but wasn't sure what was causing it. Seems to be minimizing the window. If there's anything I can do to get more helpful information, let me know.

The environment is pretty standard, building 45df4efb18600788cffd3aa9ca3f57a0b4bbd2bf with Go 1.16 on Windows 10 (19042.804).

aarzilli commented 3 years ago

it's possible that building gdlv with go build -tags=nucular_gio will fix both problems, as quick a workaround.

djdv commented 3 years ago

It seems so. Using gio, the layout is preserved through minimize, and drawing seems to be instant while resizing.

aarzilli commented 3 years ago

Is your CPU made by AMD?

djdv commented 3 years ago

Currently using an Intel i7 8086K for the CPU, and an Nvidia GTX 970 for graphics.

aarzilli commented 3 years ago

Fixed the resize issue on the shiny backend and made the gio backend default on windows.

djdv commented 3 years ago

@aarzilli Thanks for that :^) However, I noticed a new issue. When using gio as the backend with gdlv, the default keybinds, F5, F10, etc. don't seem to work, as they did with the shiny backend. If you want, I can open a seperate issue for that.

Also a minor thing, the nucular README needs to be updated: https://github.com/aarzilli/nucular/commit/7376405f445445bfd5bb03901a544210d1f362f9#commitcomment-47463203

aarzilli commented 3 years ago

Try now.

djdv commented 3 years ago

Closer! The F keys are detected now but there seems to be an issue that requires them to be pressed twice. Random thoughts: I'm not sure if it's related to losing focus on one of the panes, or something to do with how the event queue is handled. If I hit an F key, then click the window, then hit an F key again, it, works every time. Otherwise I have to press the F key twice. Example: https://youtu.be/M8S-JeDIRd4

aarzilli commented 3 years ago

It seems that it's specifically F10, it's focusing the titlebar menu. If you press F10 followed by the down arrow you'll see it.

If you change vendor/gioui.org/app/internal/window/os_windows.go and add this

            if msg == windows.WM_SYSKEYDOWN && wParam == windows.VK_F10 {
                return 0
            }

on line 250 (at the end of the case where windows.WM_SYSKEYDOWN is processed) it works.

djdv commented 3 years ago

Nice! With that change applied, F10 seems to no longer move the focus to the titlebar when using gio, and steps as expected. Thanks for helping me with this :^)

Is this something that should be changed upstream in Gio? Without it, using Gio as the default backend for gdlv on Windows, combined with the default key bindings, seems a bit troublesome. It seems like Gio would need to offer some means of providing a list of events to ignore/filter. Abstractly something like gio.Ignore(windowsSystemBinding) where the bindings are a list key-event message parameters that the GUI-program wants to use itself (like windows.VK_F10 ).

aarzilli commented 3 years ago

Yes, however when I tried to apply the patch to the latest version of gio I've noticed that there are more problems with it (specifically with registering key presses) which I'll eventually have to investigate. Since there are other keybindings for step and step into I don't consider this a high priority.