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.

Lock screens need to know when to exit without an unlock.
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


Hyprutils::Memory::CSharedPointer<CPalette> getPalette();

void unlockSession();
Copy link
Member

Choose a reason for hiding this comment

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

This kinda sucks. I'd rather you'd make some lock state controller.

ILockState that you can get from the backend if you have a lockscreen, and will return nullptr if you dont.

This would play nicely with making Lock Surfaces -> you can only make them once you obtain the lockstate.

std::expected<SP<ILockState>, eLockError> createSystemLock();

/*
Sent when the compositor denies us as the exclusive lock screen client.
*/
Hyprutils::Signal::CSignalT<> lockDenied;
Copy link
Member

Choose a reason for hiding this comment

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

this could be moved to the ILockState mentioned above


std::optional<WP<CWaylandOutput>> CWaylandPlatform::outputForHandle(uint32_t handle) {
for (const auto& o : m_outputs) {
if (o->m_id == handle) {
Copy link
Member

Choose a reason for hiding this comment

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

no {} max

return nullptr;
}

std::optional<WP<CWaylandOutput>> CWaylandPlatform::outputForHandle(uint32_t handle) {
Copy link
Member

Choose a reason for hiding this comment

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

optional WP makes no sense, just return nullptr on fail

std::optional<Hyprutils::Math::Vector2D> maxSize;
std::string title = "Hyprtoolkit App";
std::string class_ = "hyprtoolkit-app";
uint32_t prefferedOutputId;
Copy link
Member

Choose a reason for hiding this comment

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

who forgor to initialize a primitive

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