curzel-it/pipper

[Question] Does it work with other apps?

Closed this issue · 5 comments

Is it possible to keep an arbitrary app always on top?
Or does it work only with webview?

Hi Filipe,
the "hovering" effect is achieved by setting the level property of the NSWindow, in Pipper it is set as follows (WindowManager.swift):
window.level = shouldHover ? .mainMenu : .normal

If you wanted to make window from other processes float (let's say Google Chrome or Xcode), you could theoretically do that by creating an NSWindow instance that points to the window of that process.
I'm still investigating the feasibility of this, if you have any ideas let me know!

Hi Filipe,
the "hovering" effect is achieved by setting the level property of the NSWindow, in Pipper it is set as follows (WindowManager.swift):
window.level = shouldHover ? .mainMenu : .normal

If you wanted to make window from other processes float (let's say Google Chrome or Xcode), you could theoretically do that by creating an NSWindow instance that points to the window of that process.
I'm still investigating the feasibility of this, if you have any ideas let me know!

Did you discover if it is feasible to make other processes float?

Unfortunately not :(
Best effort would be to use macOS accessibility API to move/set focus to a window given the id, but idk of any tool that does that!

It would be really useful to have any app to work with Pipper. One app that I know does this natively on Mac is when you take a screenshot using command+shift+4, then click on the screenshot in the bottom right, it opens the screenshot which will always stay on top. Not sure how they do it though

@w3ichen They are basically using the same system as Pipper does (setting/changing the window level).
Problem is an app can only change the level of its own windows (the OS itself might be able to, but, well, it's the OS!)

An alternative I was thinking about is to open a PR to DuckDuckGo or other open source browsers to add "pipper like behavior", but idk if they would consider this.
It would not solve the problem, but having the "floating" feature in a fully-fledged browser opens lots of possibilities