Giter Club home page Giter Club logo

Comments (21)

stormckey avatar stormckey commented on May 26, 2024

Sometimes the panel can fit my 4K monitor well. But it seems that Kando fails to track my mouse horizontally, which means that it appears somewhere with the same height with my mouse, but in a fixed horizontal position. Any ideas?

from kando.

Schneegans avatar Schneegans commented on May 26, 2024

Hi there! Well, that's a couple of issues here πŸ˜‰ Let's give you some hints and thoughts here.

from kando.

stormckey avatar stormckey commented on May 26, 2024
  • Yes, I have added the required rules into my hyprland config.
  • I have installed kando manually, so the next step should be?
    image
  • Thanks! That works. But I think closing it with a right click is way more convenient(since I dont need to move my cursor to the item). I remember fly-pie on gnome can be closed by right click? I like that.

from kando.

stormckey avatar stormckey commented on May 26, 2024

Something weird: The panel wont change if I comment the window rules in my hyprland config. It seems that these rules dont take effect now?
I try to apply same noborder rules to my terminal, and it takes effect immediately.

from kando.

Schneegans avatar Schneegans commented on May 26, 2024

Well, that's an interesting observation. Maybe the window name is not correct anymore? Could you run hyprctl clients while the menu is open and see if there is a kando?

Btw, I just pushed a commit to main which allows closing the menu with the right mouse button πŸ˜‰

from kando.

stormckey avatar stormckey commented on May 26, 2024

Great! I really appreciate the new feature! Thanks for your effort!

As for the problem, it turned out that the window is called Kando on my system, I am not sure if this is common, but after changing the name in the rule to Kando, the menu can function well now.

For the position mismatch I mentioned before, I have just found a way to repeat it easily. On my 4K external monitor, as long as my cursor is way too right, the menu will fail to track the cursor horizontally. Here is a viedo for your reference:

output.mp4

Another subtle problem showed in the video is the flicker of the screen when calling out the menu.

from kando.

Schneegans avatar Schneegans commented on May 26, 2024

Yeah, I suspected the name change. Some time ago I changed the app name from "kando" to "Kando" and it seems that Electron uses this app name for the window title as well. I changed the comment in #245 accordingly. Does this change also affect the global shortcut? Does bind = CTRL, Space, global, kando:prototype_menu still work? Or does it need to be bind = CTRL, Space, global, Kando:prototype_menu?

The menu position issue is interesting. To get the pointer position on Hyprland, Kando uses hyprctl -j cursorpos. Maybe you could a debug print here to log the returned value. E.g. console.log(cursorpos.x + " " + cursorpos.y).

from kando.

stormckey avatar stormckey commented on May 26, 2024
  • No, kando works well as a short cut, and it's Kando that cant function well here.
  • I have just tried that out and here is the result:
    image
    The output coincides with the output of hyprctl -j cursorpos. It's also reasonable as 4k is just 3840x2160, but the x of the menu is apparantly not as large.
    For the position, actually it feels that there is an extra offset to the x position, rather than a fixed x position.

from kando.

stormckey avatar stormckey commented on May 26, 2024

This is the position returned when the cursor is on my build-in screen.

image

I am not sure if you are aware of this? The left-top point of my external monitor locates in (0,0), the right-bottom point locates in (3840,2160) ,while the left-top point of my build-in screen locates in (3840,0). They are placed side by side.

If such configuration are needed for the app. They can be get through hyprctl monitors list

image

Hope my response is helpful for you 😊

from kando.

Schneegans avatar Schneegans commented on May 26, 2024

Maybe Electron has some issues getting this information on Hyprland? You could add some more debug prints to figure this out. The window size and position is set here whenever the menu is opened. This ensures that it is shown fullscreen on the monitor where your mouse pointer currently is. If you print workarea.x, workarea.y, workarea.width, workarea.height in this method, you should get the same values as hyperctl returns. Does this work?

Further down in this method (here) the menu position is computed. This simply subtracts the monitor position from the pointer position. Mabe you could print pos.x and pos.y here. Is there something dubious about the returned values?

from kando.

stormckey avatar stormckey commented on May 26, 2024

I have just print the info as you instructed and here's the reuslts:

image

As I can see, something went wrong here. The screen locate in (0,0) should have the width 3840 and height 2160 not 2880 and 1800. So actually here you assume that the 4k external monitor should locate to the right of the build-in screen, which is opposite.

Is that assumption something fixed in your code ? Maybe you can change this and try to get the right composition.

Maybe the info in hyprctl monitors list is helpful.
image

image

from kando.

Schneegans avatar Schneegans commented on May 26, 2024

So the mouse pointer coordinates are correct but the reported monitor positions are not? Well, this looks kind of like a bug in Electron. Or maybe even in Chromium. We should try to report this over there.

Do you have some experience with Electron? If so, you could create a small reproducible example using this tool. If no, I'll try to do this later. But it could take some time...

from kando.

stormckey avatar stormckey commented on May 26, 2024

So the workarea is something offered by Electron? If so, yes, there is something wrong there.

For the case above, it should either return (0,0,3840,2160) or(3840,0,2880,1800), not (0,0,2880,1800) ,(2880,0,3840,2160).

But I am sorry that I have no experience with Electron. I am always available for any further questions:)

from kando.

Schneegans avatar Schneegans commented on May 26, 2024

I just create a minimal Electron example. Could you please install the Electron Fiddle and load the fiddle from this link: https://gist.github.com/Schneegans/95b5146eb253b0fe0ffe780742b33a05

If you hit the "Run" button, a hello-world window will pop up. If you move the window around, the console in Electron Fiddle will print the current position of the window's top left corner. It will also print the position and the extend of the screen which Electron thinks the window is on.

I am using GNOME on Wayland currently and have a similar setup to yours:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   β”‚
β”‚     Secondary     β”‚β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     3840x2160     β”‚β”‚   Primary   β”‚
β”‚                   β”‚β”‚  1920x1200  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

If the window is moved on the secondary monitor, something like this is printed:

Window position:  [ 1600, 837 ]  Window's Screen:  { x: 0, y: 0, width: 3840, height: 2160 }

On the primary, something like this is printed:

Window position:  [ 4249, 1394 ]  Window's Screen:  { x: 3840, y: 960, width: 1920, height: 1200 }

Which totally makes sense. What does this print for you?

from kando.

stormckey avatar stormckey commented on May 26, 2024

I've tried it out and it's not normal for me...
There is also negative number there and the workarea is just wrong the same way we used to see.
image

The actual position is :

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   β”‚β”‚   Primary   β”‚
β”‚     Secondary     β”‚β”‚  2880x1800  β”‚
β”‚     3840x2160     β”‚β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

But in the view of electron, it is:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Primary   β”‚|                   β”‚
β”‚  2880x1800  β”‚β”‚     Secondary     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚     3840x2160     β”‚
               |                   β”‚
               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

By the way, the second view seems to be the default position hyprland give, but I configured it the first way.

from kando.

Schneegans avatar Schneegans commented on May 26, 2024

How did you configure this? Did you assign a negative -3840 offset to the secondary screen or a positive offset of 3840 to the primary screen? Maybe only one way works properly?

from kando.

stormckey avatar stormckey commented on May 26, 2024

No, I just need to assign an origin point to the monitor. This is the specification from the hyprland wiki:
image

And this is my configuration:
image

I just let the external monitor to locate in 0x0, and the other monitor is placed automatically.

from kando.

Schneegans avatar Schneegans commented on May 26, 2024

Maybe you could play with these values and see if it makes any difference? So either assign an explicit offset to the primary monitor or maybe a negative offset to the secondary?

from kando.

stormckey avatar stormckey commented on May 26, 2024

Assigning negative values is valid as said in the hyprland wiki, and I've tried that out.

It turned out that there is no change with the workarea returned by Electron. It seems that Electron just have no awareness of such a configuration.

And hyprland itself is aware of such a configuration. The info returned by hyprctl -j cursorpos and hyprctl monitors list will be negative as I config.

from kando.

Schneegans avatar Schneegans commented on May 26, 2024

Well, I have basically no idea where this problem may come from. This could be an Electron bug, but I think that it is more likely an issue in the underlying Chromium code. I think that Chromium uses Ozone under the hood for such platform interaction, but I am not sure about this. So the issue could be in either of them, but it could also be in Hyprland. Maybe some Wayland protocol is not implemented correctly?

I think the best way would be if you opened an Electron issue here providing an explanation of how Electron seems to ignore Hyprland's monitor config. They ask for an Electron Fiddle link, there you could provide my example and explain the expected and the actual output.

from kando.

stormckey avatar stormckey commented on May 26, 2024

Sure, I will.

from kando.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.