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

How do I send a frame notification without having to interact with the layer #389

Open
StratusFearMe21 opened this issue Jun 15, 2023 · 8 comments

Comments

@StratusFearMe21
Copy link

StratusFearMe21 commented Jun 15, 2023

Right now, I'm trying to make a status bar using the wlr layer shell protocol. I don't want to ask for a new frame on every frame because my bar spends most of it's time waiting for calloop events, so every time the status text needs to change in the bar, I call

layer.wl_surface().frame(&qh, layer.wl_surface.clone());
layer.commit();

Unfortunately, I only get the frame notification when I hover the mouse over the bar, then it gets the next frame notification(s). Is there a way that I can initialize new frames without having to hover my mouse over the layer surface or continuously ask for new frames?

The code I'm using is basically exactly the same as the simple_layer.rs example (but with the layer.wl_surface().frame() calls in the draw function commented out, and the WaylandSource being used instead of the loop).

Thanks in advance for your help, I swear I tried to find this out on my own but I couldn't find any docs or anything online or anything in the codebases I have on my system on how to do this.

@StratusFearMe21 StratusFearMe21 changed the title How do I send a frame notification without having to interact with a layer How do I send a frame notification without having to interact with the layer Jun 15, 2023
@i509VCB
Copy link
Member

i509VCB commented Jun 15, 2023

What compositor are you using? That should be fine, or you'll just be able to commit when your timer to update the clock fires after rendering new content.

@StratusFearMe21
Copy link
Author

I'm using a wlroots compositor (dwl)

@StratusFearMe21
Copy link
Author

StratusFearMe21 commented Jun 15, 2023

I made a simple example that illustrates the problem (https://github.com/StratusFearMe21/simple-layer), It just uses calloop and a calloop::timer::Timer source to start and stop an animation every 5 seconds. Unfortunately, the animation doesn't start or stop unless the mouse is moving on the layer surface

@i509VCB
Copy link
Member

i509VCB commented Jun 15, 2023

Could you test in another compositor (sway can be run windowed)

@StratusFearMe21
Copy link
Author

StratusFearMe21 commented Jun 16, 2023

Just attempted to run my example simple-layer code in sway, the problem remained. The timer would ask for a new frame, and I wouldn't get one until I moused over the layer

@StratusFearMe21
Copy link
Author

StratusFearMe21 commented Jun 16, 2023

Some WAYLAND_DEBUG logs, in case that helps. I hit return where there were long pauses between new events.

This is from my simple-layer example (Timer was printed when the calloop Timer was triggered)

I edited this post a little with more and better logs

[4192620.013]  -> wl_display@1.get_registry(new id wl_registry@2)
[4192620.056]  -> wl_display@1.sync(new id wl_callback@3)
[4192620.172] wl_display@1.delete_id(3)
[4192620.182] wl_registry@2.global(1, "wl_shm", 1)
[4192620.217] wl_registry@2.global(2, "wl_drm", 2)
[4192620.229] wl_registry@2.global(3, "zwp_linux_dmabuf_v1", 4)
[4192620.240] wl_registry@2.global(4, "wl_compositor", 5)
[4192620.251] wl_registry@2.global(5, "zwlr_export_dmabuf_manager_v1", 1)
[4192620.263] wl_registry@2.global(6, "zwlr_screencopy_manager_v1", 3)
[4192620.272] wl_registry@2.global(7, "zwlr_data_control_manager_v1", 2)
[4192620.282] wl_registry@2.global(8, "wl_data_device_manager", 3)
[4192620.293] wl_registry@2.global(9, "zwp_primary_selection_device_manager_v1", 1)
[4192620.320] wl_registry@2.global(10, "wp_viewporter", 1)
[4192620.330] wl_registry@2.global(11, "wp_single_pixel_buffer_manager_v1", 1)
[4192620.340] wl_registry@2.global(12, "wp_fractional_scale_manager_v1", 1)
[4192620.351] wl_registry@2.global(13, "wl_subcompositor", 1)
[4192620.361] wl_registry@2.global(14, "xdg_activation_v1", 1)
[4192620.372] wl_registry@2.global(15, "zwlr_gamma_control_manager_v1", 1)
[4192620.383] wl_registry@2.global(16, "zxdg_output_manager_v1", 3)
[4192620.394] wl_registry@2.global(17, "org_kde_kwin_idle", 1)
[4192620.405] wl_registry@2.global(18, "ext_idle_notifier_v1", 1)
[4192620.417] wl_registry@2.global(19, "zwp_idle_inhibit_manager_v1", 1)
[4192620.427] wl_registry@2.global(20, "zwlr_layer_shell_v1", 3)
[4192620.436] wl_registry@2.global(21, "xdg_wm_base", 4)
[4192620.448] wl_registry@2.global(22, "zwlr_input_inhibit_manager_v1", 1)
[4192620.459] wl_registry@2.global(23, "ext_session_lock_manager_v1", 1)
[4192620.468] wl_registry@2.global(24, "org_kde_kwin_server_decoration_manager", 1)
[4192620.479] wl_registry@2.global(25, "zxdg_decoration_manager_v1", 1)
[4192620.490] wl_registry@2.global(26, "zwp_virtual_keyboard_manager_v1", 1)
[4192620.501] wl_registry@2.global(27, "wl_seat", 8)
[4192620.511] wl_registry@2.global(28, "zwlr_output_manager_v1", 4)
[4192620.522] wl_registry@2.global(29, "wp_presentation", 1)
[4192620.531] wl_registry@2.global(30, "znet_tapesoftware_dwl_wm_v1", 1)
[4192620.543] wl_registry@2.global(31, "xwayland_shell_v1", 1)
[4192620.553] wl_registry@2.global(32, "wl_output", 4)
[4192620.564] wl_callback@3.done(9172)
[4192620.597]  -> wl_registry@2.bind(4, "wl_compositor", 5, new id [unknown]@3)
[4192620.614]  -> wl_registry@2.bind(20, "zwlr_layer_shell_v1", 3, new id [unknown]@4)
[4192620.633]  -> wl_registry@2.bind(1, "wl_shm", 1, new id [unknown]@5)
[4192620.660]  -> wl_compositor@3.create_surface(new id wl_surface@6)
[4192620.684]  -> zwlr_layer_shell_v1@4.get_layer_surface(new id zwlr_layer_surface_v1@7, wl_surface@6, nil, 1, "simple_layer")
[4192620.702]  -> zwlr_layer_surface_v1@7.set_anchor(13)
[4192620.711]  -> zwlr_layer_surface_v1@7.set_size(0, 24)
[4192620.719]  -> zwlr_layer_surface_v1@7.set_exclusive_zone(24)
[4192620.728]  -> wl_surface@6.commit()
[4192620.764]  -> wl_shm@5.create_pool(new id wl_shm_pool@8, fd 5, 184320)
[4192620.853]  -> wl_registry@2.bind(27, "wl_seat", 7, new id [unknown]@9)
[4192620.887]  -> wl_registry@2.bind(32, "wl_output", 4, new id [unknown]@10)
[4192620.903]  -> wl_registry@2.bind(16, "zxdg_output_manager_v1", 3, new id [unknown]@11)
[4192620.923]  -> zxdg_output_manager_v1@11.get_xdg_output(new id zxdg_output_v1@12, wl_output@10)
[4192710.387] wl_shm@5.format(0)
[4192710.430] wl_shm@5.format(1)
[4192710.436] wl_shm@5.format(875709016)
[4192710.441] wl_shm@5.format(875708993)
[4192710.446] wl_shm@5.format(875710274)
[4192710.451] wl_shm@5.format(842094674)
[4192710.457] wl_shm@5.format(842088786)
[4192710.462] wl_shm@5.format(892426322)
[4192710.467] wl_shm@5.format(892420434)
[4192710.472] wl_shm@5.format(909199186)
[4192710.478] wl_shm@5.format(808665688)
[4192710.483] wl_shm@5.format(808665665)
[4192710.487] wl_shm@5.format(1211384408)
[4192710.493] wl_shm@5.format(1211384385)
[4192710.497] wl_shm@5.format(942948952)
[4192710.501] wl_shm@5.format(942948929)
[4192710.506] zwlr_layer_surface_v1@7.configure(9173, 1920, 24)
[4192710.515] zwlr_layer_surface_v1@7.configure(9175, 1920, 24)
[4192710.523] wl_seat@9.name("seat0")
[4192710.532] wl_seat@9.capabilities(3)
[4192710.540] wl_output@10.geometry(0, 0, 310, 170, 0, "Chimei Innolux Corporation", "0x14D4", 0)
[4192710.554] wl_output@10.mode(1, 1920, 1080, 60008)
[4192710.563] wl_output@10.scale(1)
[4192710.567] wl_output@10.name("eDP-1")
[4192710.573] wl_output@10.description("Chimei Innolux Corporation 0x14D4 (eDP-1)")
[4192710.581] wl_output@10.done()
[4192710.585] zxdg_output_v1@12.name("eDP-1")
[4192710.592] zxdg_output_v1@12.description("Chimei Innolux Corporation 0x14D4 (eDP-1)")
[4192710.597] zxdg_output_v1@12.logical_position(0, 0)
[4192710.604] zxdg_output_v1@12.logical_size(1920, 1080)
[4192710.612] wl_output@10.done()
[4192710.680]  -> zwlr_layer_surface_v1@7.ack_configure(9173)
[4192710.716]  -> wl_shm_pool@8.create_buffer(new id wl_buffer@13, 0, 1920, 24, 7680, 0)
[4192710.744]  -> wl_shm_pool@8.resize(368640)
[4192710.775]  -> wl_shm_pool@8.create_buffer(new id wl_buffer@14, 184320, 1920, 24, 7680, 0)
[4192734.120]  -> wl_surface@6.damage_buffer(0, 0, 1920, 24)
[4192734.146]  -> wl_surface@6.attach(wl_buffer@13, 0, 0)
[4192734.155]  -> wl_surface@6.commit()
[4192734.174]  -> zwlr_layer_surface_v1@7.ack_configure(9175)
[4192734.208]  -> wl_shm_pool@8.resize(737280)
[4192734.257]  -> wl_shm_pool@8.create_buffer(new id wl_buffer@15, 368640, 1920, 24, 7680, 0)
[4192734.279]  -> wl_shm_pool@8.create_buffer(new id wl_buffer@16, 552960, 1920, 24, 7680, 0)
[4192734.314]  -> wl_buffer@14.destroy()
Set pointer capability
[4192734.363]  -> wl_seat@9.get_pointer(new id wl_pointer@17)
[4192735.650] wl_display@1.delete_id(14)
[4192735.659] wl_surface@6.enter(wl_output@10)
[4192735.672] zwlr_layer_surface_v1@7.configure(9177, 1920, 24)
[4192735.679] wl_buffer@13.release()
[4192735.692]  -> wl_buffer@13.destroy()
[4192735.731]  -> zwlr_layer_surface_v1@7.ack_configure(9177)
[4192735.759]  -> wl_shm_pool@8.create_buffer(new id wl_buffer@14, 0, 1920, 24, 7680, 0)
[4192735.775]  -> wl_shm_pool@8.create_buffer(new id wl_buffer@18, 184320, 1920, 24, 7680, 0)
[4192735.792]  -> wl_buffer@15.destroy()
[4192735.803]  -> wl_buffer@16.destroy()






Timer
[4197716.386]  -> wl_surface@6.frame(new id wl_callback@19)
[4197716.446]  -> wl_surface@6.commit()


/* Moved mouse onto layer */

[4200263.707] wl_display@1.delete_id(13)
[4200263.747] wl_display@1.delete_id(15)
[4200263.756] wl_display@1.delete_id(16)
[4200263.765] wl_pointer@17.enter(9213, wl_surface@6, 1432.80078125, 0.00000000)
[4200263.804] wl_pointer@17.frame()
[4200263.814] wl_pointer@17.frame()
Pointer entered @(1432.80078125, 0.0)
[4200270.571] wl_pointer@17.motion(6667691, 1422.50000000, 0.00000000)
[4200270.604] wl_pointer@17.frame()
[4200273.955] wl_display@1.delete_id(19)
[4200273.973] wl_callback@19.done(6667694)
[4200316.505]  -> wl_surface@6.damage_buffer(0, 0, 1920, 24)
[4200316.560]  -> wl_surface@6.frame(new id wl_callback@19)
[4200316.599]  -> wl_surface@6.attach(wl_buffer@14, 0, 0)
[4200316.614]  -> wl_surface@6.commit()
[4200316.736] wl_pointer@17.motion(6667698, 1416.29687500, 0.00000000)
[4200316.758] wl_pointer@17.frame()
[4200316.765] wl_pointer@17.motion(6667704, 1410.91015625, 0.00000000)
[4200316.774] wl_pointer@17.frame()
[4200316.783] wl_pointer@17.motion(6667711, 1408.04687500, 0.00000000)
[4200316.794] wl_pointer@17.frame()
[4200316.804] wl_pointer@17.motion(6667718, 1405.17578125, 0.00000000)
[4200316.814] wl_pointer@17.frame()
[4200316.822] wl_pointer@17.motion(6667726, 1401.30859375, 0.00000000)
[4200316.833] wl_pointer@17.frame()
[4200316.842] wl_pointer@17.motion(6667732, 1396.16796875, 0.00000000)
[4200316.853] wl_pointer@17.frame()
[4200317.982] wl_buffer@14.release()
[4200319.112] wl_pointer@17.motion(6667739, 1391.26953125, 0.00000000)
[4200319.131] wl_pointer@17.frame()
[4200324.423] wl_display@1.delete_id(19)
[4200324.465] wl_callback@19.done(6667744)
[4200351.135]  -> wl_surface@6.damage_buffer(0, 0, 1920, 24)
[4200351.182]  -> wl_surface@6.frame(new id wl_callback@19)
[4200351.212]  -> wl_surface@6.attach(wl_buffer@18, 0, 0)
[4200351.221]  -> wl_surface@6.commit()
[4200351.321] wl_pointer@17.motion(6667746, 1388.22656250, 0.00000000)
[4200351.337] wl_pointer@17.frame()
[4200351.342] wl_pointer@17.motion(6667753, 1387.34765625, 0.00000000)
[4200351.348] wl_pointer@17.frame()
[4200351.353] wl_pointer@17.motion(6667760, 1386.47265625, 0.00000000)
[4200351.359] wl_pointer@17.frame()
[4200351.363] wl_pointer@17.motion(6667767, 1385.59375000, 0.00000000)
[4200351.369] wl_pointer@17.frame()
[4200352.239] wl_buffer@18.release()
[4200353.674] wl_pointer@17.motion(6667774, 1384.71484375, 0.00000000)
[4200353.685] wl_pointer@17.frame()
[4200358.172] wl_display@1.delete_id(19)
[4200358.217] wl_callback@19.done(6667778)
[4200383.946]  -> wl_surface@6.damage_buffer(0, 0, 1920, 24)
[4200383.988]  -> wl_surface@6.frame(new id wl_callback@19)
[4200384.016]  -> wl_surface@6.attach(wl_buffer@14, 0, 0)
[4200384.027]  -> wl_surface@6.commit()
[4200384.115] wl_pointer@17.motion(6667781, 1383.83593750, 0.00000000)
[4200384.133] wl_pointer@17.frame()
[4200384.820] wl_buffer@14.release()
[4200388.495] wl_pointer@17.motion(6667808, 1381.19921875, 0.00000000)
[4200388.520] wl_pointer@17.frame()
[4200391.095] wl_display@1.delete_id(19)
[4200391.113] wl_callback@19.done(6667811)
[4200417.089]  -> wl_surface@6.damage_buffer(0, 0, 1920, 24)
[4200417.131]  -> wl_surface@6.frame(new id wl_callback@19)
[4200417.160]  -> wl_surface@6.attach(wl_buffer@18, 0, 0)
[4200417.170]  -> wl_surface@6.commit()
[4200417.261] wl_pointer@17.motion(6667815, 1379.44140625, 0.87890625)
[4200417.278] wl_pointer@17.frame()
[4200417.284] wl_pointer@17.motion(6667822, 1371.36718750, 21.06250000)
[4200417.290] wl_pointer@17.frame()
[4200417.295] wl_pointer@17.leave(9214, wl_surface@6)
[4200417.319] wl_pointer@17.frame()
Pointer left
[4200417.919] wl_buffer@18.release()
[4200424.491] wl_display@1.delete_id(19)
[4200424.521] wl_callback@19.done(6667845)
[4200450.222]  -> wl_surface@6.damage_buffer(0, 0, 1920, 24)
[4200450.344]  -> wl_surface@6.frame(new id wl_callback@19)
[4200450.415]  -> wl_surface@6.attach(wl_buffer@14, 0, 0)
[4200450.438]  -> wl_surface@6.commit()
[4200451.478] wl_buffer@14.release()
[4200457.887] wl_display@1.delete_id(19)
[4200457.930] wl_callback@19.done(6667878)
[4200480.148]  -> wl_surface@6.damage_buffer(0, 0, 1920, 24)
[4200480.198]  -> wl_surface@6.frame(new id wl_callback@19)
[4200480.251]  -> wl_surface@6.attach(wl_buffer@18, 0, 0)
[4200480.262]  -> wl_surface@6.commit()
[4200481.118] wl_buffer@18.release()
[4200491.235] wl_display@1.delete_id(19)
[4200491.263] wl_callback@19.done(6667911)
[4200514.734]  -> wl_surface@6.damage_buffer(0, 0, 1920, 24)
[4200514.775]  -> wl_surface@6.frame(new id wl_callback@19)
[4200514.802]  -> wl_surface@6.attach(wl_buffer@14, 0, 0)
[4200514.811]  -> wl_surface@6.commit()
[4200515.379] wl_buffer@14.release()
[4200524.522] wl_display@1.delete_id(19)
[4200524.543] wl_callback@19.done(6667945)
[4200547.689]  -> wl_surface@6.damage_buffer(0, 0, 1920, 24)
[4200547.723]  -> wl_surface@6.frame(new id wl_callback@19)
[4200547.746]  -> wl_surface@6.attach(wl_buffer@18, 0, 0)
[4200547.757]  -> wl_surface@6.commit()
[4200548.062] wl_buffer@18.release()
[4200557.946] wl_display@1.delete_id(19)
[4200557.966] wl_callback@19.done(6667978)
[4200581.445]  -> wl_surface@6.damage_buffer(0, 0, 1920, 24)
[4200581.476]  -> wl_surface@6.frame(new id wl_callback@19)
[4200581.501]  -> wl_surface@6.attach(wl_buffer@14, 0, 0)
[4200581.512]  -> wl_surface@6.commit()
[4200582.525] wl_buffer@14.release()
[4200591.338] wl_display@1.delete_id(19)
[4200591.362] wl_callback@19.done(6668011)
[4200614.609]  -> wl_surface@6.damage_buffer(0, 0, 1920, 24)
[4200614.638]  -> wl_surface@6.frame(new id wl_callback@19)
[4200614.657]  -> wl_surface@6.attach(wl_buffer@18, 0, 0)
[4200614.666]  -> wl_surface@6.commit()
[4200614.844] wl_buffer@18.release()
[4200624.781] wl_display@1.delete_id(19)
[4200624.800] wl_callback@19.done(6668045)
[4200648.564]  -> wl_surface@6.damage_buffer(0, 0, 1920, 24)
[4200648.608]  -> wl_surface@6.frame(new id wl_callback@19)
[4200648.636]  -> wl_surface@6.attach(wl_buffer@14, 0, 0)
[4200648.645]  -> wl_surface@6.commit()
[4200648.909] wl_buffer@14.release()
[4200658.370] wl_display@1.delete_id(19)
[4200658.389] wl_callback@19.done(6668078)

This is the log from a simple status bar that I know works and does update properly this one specifically

[ 893349.320]  -> wl_display@1.get_registry(new id wl_registry@2)
[ 893349.355]  -> wl_display@1.sync(new id wl_callback@3)
[ 893349.506] wl_display@1.delete_id(3)
[ 893349.522] wl_registry@2.global(1, "wl_shm", 1)
[ 893349.531]  -> wl_registry@2.bind(1, "wl_shm", 1, new id [unknown]@4)
[ 893349.540] wl_registry@2.global(2, "wl_drm", 2)
[ 893349.547] wl_registry@2.global(3, "zwp_linux_dmabuf_v1", 4)
[ 893349.558] wl_registry@2.global(4, "wl_compositor", 5)
[ 893349.566]  -> wl_registry@2.bind(4, "wl_compositor", 4, new id [unknown]@5)
[ 893349.574] wl_registry@2.global(5, "zwlr_export_dmabuf_manager_v1", 1)
[ 893349.582] wl_registry@2.global(6, "zwlr_screencopy_manager_v1", 3)
[ 893349.593] wl_registry@2.global(7, "zwlr_data_control_manager_v1", 2)
[ 893349.599] wl_registry@2.global(8, "wl_data_device_manager", 3)
[ 893349.611] wl_registry@2.global(9, "zwp_primary_selection_device_manager_v1", 1)
[ 893349.619] wl_registry@2.global(10, "wp_viewporter", 1)
[ 893349.631] wl_registry@2.global(11, "wp_single_pixel_buffer_manager_v1", 1)
[ 893349.639] wl_registry@2.global(12, "wp_fractional_scale_manager_v1", 1)
[ 893349.647] wl_registry@2.global(13, "wl_subcompositor", 1)
[ 893349.653] wl_registry@2.global(14, "xdg_activation_v1", 1)
[ 893349.660] wl_registry@2.global(15, "zwlr_gamma_control_manager_v1", 1)
[ 893349.669] wl_registry@2.global(16, "zxdg_output_manager_v1", 3)
[ 893349.679]  -> wl_registry@2.bind(16, "zxdg_output_manager_v1", 3, new id [unknown]@6)
[ 893349.686] wl_registry@2.global(17, "org_kde_kwin_idle", 1)
[ 893349.695] wl_registry@2.global(18, "ext_idle_notifier_v1", 1)
[ 893349.703] wl_registry@2.global(19, "zwp_idle_inhibit_manager_v1", 1)
[ 893349.710] wl_registry@2.global(20, "zwlr_layer_shell_v1", 3)
[ 893349.719]  -> wl_registry@2.bind(20, "zwlr_layer_shell_v1", 3, new id [unknown]@7)
[ 893349.728] wl_registry@2.global(21, "xdg_wm_base", 4)
[ 893349.737]  -> wl_registry@2.bind(21, "xdg_wm_base", 2, new id [unknown]@8)
[ 893349.747] wl_registry@2.global(22, "zwlr_input_inhibit_manager_v1", 1)
[ 893349.756] wl_registry@2.global(23, "ext_session_lock_manager_v1", 1)
[ 893349.766] wl_registry@2.global(24, "org_kde_kwin_server_decoration_manager", 1)
[ 893349.774] wl_registry@2.global(25, "zxdg_decoration_manager_v1", 1)
[ 893349.786] wl_registry@2.global(26, "zwp_virtual_keyboard_manager_v1", 1)
[ 893349.795] wl_registry@2.global(27, "wl_seat", 8)
[ 893349.803]  -> wl_registry@2.bind(27, "wl_seat", 7, new id [unknown]@9)
[ 893349.816] wl_registry@2.global(28, "zwlr_output_manager_v1", 4)
[ 893349.823] wl_registry@2.global(29, "wp_presentation", 1)
[ 893349.832] wl_registry@2.global(30, "znet_tapesoftware_dwl_wm_v1", 1)
[ 893349.841]  -> wl_registry@2.bind(30, "znet_tapesoftware_dwl_wm_v1", 1, new id [unknown]@10)
[ 893349.850] wl_registry@2.global(31, "xwayland_shell_v1", 1)
[ 893349.860] wl_registry@2.global(32, "wl_output", 4)
[ 893349.869]  -> wl_registry@2.bind(32, "wl_output", 1, new id [unknown]@11)
[ 893349.877] wl_callback@3.done(6144)
[ 893349.886]  -> wl_display@1.sync(new id wl_callback@3)
[ 893349.985] wl_display@1.delete_id(3)
[ 893349.996] wl_seat@9.name("seat0")
[ 893350.002] wl_seat@9.capabilities(3)
[ 893350.010]  -> wl_seat@9.get_pointer(new id wl_pointer@12)
[ 893350.018] znet_tapesoftware_dwl_wm_v1@10.tag(9)
[ 893350.027] znet_tapesoftware_dwl_wm_v1@10.layout("[]=")
[ 893350.035] znet_tapesoftware_dwl_wm_v1@10.layout("><>")
[ 893350.041] znet_tapesoftware_dwl_wm_v1@10.layout("[M]")
[ 893350.050] wl_callback@3.done(6144)
[ 893350.076]  -> zxdg_output_manager_v1@6.get_xdg_output(new id zxdg_output_v1@3, wl_output@11)
[ 893350.086]  -> znet_tapesoftware_dwl_wm_v1@10.get_monitor(new id znet_tapesoftware_dwl_wm_monitor_v1@13, wl_output@11)
[ 893362.009] zxdg_output_v1@3.name("eDP-1")
[ 893362.044]  -> zxdg_output_v1@3.destroy()
[ 893362.053] discarded zxdg_output_v1@3.description("Chimei Innolux Corporation 0x14D4 (eDP-1)")
[ 893362.060] discarded zxdg_output_v1@3.logical_position(0, 0)
[ 893362.067] discarded zxdg_output_v1@3.logical_size(1920, 1080)
[ 893362.075] znet_tapesoftware_dwl_wm_monitor_v1@13.selected(1)
[ 893362.083] znet_tapesoftware_dwl_wm_monitor_v1@13.tag(0, 1, 2, 1)
[ 893362.092] znet_tapesoftware_dwl_wm_monitor_v1@13.tag(1, 0, 1, -1)
[ 893362.101] znet_tapesoftware_dwl_wm_monitor_v1@13.tag(2, 0, 0, -1)
[ 893362.109] znet_tapesoftware_dwl_wm_monitor_v1@13.tag(3, 0, 0, -1)
[ 893362.118] znet_tapesoftware_dwl_wm_monitor_v1@13.tag(4, 0, 0, -1)
[ 893362.126] znet_tapesoftware_dwl_wm_monitor_v1@13.tag(5, 0, 0, -1)
[ 893362.134] znet_tapesoftware_dwl_wm_monitor_v1@13.tag(6, 0, 0, -1)
[ 893362.142] znet_tapesoftware_dwl_wm_monitor_v1@13.tag(7, 0, 0, -1)
[ 893362.150] znet_tapesoftware_dwl_wm_monitor_v1@13.tag(8, 0, 0, -1)
[ 893362.158] znet_tapesoftware_dwl_wm_monitor_v1@13.layout(0)
[ 893362.166] znet_tapesoftware_dwl_wm_monitor_v1@13.title("~/simple-layer")
[ 893362.175] znet_tapesoftware_dwl_wm_monitor_v1@13.frame()
[ 893362.183]  -> wl_compositor@5.create_surface(new id wl_surface@14)
[ 893362.193]  -> zwlr_layer_shell_v1@7.get_layer_surface(new id zwlr_layer_surface_v1@15, wl_surface@14, wl_output@11, 1, "net.tapesoftware.Somebar")
[ 893362.206]  -> zwlr_layer_surface_v1@15.set_anchor(13)
[ 893362.213]  -> zwlr_layer_surface_v1@15.set_size(0, 23)
[ 893362.220]  -> zwlr_layer_surface_v1@15.set_exclusive_zone(23)
[ 893362.227]  -> wl_surface@14.commit()
[ 893362.403] wl_display@1.delete_id(3)
[ 893362.411] zwlr_layer_surface_v1@15.configure(6145, 1920, 23)
[ 893362.419]  -> zwlr_layer_surface_v1@15.ack_configure(6145)
[ 893362.444]  -> wl_shm@4.create_pool(new id wl_shm_pool@3, fd 18, 353280)
[ 893362.471]  -> wl_shm_pool@3.create_buffer(new id wl_buffer@16, 0, 1920, 23, 7680, 1)
[ 893362.482]  -> wl_shm_pool@3.create_buffer(new id wl_buffer@17, 176640, 1920, 23, 7680, 1)
[ 893362.493]  -> wl_shm_pool@3.destroy()
[ 893367.812]  -> wl_surface@14.attach(wl_buffer@16, 0, 0)
[ 893367.842]  -> wl_surface@14.damage(0, 0, 1920, 23)
[ 893367.851]  -> wl_surface@14.commit()
[ 893367.860] zwlr_layer_surface_v1@15.configure(6147, 1920, 23)
[ 893367.873]  -> zwlr_layer_surface_v1@15.ack_configure(6147)
[ 893368.800] wl_display@1.delete_id(3)
[ 893368.813] zwlr_layer_surface_v1@15.configure(6149, 1920, 23)
[ 893368.821]  -> zwlr_layer_surface_v1@15.ack_configure(6149)



[3903193.992]  -> wl_surface@14.frame(new id wl_callback@3)
[3903194.022]  -> wl_surface@14.commit()
[3903196.964] wl_display@1.delete_id(3)
[3903196.982] wl_callback@3.done(6370617)
[3903198.350]  -> wl_surface@14.attach(wl_buffer@17, 0, 0)
[3903198.372]  -> wl_surface@14.damage(0, 0, 1920, 23)
[3903198.381]  -> wl_surface@14.commit()





[3911874.271]  -> wl_surface@14.frame(new id wl_callback@3)
[3911874.330]  -> wl_surface@14.commit()
[3911891.499] wl_display@1.delete_id(3)
[3911891.545] wl_callback@3.done(6379311)
[3911892.753]  -> wl_surface@14.attach(wl_buffer@16, 0, 0)
[3911892.770]  -> wl_surface@14.damage(0, 0, 1920, 23)
[3911892.778]  -> wl_surface@14.commit()

@StratusFearMe21
Copy link
Author

I was able to get the frames to update without any user intervention! However, not using the WaylandSource. I replaced the WaylandSource with this

let guard = event_queue.prepare_read().unwrap();
let fd = Generic::new(
    guard.connection_fd().as_raw_fd(),
    Interest::READ,
    Mode::Level,
);
drop(guard);

let event_queue = Rc::new(RefCell::new(event_queue));
let event_queue_loop = Rc::clone(&event_queue);
event_loop
    .handle()
    .insert_source(fd, move |_, _, data| {
        if event_queue_loop
            .borrow_mut()
            .blocking_dispatch(data)
            .is_err()
        {
            panic!("display_dispatch");
        }
        Ok(calloop::PostAction::Continue)
    })
    .unwrap();

{
    let mut event_queue = event_queue.borrow_mut();
    event_queue.roundtrip(&mut simple_layer).unwrap();
    event_queue.flush().unwrap();
}

event_loop
    .run(None, &mut simple_layer, move |data| {
        let mut event_queue = event_queue.borrow_mut();
        event_queue.dispatch_pending(data).unwrap();
        event_queue.flush().unwrap();
    })
    .unwrap();

Could the fact that this worked and the WaylandSource didn't be a bug in the WaylandSource?

@i509VCB
Copy link
Member

i509VCB commented Jun 16, 2023

Hmm that is odd @elinorbgr do you have an ideas why this could be happening?

I'd probably avoid doing that above specifically since it seemed to cause the Nvidia driver to have some issues when talking to Wayland.

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

No branches or pull requests

2 participants