Skip to content

Conversation

@PaideiaDilemma
Copy link
Contributor

@PaideiaDilemma PaideiaDilemma commented Oct 17, 2025

This is a first proposal for session-lock in hyprtoolkit.

It is intended for hyprlock to be implemented on top of it.

This version here has almost everything that should be needed.

TODOS:

  • resolve the FIXME tags (handling of finished event, dispatch of outputAdded)
  • button clicks are not working

@PaideiaDilemma
Copy link
Contributor Author

PaideiaDilemma commented Oct 18, 2025

  • user needs to be aware of the finished event

@PaideiaDilemma
Copy link
Contributor Author

Ok so just to keep track of things, here are the problems I encountered when trying to implement hyprlocks password input field.
Rest of the widgets (Label, Background, Shape) are no problem.

  • hyprlock uses scissor to cut the fading dots. I can't replicate that with hyprtoolkit
  • CTextElement does have alpha in it's builder, but it doesn't seem to have an effect.
  • hyprlock will need to have it's own AnimationManager. We need to integrate that into the event loop so that it ticks for each frame. I don't think we can do this yet.
  • hyprlock currently has gradient support for password input field borders. I guess I will keep the code for that, but we would need to support gradients in CRectangleElement to get feature parity.

@vaxerski
Copy link
Member

vaxerski commented Oct 23, 2025

hyprlock uses scissor to cut the fading dots. I can't replicate that with hyprtoolkit

There is an element prop for that it's just not exposed. I'm fine with exposing it (containsChildren clipChildren or something liek that)

CTextElement does have alpha in it's builder, but it doesn't seem to have an effect.

Simple fix

hyprlock will need to have it's own AnimationManager. We need to integrate that into the event loop so that it ticks for each frame. I don't think we can do this yet.

Why not? You can add an event fd to the loop. See pwcenter it uses pw_loop's fd.

hyprlock currently has gradient support for password input field borders. I guess I will keep the code for that, but we would need to support gradients in CRectangleElement to get feature parity.

Yes, shaders have that feature already as I copied them from HL. Just needs an impl in the C++ part.

I'd say get session lock to work in this MR, we'll merge it, then deal with those four issues in subsequent MRs.

Is the lock part gtg?

@PaideiaDilemma
Copy link
Contributor Author

All of that sounds nice. Thanks!
I had a bit of a conniption with the eventloop. ofc we can add an fd for it.

Lock part needed the denied event. Now I think it would be gtg.

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xoxo

@PaideiaDilemma PaideiaDilemma force-pushed the main branch 3 times, most recently from 983e755 to 1715e15 Compare October 28, 2025 21:30
@PaideiaDilemma
Copy link
Contributor Author

I will ping for next review :)

@vaxerski
Copy link
Member

alr

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

virtual uint32_t handle() = 0;
virtual std::string port() = 0;
virtual std::string desc() = 0;
virtual uint32_t fps() = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is fps a uint32_t? shouldn't this be a) refresh() and b) refresh... in what? mHz I assume if uint32_t?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh wait I forgot that.

I still wanted to ask you about this.
I only need that to make the animation manager tick in sync with the refresh rate.
Is that the way we should do that?

Copy link
Member

@vaxerski vaxerski Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, tick on a .frame and throttle to max fps (cases with multiple surfaces)

might wanna add that "tick()" to the wl callback in IWaylandWindow


namespace Hyprtoolkit {
enum eSessionLockError : uint8_t {
PLATFORM_UNINTIALIZED,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOCK_ERROR_PLATFORM_UNINITIALIZED, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants