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

[BUG] Rofi does not open on correct monitor when using -4 flag #1549

Open
anivelle opened this issue Dec 16, 2021 · 15 comments
Open

[BUG] Rofi does not open on correct monitor when using -4 flag #1549

anivelle opened this issue Dec 16, 2021 · 15 comments
Labels

Comments

@anivelle
Copy link

Rofi version (rofi -v)

1.7.2

Configuration

https://gist.github.com/anivelle/80edc0a9d7a7f28a242f9b5c9835bc38

Launch command

rofi -show window -show-icons -m -4

Step to reproduce

  • Use Pop_OS! (21.10) with two monitors and have Firefox focused in a tile (including stacked windows) (this may happen on Ubuntu with any tiling window manager but I do not know)
  • Use arthur theme by Qball (I have modified the colors to create a version of this but the rest of the configuration is identical)
  • Launch Rofi through a custom keyboard shortcut created in settings

Expected behavior

Rofi launches in the center of the monitor with the focused Firefox window.

Actual behavior

If Firefox is in a tile, launching Rofi results in it spanning both monitors, as shown in this image:
rofi
(Ignore the weird negative space, I had to sort of gimmick my way into a full screenshot with Rofi open for some reason)

Additional information

Originally this issue only occurred with Firefox (and it is still the only one to consistently do this), and only when I had it on the border between the monitors, but I somehow managed to reproduce it with other apps by launching Rofi after opening my terminal, for some reason. I launch Rofi through a keyboard shortcut, and when I change the keyboard shortcut (even just going in the setting and rewriting the command) the behavior returns to Firefox being the only app to have an issue. Furthermore, and this isn't as much of an issue for me, all the other window modes except for -5 (which works perfectly) do not work properly. With -3, rofi shows up far to the bottom right of my cursor, and with the other two it's a miracle if it shows on any monitor at all. This may be due to the theme I am using, I am not sure.

Apologies if this is too much info in one issue, this is the first issue ticket I've ever written and I'm not sure how descriptive I'm supposed to be. I imagine unless this isn't a distro/wm-specific issue it might be difficult to reproduce, so I can answer more questions if necessary. Thanks!

@anivelle anivelle added the bug label Dec 16, 2021
@DaveDavenport
Copy link
Collaborator

DaveDavenport commented Dec 16, 2021

Can you post the output of rofi -h? and are you using wayland?

The -m 4 also depends on the window manager relaying all the information correctly, that might throw a spanner in the work too.

@DaveDavenport DaveDavenport added the Incomplete Report - Please follow the guidelines Your report is incomplete and does not follow the guidelines, you may not expect an answer label Dec 16, 2021
@anivelle
Copy link
Author

anivelle commented Dec 16, 2021

Here is the rofi -h output. I am not using Wayland, as far as I can tell. It is entirely possible that it's and issue with Pop_OS!'s window manager, in which case I guess I might have to stick with the default behavior of Rofi.

@DaveDavenport
Copy link
Collaborator

It correctly detects two monitors:

Monitor layout:
              ID: 0
            name: HDMI-1-2
        position: 1920,0
            size: 1920,1080
            size: 521mm,293mm  dpi: 94,94

              ID: 1 (primary)
            name: eDP-1-1
        position: 0,581
            size: 1920,1080
            size: 344mm,193mm  dpi: 142,142

can you add an issue title?

@anivelle anivelle changed the title [BUG] [BUG] Rofi does not open on correct monitor when using -4 flag Dec 16, 2021
@anivelle
Copy link
Author

My bad, I didn't see the title field for some reason.

@DaveDavenport DaveDavenport removed the Incomplete Report - Please follow the guidelines Your report is incomplete and does not follow the guidelines, you may not expect an answer label Dec 16, 2021
@DaveDavenport
Copy link
Collaborator

Can you try git? i added some extra debug information.

G_MESSAGES_DEBUG=X11Helper rofi -show run -m -4

For me this results in:
(process:167417): X11Helper-DEBUG: 10:22:23.576: Find monitor at location: 1937 33
(process:167417): X11Helper-DEBUG: 10:22:23.576: Monitor found pos: 1920 0 3840-2160

So it found the 2nd monitor correctly.

@anivelle
Copy link
Author

When I run it from the terminal (and the issue occurs), it appears to find a monitor that's a combination of both monitors (including the height offset):

(process:18704): X11Helper-DEBUG: 20:22:30.823: Find monitor at location: 1894 541
(process:18704): X11Helper-DEBUG: 20:22:30.823: Monitor found pos: 0 0 3840-1661
(process:18704): X11Helper-DEBUG: 20:22:30.824: Find monitor at location: 1894 541
(process:18704): X11Helper-DEBUG: 20:22:30.824: Monitor found pos: 0 0 3840-1661
(process:18704): X11Helper-DEBUG: 20:22:30.836: Find monitor at location: 1894 541
(process:18704): X11Helper-DEBUG: 20:22:30.836: Monitor found pos: 0 0 3840-1661

Certainly explains the positioning, now that I see it. I'm not sure why it finds the monitor three times, though.
This is the output on the second monitor when the issue does not occur, which looks to me like what I should expect:

(process:18916): X11Helper-DEBUG: 20:30:55.502: Find monitor at location: 2854 517
(process:18916): X11Helper-DEBUG: 20:30:55.502: Monitor found pos: 1920 0 1920-1080
(process:18916): X11Helper-DEBUG: 20:30:55.504: Find monitor at location: 2854 517
(process:18916): X11Helper-DEBUG: 20:30:55.504: Monitor found pos: 1920 0 1920-1080
(process:18916): X11Helper-DEBUG: 20:30:55.516: Find monitor at location: 2854 517
(process:18916): X11Helper-DEBUG: 20:30:55.516: Monitor found pos: 1920 0 1920-1080

If this isn't fixable without the window manager being modified then I'll thank you for your time and effort and stick to using the default behavior.

@DaveDavenport
Copy link
Collaborator

The three times is just a rofi thing (The function gets called an few times).

Ill see if I can figure out why this happens and if I Can do something about it.

@DaveDavenport
Copy link
Collaborator

Only notice this now:

Monitor layout:
              ID: 0
            name: HDMI-1-2
        position: 1920,0
            size: 1920,1080
            size: 521mm,293mm  dpi: 94,94

              ID: 1 (primary)
            name: eDP-1-1
        position: 0,581
            size: 1920,1080
            size: 344mm,193mm  dpi: 142,142

according to this layout, there is no monitor at 1894 541

as the monitor starts with 581 offset.

Not sure why, can you pastebin the output of xrandr --query --verbose

@anivelle
Copy link
Author

Here's the output. It shows both of those same monitors.

@DaveDavenport
Copy link
Collaborator

I get page not found.

@anivelle
Copy link
Author

Apologies for that. I pasted the link incorrectly, I think, and now it seems to have expired. This should work.

@DaveDavenport
Copy link
Collaborator

1920x1080+0+530

This is weird, your monitor is at a different position then rofi reported.
A 51 pixel offset.
(rofi also uses randr to find offset).

@anivelle
Copy link
Author

Sorry, that was my bad. I leveled my displays to see if that changed anything, and re-offset them when it didn't, and I couldn't get them to have the exact offset as before. I should have mentioned that earlier.

@DaveDavenport
Copy link
Collaborator

That atleast clarifies that :D

@anivelle
Copy link
Author

It's been a few days but I should probably mention that I will not have access to my external monitor until the 30th, so I won't be able to run diagnostics or anything till then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants