Skip to content

example: prevent focus stealing in headful mode on KDE plasma #343

@milahu

Description

@milahu

recently, my scraper in headless mode is being blocked by cloudflare
(http status 403 with title Just a moment...)
so now im running my scraper in headful mode

this brought back an old problem: focus stealing

when creating new tabs, or when switching between tabs
the chromium window is grabbing focus
so when i work with some GUI app at the same time
my work is constantly interrupted

moving the chromium window to a different desktop
does not work anymore

i fixed this problem in milahu/aiohttp_chromium@2c2cfb2
by adding a new rule to ~/.config/kwinrulesrc
and reloading the rules with qdbus org.kde.KWin /KWin reconfigure

this solution is complex enough to make it worth sharing

related: KDE docs: Focus stealing prevention

todo: implement this for other window managers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions