this post was submitted on 21 Sep 2024
25 points (100.0% liked)

Rust

5989 readers
27 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

[email protected]

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS
 

Hi. I've been learning Rust for a while, and I want to take on an actual project now to learn even more. I need to be pointed in the right direction for one aspect of the affair, and I hope someone here can help me.

I want to create a deck tracker for Hearthstone that runs natively in Linux. This is, on the back end, a fairly simple matter of parsing a constantly updated file that tracks everything that happens in the game. On the front end, however, I want to create a window that sits on top of the fullscreen Hearthstone window and shows me stuff. The "stuff" doesn't have to be images or anything fancy, I'll take whatever I can get, but I don't know how to get started on this part.

So the task is as follows: Create an overlay on top of the fullscreen Hearthstone client, preferably under Wayland, and update it constantly with new information about cards drawn, cards left in deck, that sort of thing.

How do I tackle this problem? Are there any crates that'll let me create such a window and render stuff to it? How would you approach the problem?

Thanks in advance.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 1 month ago (2 children)

Maybe someone can correct me if I'm wrong, but doesn't Wayland's security model intentionally prevent this type of "tampering" with another application's display?

[–] [email protected] 1 points 1 month ago

OP here. Thanks for your reply. If what you're asking is the case, I'd be happy to find a solution that runs under X instead. This tracker would in any case mostly be for my own use. I was just excited to finally get Wayland working with my NVIDIA card with the explicit sync stuff.

[–] [email protected] 1 points 1 month ago

It doesn't by default and design, but that doesn't mean it can't be implemented through a special protocol or compositor plugin.

This also protects against windows, not processes of the same user. You can bypass the problem by simply wrapping the game and your overlay in a nested compositor like gamescope. From there you control the compositor, so you can do whatever you want.

And it's still secure because it only lets you overlay over stuff from your own Wayland clients spawned by your overlay wrapper, none of the user's other windows, so you can still trust your password manager and such.