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

Clients that exist on multiple tags are sometimes incorrectly displayed in the tag_preview widget #94

Open
gritting opened this issue Aug 19, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@gritting
Copy link

Problem Overview

If you view the tag_preview for a tag that contains client(s) on multiple tags, the tag_preview doesn't show correctly in some cases.

Demos

At 0:00, tag 1 has discord and watch nvidia-smi and tag 2 has cava and zsh. Everything works as expected at this point.
At 0:08, I add watch nvidia-smi to tag 2 (so it is on tag 1 and 2)
At 0:14, while on tag 2, I show that tag 2's tag_preview is correctly displayed. If the tag currently being viewed is the one you're attempting to view the tag_preview for (or was the last viewed tag which contains client(s) with multiple tags) then it displays correctly. (So hypothetically, if I were to switch to tag 3 at this point, tag 2's tag_preview would still display correctly.)
At 0:15, while still on tag 2, tag 1's watch nvidia-smi is completely missing from tag 1's tag_preview
At 0:19, I switch to tag 1, and show that tag 1's tag_preview is correct while viewing tag 1
At 0:21, while still on tag 1, I show that tag 2's tag_preview shows the content for watch nvidia-smi in the wrong place, obscuring the other clients in the tag_preview

tag_preview_weirdness.mp4

Unlike the example above, if the geometry and position of the client is exactly the same between its tags, it shows correctly in all tag_previews. You can see here, watch nvidia-smi is tiled on the left of tag 1 and 2, and displayed on the left side of both tag 1 and tag 2's tag_preview, as expected:

tag_preview_with_client_in_same_position.mp4

Another more severe example, with more clients. In this case, zenmonitor is the client on tags 4 and 7. You can see when on tag 4, viewing the tag_preview for tag 7, there is content from chromium, despite chromium not even being on tag 4 or 7, and content from zenmonitor is missing. The tag_preview is completely mangled too. Same problem when on tag 7 and viewing tag_preview for tag 4, the tag_preview is completely mangled:

tag_preview_example_2.mp4

Relevant configuration

The widget

bling.widget.tag_preview.enable {
    show_client_content = true,
    x = beautiful.useless_gap*2,
    y = beautiful.useless_gap*2 + beautiful.wibar_height,
    scale = 0.15,
    honor_padding = true,
    honor_workarea = false
}

The taglist is created with appropriate create_callback signals to show/hide the widget, all bog standard stuff

s.mytaglist = awful.widget.taglist {
        screen = s,
        filter = awful.widget.taglist.filter.noempty,
        buttons = taglist_buttons,
        style = { shape = function(cr,w,h) gears.shape.rounded_rect(cr,w,h,dpi(10)) end },
        widget_template = {
            id = "background_role",
            widget = wibox.container.background,
            forced_height = dpi(32),
            forced_width = dpi(32),
            {
                id = "text_role",
                align = "center",
                forced_width = dpi(32),
                forced_height = dpi(32),
                widget = wibox.widget.textbox
            },
            create_callback = function(self, c3, index, objects)
                self:connect_signal('mouse::enter', function()
                    local w = mouse.current_wibox
                    if w or old_taglist_entry then
                        taglist_cursor, old_taglist_entry = w.cursor, w
                        w.cursor = "hand2"
                    end
                    awesome.emit_signal("bling::tag_preview::update", c3)
                    awesome.emit_signal("bling::tag_preview::visibility", c3.screen, true)            
                end)

                self:connect_signal('button::press', function()
                    awesome.emit_signal("bling::tag_preview::visibility", c3.screen, false)
                end)

                self:connect_signal('mouse::leave', function()
                    if old_taglist_entry then
                        old_taglist_entry.cursor = taglist_cursor
                        old_taglist_entry = nil
                    end
                    awesome.emit_signal("bling::tag_preview::visibility", c3.screen, false)
                end)
            end
        }
    }
@javacafe01 javacafe01 added the bug Something isn't working label Aug 19, 2021
@javacafe01
Copy link
Member

Thanks a lot for this bug report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants