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

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

Merged
merged 4 commits into from
Feb 24, 2022

Conversation

eteran
Copy link
Owner

@eteran eteran commented Feb 19, 2022

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

…o place the new content. Additionally, tries to determine the preferred window once when multiple documents are specified in order to favor putting all new documents in the same window
@eteran eteran changed the title Attempting to use where the CURSOR is the determine the best window t… Possibly better solution to detection of current window for nc Feb 19, 2022
@eteran eteran force-pushed the new-desktop-detection-method branch from 3f2172c to 8341eed Compare February 19, 2022 22:08
@anjohnson
Copy link
Contributor

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
Copy link
Owner Author

eteran commented Feb 24, 2022

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!

@eteran eteran merged commit b0e1d15 into master Feb 24, 2022
@eteran eteran deleted the new-desktop-detection-method branch February 25, 2022 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants