sindresorhus / Plash

💦 Make any website your Mac desktop wallpaper

Home Page:https://sindresorhus.com/plash

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trigger window focus / blur on browsermode

simon-zk opened this issue · comments

Is your feature request related to a problem? Please describe.

Plash is awesome. You can use a hotkey anytime to switch to the browsermode and get that window in front of other apps. However, for someone like me, who is using it for writing, it lacks one little feature to make it perfect - trigger to for automatic Plash window (app) focus and blur.

Currently the javascript "onfocus" or "onblur" listeners doesn't work until you click somewhere on that Plash window. So if you are writing something on Plash and you are currently have Chrome open, you could just do the hotkey and start writing into your Plash page immediately - however, it still requires you to focus that Plash window (unless you haven't focused another window after focusing Plash).

Describe the solution you'd like

It's simple - just trigger the Plash window focus or blur when switched to/from the browsermode. Maybe at least the hotkey could trigger the app window focus / blur? I don't think it's needed to have that focus when toggling browsermode from the Plash menu.

Describe alternatives you've considered

Using something like Alfred, to create another hotkey to toggle Plash browsermode from terminal/hotkey and then deliver a mouse click via AppleScripts. Then just simply using the hotkey created on Alfred - it does the job. However it includes 3d apps and it's hard to use for blurring the Plash window and refocusing the window used before, after switching back from the Plash browsingmode.

Additional context

Thank you @sindresorhus for creating this and other awesome apps. You are doing a great job! 😍

What about focusing the Plash app window or the previous window when key is pressed?

https://github.com/sindresorhus/Plash/blob/011c22e977e53f921416a838cce0326a21dff066/Plash/Events.swift#LL122C38-L122C38