Skip to content
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

1.10 rebase #367

Merged
merged 105 commits into from
Feb 16, 2025
Merged

1.10 rebase #367

merged 105 commits into from
Feb 16, 2025

Conversation

WillPower3309
Copy link
Owner

@WillPower3309 WillPower3309 commented Nov 29, 2024

To do:

  • update readme to remove the effects we no longer support (sorry saturation)
  • add back blur
  • add back blur effects
  • add back blur xray (and optimized blur)
  • add back shadows
  • add back rounded corners
  • add back rounded borders
  • rounded titlebars (including stacked layouts)
    • add proper clipping for title marks / text
  • layershell effects
  • dimming
  • titlebar separator
    • Initial logic
    • Tabbed bugs
  • scratchpad as minimize
  • smart corner radius
  • ensure sway.5.scd has all the proper documentation added back
  • IPC (?)
  • [ ] Update config.in with examples
    • unrelated to the rebase, can be done as follow-up
  • Fix titlebar text buffer using rounded corners
  • Ensure everything works on rotated outputs
  • Tiling indicator blur
  • Update existing containers when a command is ran (for example reload config with corner radius change should update existing containers)

@WillPower3309 WillPower3309 marked this pull request as draft November 29, 2024 22:32
@rudrabhoj
Copy link

Hey any eta on this? This will really go long way in making it usable for nvidia cards.

@WillPower3309
Copy link
Owner Author

recent commit in this branch breaks things,

Thread 1 "sway" received signal SIGSEGV, Segmentation fault.
create_buffer (format=0x10, height=720, width=1280, alloc=0x10069b0) at ../subprojects/wlroots/render/allocator/gbm.c:95
95		assert(format->len > 0);
(gdb) backtrace 
#0  create_buffer (format=0x10, height=720, width=1280, alloc=0x10069b0) at ../subprojects/wlroots/render/allocator/gbm.c:95
#1  allocator_create_buffer (wlr_alloc=0x10069b0, width=1280, height=720, format=0x10) at ../subprojects/wlroots/render/allocator/gbm.c:242
#2  0x00007ffff7ec6236 in wlr_allocator_create_buffer (alloc=alloc@entry=0x10069b0, width=width@entry=1280, height=height@entry=720, format=format@entry=0x10)
    at ../subprojects/wlroots/render/allocator/allocator.c:171
#3  0x00007ffff7fa78b7 in fx_framebuffer_get_or_create_custom (renderer=renderer@entry=0x7de7c0, output=output@entry=0x11ccce0, fx_framebuffer=fx_framebuffer@entry=0x11cd3e8)
    at ../subprojects/scenefx/render/fx_renderer/fx_framebuffer.c:80
#4  0x00007ffff7fa7344 in fx_renderer_begin_buffer_pass (wlr_renderer=<optimized out>, wlr_buffer=wlr_buffer@entry=0x11e9e30, output=output@entry=0x11ccce0, 
    options=options@entry=0x7ffffffe8260) at ../subprojects/scenefx/render/fx_renderer/fx_pass.c:1080
#5  0x00007ffff7fad968 in wlr_scene_output_build_state (scene_output=0x11cd260, state=state@entry=0x11c9878, options=options@entry=0x7ffffffe8530)
    at ../subprojects/scenefx/types/scene/wlr_scene.c:2425
#6  0x00000000004377fe in apply_resolved_output_configs (degrade_to_off=true, test_only=false, configs_len=1, configs=0x11dffa0) at ../sway/config/output.c:914
#7  apply_output_configs (ocs=<optimized out>, ocs_len=<optimized out>, test_only=test_only@entry=false, degrade_to_off=degrade_to_off@entry=true) at ../sway/config/output.c:990
#8  0x0000000000437ec5 in apply_stored_output_configs () at ../sway/config/output.c:1000
#9  0x00000000004223b4 in timer_modeset_handle (data=0x4854a0 <server>) at ../sway/desktop/output.c:417
#10 0x00007ffff77b6eaf in wl_event_loop_dispatch () from /nix/store/cdnwvy5zyh6la8x1cal00xmvsj8x3dai-wayland-1.23.1/lib/libwayland-server.so.0
#11 0x00007ffff77b45d5 in wl_display_run () from /nix/store/cdnwvy5zyh6la8x1cal00xmvsj8x3dai-wayland-1.23.1/lib/libwayland-server.so.0
#12 0x000000000041fd41 in server_run (server=server@entry=0x4854a0 <server>) at ../sway/server.c:501
#13 0x000000000041ea72 in main (argc=<optimized out>, argv=0x7ffffffe89a8) at ../sway/main.c:373

@WillPower3309
Copy link
Owner Author

Hey any eta on this? This will really go long way in making it usable for nvidia cards.

not really. Should be pretty quick, definitely done by end of the month

@WillPower3309
Copy link
Owner Author

WillPower3309 commented Dec 7, 2024

looks like the issue is higher up, we're passing a NULL swapchain in fx_framebuffer_get_or_create_custom. the swapchain we use in wlr_scene_output_build_state is valid, but it seems like the output's swapchain is not initialized at that point, as it tries to use the output's swapchain in fx_framebuffer_get_or_create_custom

@WillPower3309
Copy link
Owner Author

looks like the issue is higher up, we're passing a NULL swapchain in fx_framebuffer_get_or_create_custom. the swapchain we use in wlr_scene_output_build_state is valid, but it seems like the output's swapchain is not initialized at that point, as it tries to use the output's swapchain in fx_framebuffer_get_or_create_custom

fixed by wlrfx/scenefx@7b21851

@WillPower3309
Copy link
Owner Author

woohoo, rendering is working! We just need to add back the effects now. Should mostly be copy+paste :)

@MRSS02
Copy link

MRSS02 commented Dec 17, 2024

why will saturation no longer be supported on this new version?

@WillPower3309 WillPower3309 linked an issue Dec 26, 2024 that may be closed by this pull request
@WillPower3309
Copy link
Owner Author

why will saturation no longer be supported on this new version?

it isn't really supported on the current version. It was sort of a hack - and will be better replaced with display profiles

@WillPower3309
Copy link
Owner Author

I tried this branch and found that background and bar and rofi are not working.
journalctl -xe
2025-02-09 21:12:01 - [swaybg/main.c:332] Found config HDMI-A-2 for output HDMI-A-2 (LG Electronics LG IPS FULLHD 0x01010101)
00:17:40.274 [ERROR] [sway/desktop/layer_shell.c:248] Failed to allocate a shadow node 00:17:40.274 [ERROR] [sway/desktop/layer_shell.c:559] Could not allocate a sway_layer_surface 2025-02-09 21:12:01 - [swaybg/main.c:251] Destroying output HDMI-A-2 (LG Electronics LG IPS FULLHD 0x01010101)

Are you running scenefx-git?

Yes

mind sharing your config? I'd assume this is with layer effects

@mojahed-yavazi
Copy link

I tried this branch and found that background and bar and rofi are not working.
journalctl -xe
2025-02-09 21:12:01 - [swaybg/main.c:332] Found config HDMI-A-2 for output HDMI-A-2 (LG Electronics LG IPS FULLHD 0x01010101)
00:17:40.274 [ERROR] [sway/desktop/layer_shell.c:248] Failed to allocate a shadow node 00:17:40.274 [ERROR] [sway/desktop/layer_shell.c:559] Could not allocate a sway_layer_surface 2025-02-09 21:12:01 - [swaybg/main.c:251] Destroying output HDMI-A-2 (LG Electronics LG IPS FULLHD 0x01010101)

Are you running scenefx-git?

Yes

mind sharing your config? I'd assume this is with layer effects

I tried the default configuration /etc/sway/config but it made no difference.

@WillPower3309
Copy link
Owner Author

That's a bit alarming as I haven't been able to reproduce at all 😬

@ErikReider
Copy link
Collaborator

That's a bit alarming as I haven't been able to reproduce at all 😬

Neither can I… Running this right now through a tty with no issues…

@mojahed-yavazi please make sure to uninstall any scenefx you might already have installed and make sure that it's using the scenefx subproject.

@WillPower3309 Maybe we should also log the scenefx version and hash to make our lives a bit easier

@WillPower3309
Copy link
Owner Author

That's a bit alarming as I haven't been able to reproduce at all 😬

Neither can I… Running this right now through a tty with no issues…

@mojahed-yavazi please make sure to uninstall any scenefx you might already have installed and make sure that it's using the scenefx subproject.

@WillPower3309 Maybe we should also log the scenefx version and hash to make our lives a bit easier

Yeah could be a good idea for stuff like this.

Although I'd think the allocation methods would've been unchanged for at least a couple months now

@mojahed-yavazi
Copy link

That's a bit alarming as I haven't been able to reproduce at all 😬

Neither can I… Running this right now through a tty with no issues…
@mojahed-yavazi please make sure to uninstall any scenefx you might already have installed and make sure that it's using the scenefx subproject.
@WillPower3309 Maybe we should also log the scenefx version and hash to make our lives a bit easier

Yeah could be a good idea for stuff like this.

Although I'd think the allocation methods would've been unchanged for at least a couple months now

I tried previous commits. This problem occurs exactly after 80a8d7e

@ErikReider
Copy link
Collaborator

ErikReider commented Feb 10, 2025

That's a bit alarming as I haven't been able to reproduce at all 😬

Neither can I… Running this right now through a tty with no issues…
@mojahed-yavazi please make sure to uninstall any scenefx you might already have installed and make sure that it's using the scenefx subproject.
@WillPower3309 Maybe we should also log the scenefx version and hash to make our lives a bit easier

Yeah could be a good idea for stuff like this.
Although I'd think the allocation methods would've been unchanged for at least a couple months now

I tried previous commits. This problem occurs exactly after 80a8d7e

So after looking at the code, the only reason the shadow would fail allocation would be if either the system is out of memory, or if the parent tree the shadow attaches to is NULL. We check for this case, so that's a no. Another weirder case could be the failed variable not being initialized to false? I'll fix that, and let us know if that fixes it

@mojahed-yavazi
Copy link

That's a bit alarming as I haven't been able to reproduce at all 😬

Neither can I… Running this right now through a tty with no issues…
@mojahed-yavazi please make sure to uninstall any scenefx you might already have installed and make sure that it's using the scenefx subproject.
@WillPower3309 Maybe we should also log the scenefx version and hash to make our lives a bit easier

Yeah could be a good idea for stuff like this.
Although I'd think the allocation methods would've been unchanged for at least a couple months now

I tried previous commits. This problem occurs exactly after 80a8d7e

So after looking at the code, the only reason the shadow would fail allocation would be if either the system is out of memory, or if the parent tree the shadow attaches to is NULL. We check for this case, so that's a no. Another weirder case could be the failed variable not being initialized to false? I'll fix that, and let us know if that fixes it

Yes!, everything is working fine now.

@linavixx
Copy link

Having issues with applying effects to swaybar (panel layer). When I reload sway, they apply and instantly disappear. Am I the only one with this problem?

@WillPower3309
Copy link
Owner Author

Having issues with applying effects to swaybar (panel layer). When I reload sway, they apply and instantly disappear. Am I the only one with this problem?

Is this only on reload? If you were to set them and then relaunch swayfx, do they work?

@linavixx
Copy link

Having issues with applying effects to swaybar (panel layer). When I reload sway, they apply and instantly disappear. Am I the only one with this problem?

Is this only on reload? If you were to set them and then relaunch swayfx, do they work?

Nope, same behavior on restart.
Tried with blur and corner rounding, no differences

@ErikReider
Copy link
Collaborator

Having issues with applying effects to swaybar (panel layer). When I reload sway, they apply and instantly disappear. Am I the only one with this problem?

Is this only on reload? If you were to set them and then relaunch swayfx, do they work?

Nope, same behavior on restart. Tried with blur and corner rounding, no differences

Should be fixed now, didn't realize that swaybay uses the bottom layer

@ErikReider
Copy link
Collaborator

Having issues with applying effects to swaybar (panel layer). When I reload sway, they apply and instantly disappear. Am I the only one with this problem?

Is this only on reload? If you were to set them and then relaunch swayfx, do they work?

Nope, same behavior on restart. Tried with blur and corner rounding, no differences

Should be fixed now, didn't realize that swaybay uses the bottom layer

Maybe we should reposition the optimized blur to be just above the background layer instead of capturing both bottom and background. Capturing both could lead to a performance penalty if swaybar updates every second. Any thoughs?

@WillPower3309
Copy link
Owner Author

WillPower3309 commented Feb 11, 2025

Having issues with applying effects to swaybar (panel layer). When I reload sway, they apply and instantly disappear. Am I the only one with this problem?

Is this only on reload? If you were to set them and then relaunch swayfx, do they work?

Nope, same behavior on restart. Tried with blur and corner rounding, no differences

Should be fixed now, didn't realize that swaybay uses the bottom layer

Maybe we should reposition the optimized blur to be just above the background layer instead of capturing both bottom and background. Capturing both could lead to a performance penalty if swaybar updates every second. Any thoughs?

My concern here is that this would be technically incorrect when it comes to our tiled windows. They're above the bottom layer, and if a user had widgets below the window area it wouldn't be blurred as expected. I think a fair solution could be to reduce the optimized blur area to not include regions where bars are, since tiled windows wouldn't overlap those areas anyway, but we should have a discussion about that one.

Hmm never mind my idea would be messed up for floating windows

@ErikReider
Copy link
Collaborator

ErikReider commented Feb 11, 2025

I think a fair solution could be to reduce the optimized blur area to not include regions where bars are, since tiled windows wouldn't overlap those areas anyway, but we should have a discussion about that one.

Hmm never mind my idea would be messed up for floating windows

Yeah I was thinking the same. We could exclude the bars, but only if blur_xray is disabled.

We'd only need to change this line:

wlr_scene_optimized_blur_set_size(output->layers.blur_layer, output_width, output_height);

@WillPower3309
Copy link
Owner Author

At this point I think we're good to go. Just need to merge in wlrfx/scenefx#106 and then this PR can be merged :)

@WillPower3309 WillPower3309 merged commit 82fe097 into master Feb 16, 2025
@WillPower3309 WillPower3309 deleted the 1.10-rebase branch February 16, 2025 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants