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

Add a portal to see currently open windows #304

Open
johan-bjareholt opened this Issue Feb 22, 2019 · 7 comments

Comments

Projects
None yet
3 participants
@johan-bjareholt
Copy link

johan-bjareholt commented Feb 22, 2019

I am a maintainer of the ActivityWatch project and we are polling the currently focused windows name and title. This is not an issue under Xorg but on Wayland this is a problem as there is no common API between compositors. I have discussed this shortly with both a wlroots and Gnome developer and they both seem to agree that exposing such data would be best solved by adding a xdg-desktop-portal API for this.

Wlroots and KWin already have APIs for this (gnome-shell too but it's disabled by default) but they are all different, so a xdg-desktop-portal API would significantly simplify things.

Suggestions on properties for windows, methods and signals that would be good to have:

Window properties:

  • app_id (string)
  • title (string)
  • focused (bool)

Signals:

  • FocusedApplicationChanged
  • RunningApplicationsChanged

Methods:

  • GetRunningApplications (array of windows)

Links to prior discussions with Gnome and wlroots developers:

@TingPing

This comment has been minimized.

Copy link
Member

TingPing commented Feb 22, 2019

It sounds very niche. What other applications would use this portal?

I know Discord is a common complaint that it can't see other apps, but since its proprietary somebody would have to convince them to use this anyway.

@johan-bjareholt

This comment has been minimized.

Copy link
Author

johan-bjareholt commented Feb 22, 2019

Discord is another example, but another use-case would be for panels which can support multiple compositors (maybe not a good use-case for flatpak, but a use-case non the less). There are also competitors to ActivityWatch which are not open source (most notably RescueTime) which would have the same use-case as us.

I guess it's kind of niche, but not extremely niche. Sooner or later some API like this would be needed for wayland and to me it seems like xdg-desktop-portal is the best fit.

@matthiasclasen

This comment has been minimized.

Copy link
Contributor

matthiasclasen commented Feb 23, 2019

This is not the kind of information we would normally want to leak into sandboxes, I think.

@johan-bjareholt

This comment has been minimized.

Copy link
Author

johan-bjareholt commented Feb 23, 2019

@matthiasclasen Neither should screenshots by default as that contains the same information and more, but you need to explicitly allow permissions for that right?

@matthiasclasen

This comment has been minimized.

Copy link
Contributor

matthiasclasen commented Feb 23, 2019

A screenshot is an explicit operation. You take a screenshot of an individual window, present the result to the user, and ask him: "share this with "SpyApp deluxe" ?"

What you are asking for is hard to present to the user in a meaningful form.

@johan-bjareholt

This comment has been minimized.

Copy link
Author

johan-bjareholt commented Feb 24, 2019

Why wouldn't it be possible to do the same with this? Show a prompt containin "SpyApp is requesting access for information about all your running applications" and give the user the ability to allow or deny the request. By default this request should probably only be valid for the current session but it would also be nice with a checkbox to remember this for future sessions as well.

This is how it is handled in macOS and I wish it was the same on Linux. However, on macOS if you allow it once it will allow it until you go into the settings and revoke the permissions, only allowing it for the current session by default seems more sane IMO. But that's just a small detail.

@TingPing

This comment has been minimized.

Copy link
Member

TingPing commented Feb 24, 2019

It can certainly be done. A goal of portals has been not to pester users with yes/no questions like that though but rather be tied to specific actions that make logical sense to cancel like choosing a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.