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






Timer
[4197716.386]  -> [email protected](new id wl_callback@19)
[4197716.446]  -> [email protected]()


/* Moved mouse onto layer */

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

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

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



[3903193.992]  -> [email protected](new id wl_callback@3)
[3903194.022]  -> [email protected]()
[3903196.964] [email protected]_id(3)
[3903196.982] [email protected](6370617)
[3903198.350]  -> [email protected](wl_buffer@17, 0, 0)
[3903198.372]  -> [email protected](0, 0, 1920, 23)
[3903198.381]  -> [email protected]()





[3911874.271]  -> [email protected](new id wl_callback@3)
[3911874.330]  -> [email protected]()
[3911891.499] [email protected]_id(3)
[3911891.545] [email protected](6379311)
[3911892.753]  -> [email protected](wl_buffer@16, 0, 0)
[3911892.770]  -> [email protected](0, 0, 1920, 23)
[3911892.778]  -> [email protected]()

@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