-
-
Notifications
You must be signed in to change notification settings - Fork 726
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
Tooltips / Menus not correctly positioned #63
Comments
The tooltips show up in the middle of the screen for me, but they should appear where my mouse is. Is that what this issue is describing? |
One interesting find I just made is, that everytime aa tooltip is displayed, waybar gets a new window/container id from sway. |
@matt-snider Yeah that's the part of the issue! |
I have debugged to know where it comes from, and it's not a waybar or sway/wlroots fault, but from an update of gtk3 |
@Alexays Thanks for the info. Is there any upstream gtk3 issue we can watch? |
Surely GNOME/gtk@a73f961 |
One possible workaround I can think of is to use the Another variant of the command allows the window to be positioned at the cursor. Here's the i3 manual entry https://i3wm.org/docs/userguide.html#_moving_containers |
I tried |
@JadeMaveric, I had this in my sway config. Works slightly better.
It's also possible to do correct positioning via ipc: #!/usr/bin/env node
const BAR_HEIGHT = 28;
require("i3wm")
.Client.connect({ bin: "sway" })
.then(client => {
client.subscribe("window");
client.on("window", ({ change, container }) => {
if (container.app_id === "waybar" && change === "new") {
client.command(`move position cursor`);
client.command(`move down ${container.geometry.height / 2 + BAR_HEIGHT} px`);
}
});
}); |
Some related links: |
@alebastr Thanks!!! I tried the sway config method and it worked. |
I improved a bit on @alebastr's script and rewrote it in bash. It should now place the menu to the left and below of the cursor, which (at least in my case, with the tray in the top right) never places a menu partly off-screen, and always next to the cursor. #!/bin/bash
handle() {
local event=$(swaymsg -t SUBSCRIBE "['window']");
if [[ $(jq .container.app_id <<< $event) == '"waybar"' && $(jq .change <<< $event) == '"new"' ]]; then
local vert=$(( $(jq .container.geometry.height <<< $event) / 2 + BAR_HEIGHT))
local horz=$(( $(jq .container.geometry.width <<< $event) / 2))
swaymsg move position cursor
swaymsg move down $vert px
swaymsg move left $horz px
fi
}
while handle; do
sleep 0.1
done Adding this to your sway config, the menu doesn't flash up in the center first: for_window [app_id="waybar" floating] {
move position 5000 5000
} |
Unfortunately @topisani 's workaround above doesn't work on some multi monitor setups. Works great on the primary display though. |
How about using wlr-layer-shell if available ? Mako uses it to correctly position itself |
There is a patch for sway which implements layer shell popups: |
SWEET |
If I apply this patch right now, will it all work properly or some Waybar patching will be required too? |
@kisik21 That patch had been merged, but sadly it didnt solve the issue. I suppose XDG Popup still has to be implemented for waybar. |
@dinnymate yeah, I applied this patch myself (it's easy to patch stuff on NixOS - the Linux distribution I use) and saw no difference :3 |
I use arch btw |
@ddevault I used arch btw, NixOS is better |
I don't actually use arch, I'm just making fun of you :P |
We found the arch user.
Oh wait!
|
@ddevault I understood it the second I saw your comment :3 |
Any update on this? |
If I understand correctly, this is just about menus fro tray icons and tooltips (which is still very annoying). Is there any way to position a floating window created by a command run with a custom "on-click" handler? Also, is there anything I could do to help resolve this issue? |
help with this PR maybe? #441 |
Hi, just installed waybar on Arch with Sway. When I run the minimal configuration and put my cursor on the date, I have that:
I think it has something to do with this issue. If it doesn't, please let me know. |
I also get that error, and tooltips do not appear for me at all. |
Need to implement XDG Popup
The text was updated successfully, but these errors were encountered: