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

Can I use this to display a website as my desktop. #7

Open
vviikk opened this issue Feb 8, 2021 · 7 comments
Open

Can I use this to display a website as my desktop. #7

vviikk opened this issue Feb 8, 2021 · 7 comments
Labels

Comments

@vviikk
Copy link

vviikk commented Feb 8, 2021

i.e. use case, I would like to run this at the back of all windows? i.e. just above the desktop?

If it's a simple change could you point me in the right direction?

@anko
Copy link
Owner

anko commented Feb 9, 2021

It's doable, but tricky. Braindump:

While GTK has a "keep above" flag (that I'm using here), it has no "keep below" flag, because exactly how to distinguish the set of windows that are part of "the desktop" is not standardised in the full cross-platform context that GTK tries to cover.

On Linux specifically, the EWMH standard specifies a _NET_WM_STATE_BELOW state, intended for windows that are overlaid on the desktop below other windows. So while GTK doesn't expose that underlying (ha ha) functionality, on Linux you could get an X11 handle on the GTK window (gdk_x11_drawable_get_xid) and set that state on it, to make it behave this way in all sane desktop environments.

Or if you wanted to stay at GTK-ish-level, you could use libwnck, and subscribe to the window-stacking-changed event. Whenever anything changes, call wnck_screen_get_windows_stacked and decide on which window is the first one above "the desktop" (you'll have to decide where and how to draw that line), then call gtk_window_set_keep_below on that to make the hudkit window unable to be raised above it.

If you just want to do this for a "carboard + hot glue" prototype to see if the above effort makes sense, the simplest way to do this might be to delete the line that sets the "keep above" flag, recompile, and start hudkit on startup. That puts the window just above the desktop, and because the window has override-redirect set, window managers shouldn't raise it when clicked, so any windows that are created after it will always be on top of it. This will definitely break in edge cases though, (e.g. if you restart hudkit, or restart the WM without quitting X, or in WMs that misinterpret "override-redirect" as meaning "this is a right-click context menu; put it on top", etc.).


I'd like to add this functionality at some point. If you hack it up before I do, PR appreciated! ✨

@anko
Copy link
Owner

anko commented Feb 9, 2021

Related, but maybe not quite what you're asking about: Xwinwrap lets you make whatever window your desktop background. I think the way it works is by parenting it onto the root window.

@vviikk
Copy link
Author

vviikk commented Feb 10, 2021

WOWWOW. I like it when a dev is as supportive as this. And will try to use Xwinwrap but will also see if I can play about with your code. Ya see, the reason why I ask this is Gnome shell doesn't allow different wallpapers for different workspaces and there are extensions that change the wallpapaer when you change workspaces. The issue here is that it's a fade animation while the windows 'slide'. It's a weird effect. So I was wondering if I could use an app, that only stays as the bottom of the stack and does nothing but display an image. Maybe I'm reaching out in the wrong direction.

EDIT: Seems like Xwinwrap might be having some issues with Gnome but will test it later after office hours :)
mmhobi7/xwinwrap#5

@anko
Copy link
Owner

anko commented Feb 10, 2021

It definitely sounds to me like Xwinwrap or similar is the right tool for that. Hudkit does transparency and overlays, but for a background, you would need neither.

@elimisteve
Copy link

elimisteve commented Apr 26, 2021

@anko Very cool tool! We need more things like this; I'm glad you're thinking outside the box, which is so rare.

@vviikk Consider checking out https://github.com/progrium/topframe , too 🙂 . Jeff Lindsay (progrium) also thinks big and finds simple ways of doing amazing things; he invented WebHooks, dokku, and more.

@anko
Copy link
Owner

anko commented Apr 26, 2021

Consider checking out progrium/topframe

Thanks for link, I didn't know this existed. I said hi, and added a readme link.

@elimisteve
Copy link

@anko Great! Thank you.

@anko anko added the question label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants