elParaguayo / qtile-extras

Somewhere to store things I create for qtile that probably won't end up in the official repo
MIT License
163 stars 19 forks source link

Trouble keeping popups above other windows #344

Open researcher2312 opened 3 months ago

researcher2312 commented 3 months ago

I create a popup and add it as an object to my top bar. Then I hide and show it when needed. But regardless of moving it to top and keeping above other windows it is hidden below windows which were opened after the popup was created. Is it possible to have the popup be always on top of other windows without killing it and creating again each time?

class VolumePopup(PopupGridLayout):
    def __init__(self, qtile):
        self.is_visible = False
        super().__init__(qtile, ....)

@lazy.function
def show_popup(qtile):
    bar = qtile.screens[0].top
    if bar.popup == None:
        bar.popup = VolumePopup(qtile)
    popup = bar.popup
    if popup.is_visible:
        popup.is_visible = False
        popup.hide()
    else:
        popup.is_visible = True
        popup.show(relative_to=3, relative_to_bar=True, x=-3, y=5)
        popup.popup.win.keep_above(True)
        popup.popup.win.move_to_top()
        popup.update_controls(volume=bar.get_volume())
elParaguayo commented 3 months ago

Are you on Wayland or X11?

The popup code was created before we added layer support so I should probably add some code to make this easier to do.

researcher2312 commented 3 months ago

This is on X11 version 21.1.11 Ubuntu 24.04