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

Blacklist based on window titles #16

Merged
merged 3 commits into from
Jun 17, 2023
Merged

Blacklist based on window titles #16

merged 3 commits into from
Jun 17, 2023

Conversation

Daxtorim
Copy link
Contributor

This allows users to stop windows from getting tiled based on the window title (client.caption).

image

Once again, no clue why QT Designer completely rewrites config.ui

@zeroxoneafour
Copy link
Owner

Would it be possible to add an invert feature to the titles setting to whitelist windows by title?

@zeroxoneafour
Copy link
Owner

Never mind, I don't really know how exclusion would work with two whitelists. I may add support for this later. Code looks good, thank you!

@zeroxoneafour zeroxoneafour merged commit 1fda140 into zeroxoneafour:master Jun 17, 2023
@Daxtorim
Copy link
Contributor Author

I don't really know how exclusion would work with two whitelists.

Yeah, I struggled with that one as well for a while which is why I didn't include anything here. But we may have been overthinking this.

Literally just

--- a/src/util.ts
+++ b/src/util.ts
@@ -62,7 +62,7 @@ export function doTileClient(client: KWin.AbstractClient): boolean {
     for (const i of config.filterClientCaption) {
         if (i !== "" && cap.includes(i)) {
             filterProcessCache.add(cap);
-            return false
+            return config.useCaptionWhitelist;
         }
     }

If the filter is configured with an explicit window title we act accordingly when encountering it, but take no action when any other title is checked. So when you are whitelisting "Title-1" and you encounter "Title-a" you don't block "Title-a", you just ignore it there and go on to check for process name. And if the process name is not blacklisted the window gets tiled despite the title not matching.

So instead of the title filter being a "yes/no" question it becomes a "yes/maybe" question and in case of a maybe we let the process filter decide. You get two options "Never tile" and "Always tile" based on window title and any title not configured for either options just gets passed on to the process filter to make a call.

Does that make any sense? I'm gonna see if I can make something up that better conveys what I mean.

@zeroxoneafour
Copy link
Owner

Yeah, the way they work together brings up a lot of confusion if they both have inverses. If one inverse is checked but not the other, which will overrule the other? Will the engine assume to tile or not to tile? A future, more simple solution would be to put a single global inverse, but it's probably fine for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants