pop-os / libcosmic

WIP library for COSMIC applications
https://pop-os.github.io/libcosmic/cosmic/
Mozilla Public License 2.0
430 stars 41 forks source link

Issue with LayerSurface #264

Closed MalpenZibo closed 5 months ago

MalpenZibo commented 8 months ago

Hi, I'm not sure if this is the right place to open this kind of Issue.

I'm currently working on a StatusBar for hyprland. My project doesn't use libcosmic but I'm using your iced fork to get access to the wayland layer surface protocol. Recently I switched to the latest commit on master to get the multi-windows feature and now I have some issues.

The dimensions of some widgets seem not calculated correctly (for example some text is invisible), the child windows don't have this issue. The main window is a LayerSurface TOP with TOP | LEFT | RIGHT anchor and 34 px of height, and the child one is a LayerSurface Overlay with TOP | LEFT | RIGHT | BOTTOM anchor.

Screen before multiwindow Watershot_11-01-2024_15:14

Screen after multiwindow Watershot_11-01-2024_15:22

REALERvolker1 commented 5 months ago

I am actually doing the exact same thing as you! Just wondering, how did you manage to put windows on layers? I switched over to Iced from gtk for my frontend (backend is mostly complete), but I have been puzzled with this. Right now, no windows appear at all.

MalpenZibo commented 5 months ago

Currently, I have some issues: for example when I open and close multiple times a menu (aka other wayland layers from the main one) sometimes the entire app crashes with the following error:

wp_fractional_scale_manager_v1@3: error 0: Fractional scale exists.
Protocol error 0 on object wp_fractional_scale_manager_v1@3: 

Anyway, this problem is resolved. I'm using the main branch of the pop_os fork of iced and with the recent commit and with a fix in my code the text issue doesn't happen anymore.

If you want to check how I created the app here's the link: https://github.com/MalpenZibo/ashell/blob/iced-switch/src/main.rs#L80