-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
allow layershell to support both docked and windowed applications #121
Comments
I think you can realize this feature by set the margin and anchor together. You can set anchor to empty and set the margin and size, make it show in the special position on the screen |
Okay great. I've been paying with that and it's working okay so far. I should be able to draw my own window decoration and drag it around by adjusting the margin according to mouse position, right? |
Decoration... I do not know.. seems the protocol of layershell does not have a field for window decoration.. so you mean client decoration right? Then it will be ok. Yes, it should be possible, by adjusting the margin, you can place the window anywhere. But according to the mouse poison.. seems there's no way to listen to the mouse position move event in the Wayland protocol.. I see, you mean drag the window. If subscribing to the event of iced, you should get the movement of the mouse, then it will be possible I think |
Thanks. Yes client side decorations. I'll close this as I'm thinking it should work from my tests so far |
Hi, Im re-opening this as im stuck. How can i find the layershell settings from within my app? I need access to the layershell settings so i can check the current margin, and the current anchor. From there I can then move the application.... https://docs.rs/iced_layershell/latest/iced_layershell/settings/struct.LayerShellSettings.html |
Emm.. You mean you need to get the status from the application.. now I do not store any layershell settings in the application, so there is no way to get the current one. Maybe you can save the status before you set it? |
So I need to add my own run() function.. And store a reference to the settings? |
What do you mean? I think you can return the message to set the margin and anchor, that time you can remember the margin and anchor. You can read the examples. I think you can take these as example |
Oh yes I understand what you mean. Okay 👌 ill try that |
ok ive got it half working. Its got some issues. The problem seems to be that the margin task has some kind of delay. When the margin is updated the window jumps back to an older position. This change causes the mouse cursor to register a different position. So the only way around this i can see is to subscribe to the margin change and hopefully reset the movement code from there?
fn subscription(&self) -> Subscription<Self::Message> {
event::listen()
.map(MainMessage::IcedEvent)
.map(MainMessage::MarginChange(())) // <- doesnt work
} |
It will never send the margin change event.. iced cannot resend custom event currently.. maybe you can use time to control the sending frequency, and wait for the wm to finish the margin change. |
Okay, that's an option I can try. I don't think it will work actually. I need to know when the margin has changed and the window redrawn, so I can start the mouse position calculation again. Any delay to that and it will be janky. I've filled a bug with iced here: iced-rs/iced#2773 |
I'm working on a virtual keyboard with some unusual features. Is there a way to support both the 'docked' style keyboard (what i have currently) and also a 'windowed' style version from the same app? Id like to add a switch in the settings the user can flip to a windowed version and back.
my main file is here.
https://github.com/bit-shift-io/surfboard/blob/main/src/main.rs
Ive tried setting it as a standard iced Application for window, but that means i need to duplicate my modules as the imports are completely different.... And i want it to stay on top....
The text was updated successfully, but these errors were encountered: