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

Window focus function not recovered once Popup Toolkit close #192

Open
Crystal4276 opened this issue Nov 18, 2022 · 6 comments
Open

Window focus function not recovered once Popup Toolkit close #192

Crystal4276 opened this issue Nov 18, 2022 · 6 comments

Comments

@Crystal4276
Copy link

Crystal4276 commented Nov 18, 2022

The window sitting just underneath the Popup Toolkit cannot be focused directly after Popup Toolkit closes:

  • follow_mouse_focus=True doesn't work
  • even clicking on the window itself doesn't focus the window !

Here's a video illustration with two windows and a popuptoolkit

  • Opening of popup and autohide activated
  • Text editor windows sitting below remains unfocused (cf. transparency rule + cursor not blinking)
  • Clicking on the text editor do not focus either
  • pointer going to terminal window then coming back to the text editor reactivates the focus.
2022-11-18.10-39-15.mp4
@elParaguayo
Copy link
Owner

Can you share the code for your popup please?

This doesn't feel like it should be a qtile-extras issue as the popup is just a window and so should be managed by qtile like any other window.

@Crystal4276
Copy link
Author

Sure !

def show_power_menu(qtile):
    controls = [
        PopupImage(
            filename="~/.config/qtile/assets/lock.svg",
            pos_x=0,
            pos_y=0.02,
            width=1.0,
            height=0.15,
            highlight_method='image',
            highlight_filename="~/.config/qtile/assets/lock_blur.svg",
            mouse_callbacks={"Button1": lazy.spawn('betterlockscreen -l dim -- --time-str="%H:%M"')}
        ),
        PopupText(
            text="Lock",
            font='monospace Bold',
            fontsize=18,
            pos_x=0,
            pos_y=0.17,
            width=1,
            height=0.075,
            foreground=colors[15],
            h_align="center",
            can_focus=False,
            mouse_callbacks={"Button1": lazy.spawn('betterlockscreen -l dim -- --time-str="%H:%M"')}
        ),
        PopupImage(
            filename="~/.config/qtile/assets/logout.svg",
            pos_x=0.0,
            pos_y=0.27,
            width=1.0,
            height=0.15,
            highlight_method='image',
            highlight_filename="~/.config/qtile/assets/logout_blur.svg",
            mouse_callbacks={"Button1": lazy.shutdown()}
        ),
        PopupText(
            text="Logout",
            font='monospace Bold',
            fontsize=18,
            pos_x=0.0,
            pos_y=0.42,
            width=1.0,
            height=0.075,
            foreground=colors[10],
            h_align="center",
            can_focus=False,
            mouse_callbacks={"Button1": lazy.shutdown()}
        ),
        PopupImage(
            filename="~/.config/qtile/assets/restart.svg",
            pos_x=0.0,
            pos_y=0.52,
            width=1.0,
            height=0.15,
            highlight_method='image',
            highlight_filename="~/.config/qtile/assets/restart_blur.svg",
            mouse_callbacks={"Button1": lazy.spawn("systemctl reboot")}
        ),
        PopupText(
            text="Restart",
            font='monospace Bold',
            fontsize=18,
            pos_x=0,
            pos_y=0.67,
            width=1,
            height=0.075,
            foreground=colors[12],
            h_align="center",
            can_focus=False,
            mouse_callbacks={"Button1": lazy.spawn("systemctl reboot")}
        ),
        PopupImage(
            filename="~/.config/qtile/assets/shutdown.svg",
            pos_x=0,
            pos_y=0.77,
            width=1.0,
            height=0.15,
            highlight_method='image',
            highlight_filename="~/.config/qtile/assets/shutdown_blur.svg",
            mouse_callbacks={"Button1": lazy.spawn("systemctl poweroff")}
        ),
        PopupText(
            text="Shutdown",
            font='monospace Bold',
            fontsize=18,
            pos_x=0,
            pos_y=0.92,
            width=1,
            height=0.075,
            foreground=colors[13],
            h_align="center",
            can_focus=False,
            mouse_callbacks={"Button1": lazy.spawn("systemctl poweroff")}
        ),
    ]

    layout = PopupRelativeLayout(
        qtile,
        width=100,
        height=350,
        border_width=1,
        border=colors[6],
        controls=controls,
        background=colors[1],
        initial_focus=None,
        hide_interval=0.7,
        hide_on_mouse_leave=True
    )
    layout.show(x=-6, y=0.003, warp_pointer=False,relative_to=3,relative_to_bar=True)

@elParaguayo
Copy link
Owner

elParaguayo commented Nov 18, 2022

Thanks. I'm pretty confident this is a qtile issue as there have been some issues with focusing windows when others close.

No need to open a separate issue though.

@Crystal4276
Copy link
Author

I'm using picom as compositor. I found in the configuration file this part:

Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy,
provided that the WM supports it.
use-ewmh-active-win = true;

I didn't find any difference between true or false.
So i was wondering if qtile support this feature ?

@elParaguayo
Copy link
Owner

Not properly - see qtile/qtile#3910

@Crystal4276
Copy link
Author

Crystal4276 commented Nov 26, 2022

A bit more investigation on this.
It's not all the application windows that fail to get the focus back (below the popup)
For instance, chromium is ok.
But the text editor Geany is not.

Running xprop on both application i can see some difference notably with WM_PROTOCOLS(ATOM),
Chromium:
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, _NET_WM_PING, _NET_WM_SYNC_REQUEST
Geany:
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST

I'm wondering if the additional WM_TAKE_FOCUS for geany has something to do with this problem ?

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

No branches or pull requests

2 participants