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

[Feature request] Add support for matching windowTypes #20

Open
crnisamuraj opened this issue Aug 20, 2021 · 3 comments
Open

[Feature request] Add support for matching windowTypes #20

crnisamuraj opened this issue Aug 20, 2021 · 3 comments

Comments

@crnisamuraj
Copy link

Please add support for matching by windowType property. That way we could blur popup_menu and context_menu type windows which would be useful and helpful. As i can see from the main file, mach is being done only against className (WM_CLASSNAME propery).

@crnisamuraj
Copy link
Author

crnisamuraj commented Aug 20, 2021

Looking at the script (https://github.com/esjeon/kwin-forceblur/blob/master/contents/ui/main.qml) i found out that you use 'client.resourceClass' property provided by Kwin API (https://develop.kde.org/docs/plasma/kwin/api/) I also found that Kwin API provides 'int windowType' which could be used to match window by windowType (defined by wm-specs https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html).
Not sure if anyone can confirm.

That way context menu/popup menu of gtk apps like firefox could be blurred when transparent. Even other types of windows could be blurred.

@crnisamuraj
Copy link
Author

crnisamuraj commented Aug 20, 2021

Tried editing onClientAdded function. Modified version below.
I tried adding windowType and windowRole propertios to match against, and adding new lines in congfig
config

popupMenu
menu
dropdownMenu
_NET_WM_WINDOW_TYPE_POPUP_MENU
11
PopupMenu

function:

    function onClientAdded(client) {
        if (!shell) return;

        var type = client.windowType.toString();
        var role = client.windowRole.toString().tiLowerCase();
        var cls = client.resourceClass.toString().toLowerCase();
        var name = client.resourceName.toString().toLowerCase();
        var clsMatches = root.patterns.indexOf(cls) >= 0 || root.patterns.indexOf(name) >= 0 || root.patterns.indexOf(type) >= 0 || root.patterns.indexOf(role);

        if (clsMatches == root.blurMatching) {
            if (root.blurContent) {
                registerHintUpdater(client);
            } else {
                var wid = "0x" + client.windowId.toString(16);
                shell.run("xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id " + wid);
            }
        }
    }

but did not manage to get desired effect. I may be doing something wrong as I have 0 experience with QML and KWin scripting

@ScanuNicco
Copy link

+1 for matching windowTypes. I have a custom firefox theme with transparent right-click menus and a bit of blur would make them look super nice.

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