eteran / nedit-ng

a Qt5 port of the NEdit using modern C++14
GNU General Public License v2.0
95 stars 26 forks source link

Possibly better solution to detection of current window for nc #325

Closed eteran closed 2 years ago

eteran commented 2 years ago

Uses portable QScreen API for simpler code. Uses the current cursor position to determine the "current screen"

anjohnson commented 2 years ago

Yay, this works! I first built the latest version from master, which behaved better than 2020.1-207-gcee33fbe but still didn't always find the right window. Then I switched to this branch and the screen detection now seems to be correct, new windows always open on the current screen. Also if the file is already open it finds it on another screen, and even switches desktops and brings it to the front (don't remember if that always worked before).

There is still a problem with nc-ng -group files... though, which I believe is supposed to open all of those files in the same new window — I got a new window for the first file, but the remainder became tabs in another window that was already open on the same screen. If the only open window(s) were on a different screen though the new window did get all the files.

Those tests were run on macOS Catalina (10.15.7). I did discover that the version of Bison (2.3) that Apple provides no longer works with your code so I had to install a new one, but that's easy using Homebrew. I adjusted the note on the MacOS Wiki page about that, and also added the Makefile that I use, which simplifies repeated builds.

I will test this on RHEL-7 too sometime in the next week or so (it was suffering the same issues IIRC), but don't let that hold up merging this branch if you're ready to do that.

Many thanks!

eteran commented 2 years ago

Fantastic news! I'll look into the group stuff. I suspect it'll be a much simpler fix than this one :-).

Merging this in now!