meliksah / lcs

logitech
GNU General Public License v3.0
24 stars 1 forks source link

Not responding on Ubuntu20.04 #3

Open Mr-Zqr opened 10 months ago

Mr-Zqr commented 10 months ago

Hi meliksah,

Firstly, I have to thank you for this elegant solution. This script works perfectly on my windows PC, making my mouse and keyboard flow seamlessly from Windows to Ubuntu.

However, errors encountered when I tried to run the script on a Ubuntu computer.

  1. At first I tried to run the release version for Ubuntu directly, but encountered incompatibility in GLIBCXX_3.25 since I am running Ubuntu20.04.

  2. Then, I pulled the repo and compiled my own distribution using

    pyinstaller --onefile --windowed --add-data "static/icon:static/icon" --add-data "static/hidapitester:static/hidapitester" --add-data "static/uniclip:static/uniclip" --icon static/icon/icon.icns --name logitech_channel_switcher src/main.py

    When I executed the compiled file in dist/, after a few lines of information output, the program stuck and could not be exited using Ctrl+C and nothing appeared on the top right corner of my screen. By the way, the XDG path statement still pops up even after I exported it. 2024-01-26_15-38

  3. Finally, I tried to run the application from source by

    pip install -r requirements.txt
    python3.9 src/main.py

    But the following error poped up:

    zqr: ~/Downloads/lcs$ python3.9 src/main.py 
    Traceback (most recent call last):
    File "/home/zqr/Downloads/lcs/src/main.py", line 1, in <module>
    from PyQt5.QtWidgets import QApplication, QSystemTrayIcon, QMenu, QDesktopWidget, QLineEdit, QInputDialog
    ModuleNotFoundError: No module named 'PyQt5.QtWidgets'

    When I ran the script with

    python3 src/main.py

    the application successfully booted and I could visit the panel on the top right corner. But, the mouse and keyboard did not flow back to Windows computer as expected.

What am I missing? What should I do to complete the flow? I am looking forward for your kind reply.

Mr-Zqr commented 10 months ago

I further tested the source code and found that in my Ubuntu system, when the mouse cursor reaches the rightmost of the screen, QCursor.pos() returns 2559. However in the "flow.py", self.rightmost_edge returns 2560, causing the application failed to switch channel. After I changed the value of self.rightmost_edge to 2559, the mouse and keyboard successfully switched back to Windows PC.

2024-01-26_17-21

meliksah commented 10 months ago

Do you want to fix the problem in source code with creating pull request?