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

Fixes for Sway modes and wlr_scene support #3528

Merged
merged 4 commits into from
Sep 16, 2024

Conversation

alebastr
Copy link
Contributor

@alebastr alebastr commented Aug 18, 2024

Fixes #3211
Fixes #3512 (and a dozen other issues about overlay mode not being on top of fullscreen windows)

@VlctM, @7ff04da4aa6ac37197e249299066ac30, @srprca, I'd appreciate if you could test this PR.

@srprca
Copy link

srprca commented Aug 18, 2024

I have tested that I can reproduce #3512 with the current master branch, and that it is fixed by this pull request. Thank you very much for this fix!

@VlctM
Copy link

VlctM commented Aug 18, 2024

With this pull request I'm getting a small delay upto one second between toggling bar visibility and it actually showing up on top of fullscreen window. Hiding works fine.

@srprca
Copy link

srprca commented Aug 18, 2024

I think with this pull request there is another issue that is somewhat similar to what @VlctM initially reported in #3211.

Here is what I observe with

bar {
    swaybar_command PATH_TO_THIS_PRs_BUILD_DIR/waybar
}

in ~/.config/sway/config:

  1. I launch sway, waybar is visible
  2. I launch foot, make it fullscreen, waybar is not visible
  3. I toggle foot's fullscreen back and forth, waybar is visible if and only if it is not fullscreen
  4. With foot not in fullscreen, I toggle waybar's visibility twice by sending it SIGUSR1, it disappears and appears as expected
  5. After that, if I toggle foot's fullscreen back and forth, waybar is visible on top of it even with fullscreen
  6. If with foot in fullscreen and waybar visible I send it SIGUSR1, it becomes invisible, but subsequently sending SIGUSR1 again doesn't make it visible, as long as I am still in fullscreen
  7. If I exit fullscreen, I am reset back to the state reported in bullet point 4.

Long story short (maybe not an accurate summary of my observations), waybar is "broken" after launch and until first visibility toggle, and gets broken if it is hidden when a window is in fullscreen mode

@alebastr
Copy link
Contributor Author

With this pull request I'm getting a small delay upto one second between toggling bar visibility and it actually showing up on top of fullscreen window. Hiding works fine.

Hm, I can't reproduce the delay, and it shouldn't be directly caused by anything waybar does.
Can you tell what's the compositor you use (including version and revision for git snapshots) and collect WAYALND_DEBUG=client waybar log? If you're comfortable sharing your configuration, that'll also help.

@alebastr
Copy link
Contributor Author

alebastr commented Aug 18, 2024

I think with this pull request there is another issue that is somewhat similar to what @VlctM initially reported in #3211.

...

Long story short (maybe not an accurate summary of my observations), waybar is "broken" after launch and until first visibility toggle, and gets broken if it is hidden when a window is in fullscreen mode

Not sure what do you mean by "broken after launch", do you expect to start in a hidden state?

Visibility changes via Sway IPC events and via SIGUSR1 work slightly differently and aren't really compatible or meant to be used together. SIGUSR1 switches between invisible and default (or whatever is set in the "mode" config field), and the default mode is rendered below fullscreen windows.

I suspect that "ipc": false, "mode": "hide" will get you closer to the expected behavior. But with Sway there are other ways to achieve this result, e.g. something that would work with the standard swaybar as well:

bar bar-0 {
    ...
    mode hide
    # optionally, start with the bar visible
    # hidden_state show
}
bindsym <something> bar bar-0 hidden_state toggle

@VlctM
Copy link

VlctM commented Aug 19, 2024

With this pull request I'm getting a small delay upto one second between toggling bar visibility and it actually showing up on top of fullscreen window. Hiding works fine.

Hm, I can't reproduce the delay, and it shouldn't be directly caused by anything waybar does. Can you tell what's the compositor you use (including version and revision for git snapshots) and collect WAYALND_DEBUG=client waybar log? If you're comfortable sharing your configuration, that'll also help.

Sway 1.9/River 0.3.5
gtk-layer-shell 0.8.2

So I tried to make the smallest config with which that issue is reproducible and discovered that for some reason with only

{
    "layer": "overlay",
    "start_hidden": true,
    "modules-left": ["sway/workspaces"]
 }

Waybar fails to change visibility at all over fullscreen window (it's "visible" but underneath).

{
    "layer": "overlay",
    "start_hidden": true,
    "modules-left": ["sway/workspaces", "sway/mode", "sway/scratchpad", "custom/media", "clock", "wireplumber", "backlight", "battery", "network"]
 }

That "fixes" it somehow. There's a delay, and this time even upto few seconds.

That's the log after running waybar:

[ 623977.740] {Default Queue}  -> wl_display#1.get_registry(new id wl_registry#2)
[ 623977.755] {Default Queue}  -> wl_display#1.sync(new id wl_callback#3)
[ 623977.845] {Display Queue} wl_display#1.delete_id(3)
[ 623977.856] {Default Queue} wl_registry#2.global(1, "wl_shm", 1)
[ 623977.863] {Default Queue}  -> wl_registry#2.bind(1, "wl_shm", 1, new id [unknown]#4)
[ 623977.868] {Default Queue} wl_registry#2.global(2, "wl_drm", 2)
[ 623977.873] {Default Queue} wl_registry#2.global(3, "zwp_linux_dmabuf_v1", 4)
[ 623977.877] {Default Queue} wl_registry#2.global(4, "wl_compositor", 6)
[ 623977.882] {Default Queue}  -> wl_registry#2.bind(4, "wl_compositor", 3, new id [unknown]#5)
[ 623977.887] {Default Queue} wl_registry#2.global(5, "wl_subcompositor", 1)
[ 623977.892] {Default Queue}  -> wl_registry#2.bind(5, "wl_subcompositor", 1, new id [unknown]#6)
[ 623977.899] {Default Queue} wl_registry#2.global(6, "wl_data_device_manager", 3)
[ 623977.905] {Default Queue}  -> wl_registry#2.bind(6, "wl_data_device_manager", 3, new id [unknown]#7)
[ 623977.908] {Default Queue} wl_registry#2.global(7, "zwlr_gamma_control_manager_v1", 1)
[ 623977.912] {Default Queue} wl_registry#2.global(8, "zxdg_output_manager_v1", 3)
[ 623977.917] {Default Queue}  -> wl_registry#2.bind(8, "zxdg_output_manager_v1", 3, new id [unknown]#8)
[ 623977.921] {Default Queue}  -> wl_display#1.sync(new id wl_callback#9)
[ 623977.927] {Default Queue} wl_registry#2.global(9, "ext_idle_notifier_v1", 1)
[ 623977.930] {Default Queue} wl_registry#2.global(10, "zwp_idle_inhibit_manager_v1", 1)
[ 623977.932] {Default Queue} wl_registry#2.global(11, "zwlr_layer_shell_v1", 4)
[ 623977.936] {Default Queue} wl_registry#2.global(12, "xdg_wm_base", 2)
[ 623977.939] {Default Queue} wl_registry#2.global(13, "zwp_tablet_manager_v2", 1)
[ 623977.942] {Default Queue}  -> wl_registry#2.bind(13, "zwp_tablet_manager_v2", 1, new id [unknown]#10)
[ 623977.946] {Default Queue} wl_registry#2.global(14, "org_kde_kwin_server_decoration_manager", 1)
[ 623977.949] {Default Queue}  -> wl_registry#2.bind(14, "org_kde_kwin_server_decoration_manager", 1, new id [unknown]#11)
[ 623977.953] {Default Queue} wl_registry#2.global(15, "zxdg_decoration_manager_v1", 1)
[ 623977.956] {Default Queue} wl_registry#2.global(16, "zwp_relative_pointer_manager_v1", 1)
[ 623977.961] {Default Queue} wl_registry#2.global(17, "zwp_pointer_constraints_v1", 1)
[ 623977.966] {Default Queue} wl_registry#2.global(18, "wp_presentation", 1)
[ 623977.970] {Default Queue} wl_registry#2.global(19, "zwlr_output_manager_v1", 4)
[ 623977.975] {Default Queue} wl_registry#2.global(20, "zwlr_output_power_manager_v1", 1)
[ 623977.981] {Default Queue} wl_registry#2.global(21, "zwp_input_method_manager_v2", 1)
[ 623977.986] {Default Queue} wl_registry#2.global(22, "zwp_text_input_manager_v3", 1)
[ 623977.989] {Default Queue} wl_registry#2.global(23, "zwlr_foreign_toplevel_manager_v1", 3)
[ 623977.993] {Default Queue} wl_registry#2.global(24, "ext_session_lock_manager_v1", 1)
[ 623977.996] {Default Queue} wl_registry#2.global(25, "wp_drm_lease_device_v1", 1)
[ 623977.999] {Default Queue} wl_registry#2.global(26, "zwlr_export_dmabuf_manager_v1", 1)
[ 623978.002] {Default Queue} wl_registry#2.global(27, "zwlr_screencopy_manager_v1", 3)
[ 623978.005] {Default Queue} wl_registry#2.global(28, "zwlr_data_control_manager_v1", 2)
[ 623978.008] {Default Queue} wl_registry#2.global(29, "wp_security_context_manager_v1", 1)
[ 623978.012] {Default Queue} wl_registry#2.global(30, "wp_viewporter", 1)
[ 623978.017] {Default Queue} wl_registry#2.global(31, "wp_single_pixel_buffer_manager_v1", 1)
[ 623978.025] {Default Queue} wl_registry#2.global(32, "wp_content_type_manager_v1", 1)
[ 623978.030] {Default Queue} wl_registry#2.global(33, "wp_fractional_scale_manager_v1", 1)
[ 623978.034] {Default Queue} wl_registry#2.global(34, "zxdg_exporter_v1", 1)
[ 623978.037] {Default Queue}  -> wl_registry#2.bind(34, "zxdg_exporter_v1", 1, new id [unknown]#12)
[ 623978.041] {Default Queue} wl_registry#2.global(35, "zxdg_importer_v1", 1)
[ 623978.045] {Default Queue}  -> wl_registry#2.bind(35, "zxdg_importer_v1", 1, new id [unknown]#13)
[ 623978.051] {Default Queue} wl_registry#2.global(36, "zxdg_exporter_v2", 1)
[ 623978.056] {Default Queue} wl_registry#2.global(37, "zxdg_importer_v2", 1)
[ 623978.061] {Default Queue} wl_registry#2.global(38, "xdg_activation_v1", 1)
[ 623978.066] {Default Queue}  -> wl_registry#2.bind(38, "xdg_activation_v1", 1, new id [unknown]#14)
[ 623978.071] {Default Queue} wl_registry#2.global(39, "wp_cursor_shape_manager_v1", 1)
[ 623978.076] {Default Queue} wl_registry#2.global(40, "zwp_virtual_keyboard_manager_v1", 1)
[ 623978.081] {Default Queue} wl_registry#2.global(41, "zwlr_virtual_pointer_manager_v1", 2)
[ 623978.085] {Default Queue} wl_registry#2.global(42, "zwlr_input_inhibit_manager_v1", 1)
[ 623978.090] {Default Queue} wl_registry#2.global(43, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[ 623978.096] {Default Queue}  -> wl_registry#2.bind(43, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1, new id [unknown]#15)
[ 623978.101] {Default Queue} wl_registry#2.global(44, "zwp_pointer_gestures_v1", 3)
[ 623978.105] {Default Queue}  -> wl_registry#2.bind(44, "zwp_pointer_gestures_v1", 1, new id [unknown]#16)
[ 623978.110] {Default Queue} wl_registry#2.global(45, "wl_seat", 8)
[ 623978.116] {Default Queue} wl_registry#2.global(47, "zwp_primary_selection_device_manager_v1", 1)
[ 623978.121] {Default Queue}  -> wl_registry#2.bind(47, "zwp_primary_selection_device_manager_v1", 1, new id [unknown]#17)
[ 623978.125] {Default Queue} wl_registry#2.global(48, "wl_output", 4)
[ 623978.130] {Default Queue}  -> wl_registry#2.bind(48, "wl_output", 2, new id [unknown]#18)
[ 623978.167] {Default Queue}  -> zxdg_output_manager_v1#8.get_xdg_output(new id zxdg_output_v1#19, wl_output#18)
[ 623978.173] {Default Queue}  -> wl_display#1.sync(new id wl_callback#20)
[ 623978.176] {Default Queue} wl_callback#3.done(19056)
[ 623978.210] {Default Queue}  -> wl_shm#4.create_pool(new id wl_shm_pool#3, fd 10, 2304)
[ 623978.299] {Default Queue}  -> wl_shm_pool#3.resize(6912)
[ 623979.257] {Default Queue}  -> wl_shm_pool#3.resize(16128)
[ 623979.281] {Default Queue}  -> wl_shm_pool#3.resize(34560)
[ 623979.303] {Default Queue}  -> wl_shm_pool#3.resize(71424)
[ 623979.338] {Default Queue}  -> wl_shm_pool#3.resize(145152)
[ 623979.462] {Default Queue}  -> wl_shm_pool#3.resize(292608)
[ 623980.744] {Default Queue}  -> wl_shm_pool#3.resize(587520)
[ 623986.364] {Default Queue}  -> wl_registry#2.bind(45, "wl_seat", 5, new id [unknown]#21)
[ 623988.803] {Default Queue}  -> wl_compositor#5.create_surface(new id wl_surface#22)
[ 623988.815] {Default Queue}  -> zwp_primary_selection_device_manager_v1#17.get_device(new id zwp_primary_selection_device_v1#23, wl_seat#21)
[ 623988.820] {Default Queue}  -> wl_data_device_manager#7.get_data_device(new id wl_data_device#24, wl_seat#21)
[ 623988.884] {Default Queue}  -> wl_compositor#5.create_surface(new id wl_surface#25)
[ 623988.888] {Default Queue}  -> zwp_tablet_manager_v2#10.get_tablet_seat(new id zwp_tablet_seat_v2#26, wl_seat#21)
[ 623988.895] {Default Queue}  -> wl_display#1.sync(new id wl_callback#27)
[ 623989.043] {Display Queue} wl_display#1.delete_id(9)
[ 623989.049] {Display Queue} wl_display#1.delete_id(20)
[ 623989.051] {Display Queue} wl_display#1.delete_id(27)
[ 623989.053] {Default Queue} wl_shm#4.format(0)
[ 623989.055] {Default Queue} wl_shm#4.format(1)
[ 623989.057] {Default Queue} wl_shm#4.format(875709016)
[ 623989.059] {Default Queue} wl_shm#4.format(875708993)
[ 623989.061] {Default Queue} wl_shm#4.format(875710274)
[ 623989.063] {Default Queue} wl_shm#4.format(842094674)
[ 623989.065] {Default Queue} wl_shm#4.format(842088786)
[ 623989.067] {Default Queue} wl_shm#4.format(892426322)
[ 623989.068] {Default Queue} wl_shm#4.format(892420434)
[ 623989.070] {Default Queue} wl_shm#4.format(909199186)
[ 623989.072] {Default Queue} wl_shm#4.format(808665688)
[ 623989.074] {Default Queue} wl_shm#4.format(808665665)
[ 623989.076] {Default Queue} wl_shm#4.format(1211384408)
[ 623989.078] {Default Queue} wl_shm#4.format(1211384385)
[ 623989.080] {Default Queue} wl_shm#4.format(942948952)
[ 623989.081] {Default Queue} wl_shm#4.format(942948929)
[ 623989.083] {Default Queue} wl_callback#9.done(19056)
[ 623989.087] {Default Queue} org_kde_kwin_server_decoration_manager#11.default_mode(2)
[ 623989.091] {Default Queue} wl_output#18.geometry(0, 0, 310, 170, 0, "BOE", "0x0855", 0)
[ 623989.099] {Default Queue} wl_output#18.mode(1, 1920, 1080, 60000)
[ 623989.102] {Default Queue} wl_output#18.scale(1)
[ 623989.105] {Default Queue} wl_output#18.done()
[ 623989.117] {Default Queue} zxdg_output_v1#19.name("eDP-1")
[ 623989.120] {Default Queue} zxdg_output_v1#19.description("BOE 0x0855 (eDP-1)")
[ 623989.123] {Default Queue} zxdg_output_v1#19.logical_position(0, 0)
[ 623989.127] {Default Queue} zxdg_output_v1#19.logical_size(1920, 1080)
[ 623989.130] {Default Queue} wl_output#18.done()
[ 623989.134] {Default Queue} wl_callback#20.done(19056)
[ 623989.137] {Default Queue} wl_seat#21.name("seat0")
[ 623989.139] {Default Queue} wl_seat#21.capabilities(7)
[ 623989.142] {Default Queue}  -> wl_seat#21.get_pointer(new id wl_pointer#20)
[ 623989.150] {Default Queue}  -> zwp_pointer_gestures_v1#16.get_swipe_gesture(new id zwp_pointer_gesture_swipe_v1#9, wl_pointer#20)
[ 623989.155] {Default Queue}  -> zwp_pointer_gestures_v1#16.get_pinch_gesture(new id zwp_pointer_gesture_pinch_v1#28, wl_pointer#20)
[ 623989.160] {Default Queue}  -> wl_seat#21.get_keyboard(new id wl_keyboard#29)
[ 623989.166] {Default Queue}  -> wl_seat#21.get_touch(new id wl_touch#30)
[ 623989.174] {Default Queue} zwp_tablet_seat_v2#26.tablet_added(new id zwp_tablet_v2#4278190080)
[ 623989.177] {Default Queue} zwp_tablet_v2#4278190080.name("Wacom HID 51ED Pen")
[ 623989.179] {Default Queue} zwp_tablet_v2#4278190080.id(1386, 20973)
[ 623989.181] {Default Queue} zwp_tablet_v2#4278190080.path("/sys/devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-9/i2c-WCOM51ED:00/0018:056A:51ED.0003/input/input18/event9")
[ 623989.184] {Default Queue} zwp_tablet_v2#4278190080.done()
[ 623989.195] {Default Queue}  -> wl_compositor#5.create_surface(new id wl_surface#31)
[ 623989.199] {Default Queue} wl_callback#27.done(19056)
[ 623989.203] {Default Queue}  -> wl_registry#2.bind(12, "xdg_wm_base", 2, new id [unknown]#27)
[2024-08-19 08:09:01.265] [info] Using configuration file /home/wm/.config/waybar/config
[2024-08-19 08:09:01.266] [info] Unable to receive desktop appearance: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop
[2024-08-19 08:09:01.266] [info] Using CSS file /etc/xdg/waybar/style.css
[ 624012.815] {Default Queue}  -> wl_display#1.get_registry(new id wl_registry#32)
[ 624012.825] {Default Queue}  -> wl_display#1.sync(new id wl_callback#33)
[ 624012.922] {Display Queue} wl_display#1.delete_id(33)
[ 624012.927] {Default Queue} wl_keyboard#29.keymap(1, fd 13, 66435)
[ 624014.776] {Default Queue} wl_keyboard#29.repeat_info(25, 600)
[ 624014.784] {Default Queue} wl_registry#32.global(1, "wl_shm", 1)
[ 624014.791] {Default Queue} wl_registry#32.global(2, "wl_drm", 2)
[ 624014.794] {Default Queue} wl_registry#32.global(3, "zwp_linux_dmabuf_v1", 4)
[ 624014.797] {Default Queue} wl_registry#32.global(4, "wl_compositor", 6)
[ 624014.800] {Default Queue} wl_registry#32.global(5, "wl_subcompositor", 1)
[ 624014.803] {Default Queue} wl_registry#32.global(6, "wl_data_device_manager", 3)
[ 624014.805] {Default Queue} wl_registry#32.global(7, "zwlr_gamma_control_manager_v1", 1)
[ 624014.807] {Default Queue} wl_registry#32.global(8, "zxdg_output_manager_v1", 3)
[ 624014.811] {Default Queue}  -> wl_registry#32.bind(8, "zxdg_output_manager_v1", 2, new id [unknown]#34)
[ 624014.815] {Default Queue} wl_registry#32.global(9, "ext_idle_notifier_v1", 1)
[ 624014.818] {Default Queue} wl_registry#32.global(10, "zwp_idle_inhibit_manager_v1", 1)
[ 624014.822] {Default Queue}  -> wl_registry#32.bind(10, "zwp_idle_inhibit_manager_v1", 1, new id [unknown]#35)
[ 624014.825] {Default Queue} wl_registry#32.global(11, "zwlr_layer_shell_v1", 4)
[ 624014.829] {Default Queue} wl_registry#32.global(12, "xdg_wm_base", 2)
[ 624014.832] {Default Queue} wl_registry#32.global(13, "zwp_tablet_manager_v2", 1)
[ 624014.834] {Default Queue} wl_registry#32.global(14, "org_kde_kwin_server_decoration_manager", 1)
[ 624014.837] {Default Queue} wl_registry#32.global(15, "zxdg_decoration_manager_v1", 1)
[ 624014.840] {Default Queue} wl_registry#32.global(16, "zwp_relative_pointer_manager_v1", 1)
[ 624014.843] {Default Queue} wl_registry#32.global(17, "zwp_pointer_constraints_v1", 1)
[ 624014.846] {Default Queue} wl_registry#32.global(18, "wp_presentation", 1)
[ 624014.849] {Default Queue} wl_registry#32.global(19, "zwlr_output_manager_v1", 4)
[ 624014.851] {Default Queue} wl_registry#32.global(20, "zwlr_output_power_manager_v1", 1)
[ 624014.855] {Default Queue} wl_registry#32.global(21, "zwp_input_method_manager_v2", 1)
[ 624014.858] {Default Queue} wl_registry#32.global(22, "zwp_text_input_manager_v3", 1)
[ 624014.861] {Default Queue} wl_registry#32.global(23, "zwlr_foreign_toplevel_manager_v1", 3)
[ 624014.864] {Default Queue} wl_registry#32.global(24, "ext_session_lock_manager_v1", 1)
[ 624014.867] {Default Queue} wl_registry#32.global(25, "wp_drm_lease_device_v1", 1)
[ 624014.870] {Default Queue} wl_registry#32.global(26, "zwlr_export_dmabuf_manager_v1", 1)
[ 624014.873] {Default Queue} wl_registry#32.global(27, "zwlr_screencopy_manager_v1", 3)
[ 624014.875] {Default Queue} wl_registry#32.global(28, "zwlr_data_control_manager_v1", 2)
[ 624014.878] {Default Queue} wl_registry#32.global(29, "wp_security_context_manager_v1", 1)
[ 624014.881] {Default Queue} wl_registry#32.global(30, "wp_viewporter", 1)
[ 624014.883] {Default Queue} wl_registry#32.global(31, "wp_single_pixel_buffer_manager_v1", 1)
[ 624014.886] {Default Queue} wl_registry#32.global(32, "wp_content_type_manager_v1", 1)
[ 624014.889] {Default Queue} wl_registry#32.global(33, "wp_fractional_scale_manager_v1", 1)
[ 624014.892] {Default Queue} wl_registry#32.global(34, "zxdg_exporter_v1", 1)
[ 624014.896] {Default Queue} wl_registry#32.global(35, "zxdg_importer_v1", 1)
[ 624014.899] {Default Queue} wl_registry#32.global(36, "zxdg_exporter_v2", 1)
[ 624014.902] {Default Queue} wl_registry#32.global(37, "zxdg_importer_v2", 1)
[ 624014.905] {Default Queue} wl_registry#32.global(38, "xdg_activation_v1", 1)
[ 624014.907] {Default Queue} wl_registry#32.global(39, "wp_cursor_shape_manager_v1", 1)
[ 624014.910] {Default Queue} wl_registry#32.global(40, "zwp_virtual_keyboard_manager_v1", 1)
[ 624014.913] {Default Queue} wl_registry#32.global(41, "zwlr_virtual_pointer_manager_v1", 2)
[ 624014.916] {Default Queue} wl_registry#32.global(42, "zwlr_input_inhibit_manager_v1", 1)
[ 624014.919] {Default Queue} wl_registry#32.global(43, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[ 624014.921] {Default Queue} wl_registry#32.global(44, "zwp_pointer_gestures_v1", 3)
[ 624014.925] {Default Queue} wl_registry#32.global(45, "wl_seat", 8)
[ 624014.928] {Default Queue} wl_registry#32.global(47, "zwp_primary_selection_device_manager_v1", 1)
[ 624014.930] {Default Queue} wl_registry#32.global(48, "wl_output", 4)
[ 624014.933] {Default Queue} wl_callback#33.done(19056)
[ 624014.939] {Default Queue}  -> wl_display#1.get_registry(new id wl_registry#33)
[ 624014.943] {Default Queue}  -> wl_display#1.sync(new id wl_callback#36)
[ 624015.004] {Display Queue} wl_display#1.delete_id(36)
[ 624015.009] {Default Queue} wl_registry#33.global(1, "wl_shm", 1)
[ 624015.016] {Default Queue} wl_registry#33.global(2, "wl_drm", 2)
[ 624015.019] {Default Queue} wl_registry#33.global(3, "zwp_linux_dmabuf_v1", 4)
[ 624015.021] {Default Queue} wl_registry#33.global(4, "wl_compositor", 6)
[ 624015.024] {Default Queue} wl_registry#33.global(5, "wl_subcompositor", 1)
[ 624015.027] {Default Queue} wl_registry#33.global(6, "wl_data_device_manager", 3)
[ 624015.030] {Default Queue} wl_registry#33.global(7, "zwlr_gamma_control_manager_v1", 1)
[ 624015.033] {Default Queue} wl_registry#33.global(8, "zxdg_output_manager_v1", 3)
[ 624015.036] {Default Queue} wl_registry#33.global(9, "ext_idle_notifier_v1", 1)
[ 624015.039] {Default Queue} wl_registry#33.global(10, "zwp_idle_inhibit_manager_v1", 1)
[ 624015.041] {Default Queue} wl_registry#33.global(11, "zwlr_layer_shell_v1", 4)
[ 624015.045] {Default Queue}  -> wl_registry#33.bind(11, "zwlr_layer_shell_v1", 4, new id [unknown]#37)
[ 624015.048] {Default Queue} wl_registry#33.global(12, "xdg_wm_base", 2)
[ 624015.051] {Default Queue}  -> wl_registry#33.bind(12, "xdg_wm_base", 2, new id [unknown]#38)
[ 624015.054] {Default Queue} wl_registry#33.global(13, "zwp_tablet_manager_v2", 1)
[ 624015.057] {Default Queue} wl_registry#33.global(14, "org_kde_kwin_server_decoration_manager", 1)
[ 624015.060] {Default Queue} wl_registry#33.global(15, "zxdg_decoration_manager_v1", 1)
[ 624015.063] {Default Queue} wl_registry#33.global(16, "zwp_relative_pointer_manager_v1", 1)
[ 624015.065] {Default Queue} wl_registry#33.global(17, "zwp_pointer_constraints_v1", 1)
[ 624015.068] {Default Queue} wl_registry#33.global(18, "wp_presentation", 1)
[ 624015.071] {Default Queue} wl_registry#33.global(19, "zwlr_output_manager_v1", 4)
[ 624015.073] {Default Queue} wl_registry#33.global(20, "zwlr_output_power_manager_v1", 1)
[ 624015.076] {Default Queue} wl_registry#33.global(21, "zwp_input_method_manager_v2", 1)
[ 624015.079] {Default Queue} wl_registry#33.global(22, "zwp_text_input_manager_v3", 1)
[ 624015.082] {Default Queue} wl_registry#33.global(23, "zwlr_foreign_toplevel_manager_v1", 3)
[ 624015.084] {Default Queue} wl_registry#33.global(24, "ext_session_lock_manager_v1", 1)
[ 624015.087] {Default Queue} wl_registry#33.global(25, "wp_drm_lease_device_v1", 1)
[ 624015.090] {Default Queue} wl_registry#33.global(26, "zwlr_export_dmabuf_manager_v1", 1)
[ 624015.093] {Default Queue} wl_registry#33.global(27, "zwlr_screencopy_manager_v1", 3)
[ 624015.096] {Default Queue} wl_registry#33.global(28, "zwlr_data_control_manager_v1", 2)
[ 624015.099] {Default Queue} wl_registry#33.global(29, "wp_security_context_manager_v1", 1)
[ 624015.101] {Default Queue} wl_registry#33.global(30, "wp_viewporter", 1)
[ 624015.105] {Default Queue} wl_registry#33.global(31, "wp_single_pixel_buffer_manager_v1", 1)
[ 624015.108] {Default Queue} wl_registry#33.global(32, "wp_content_type_manager_v1", 1)
[ 624015.110] {Default Queue} wl_registry#33.global(33, "wp_fractional_scale_manager_v1", 1)
[ 624015.113] {Default Queue} wl_registry#33.global(34, "zxdg_exporter_v1", 1)
[ 624015.116] {Default Queue} wl_registry#33.global(35, "zxdg_importer_v1", 1)
[ 624015.119] {Default Queue} wl_registry#33.global(36, "zxdg_exporter_v2", 1)
[ 624015.121] {Default Queue} wl_registry#33.global(37, "zxdg_importer_v2", 1)
[ 624015.124] {Default Queue} wl_registry#33.global(38, "xdg_activation_v1", 1)
[ 624015.128] {Default Queue} wl_registry#33.global(39, "wp_cursor_shape_manager_v1", 1)
[ 624015.131] {Default Queue} wl_registry#33.global(40, "zwp_virtual_keyboard_manager_v1", 1)
[ 624015.133] {Default Queue} wl_registry#33.global(41, "zwlr_virtual_pointer_manager_v1", 2)
[ 624015.136] {Default Queue} wl_registry#33.global(42, "zwlr_input_inhibit_manager_v1", 1)
[ 624015.139] {Default Queue} wl_registry#33.global(43, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[ 624015.141] {Default Queue} wl_registry#33.global(44, "zwp_pointer_gestures_v1", 3)
[ 624015.144] {Default Queue} wl_registry#33.global(45, "wl_seat", 8)
[ 624015.147] {Default Queue} wl_registry#33.global(47, "zwp_primary_selection_device_manager_v1", 1)
[ 624015.150] {Default Queue} wl_registry#33.global(48, "wl_output", 4)
[ 624015.153] {Default Queue} wl_callback#36.done(19056)
[ 624015.170] {Default Queue}  -> zxdg_output_manager_v1#34.get_xdg_output(new id zxdg_output_v1#36, wl_output#18)
[ 624017.361] {Default Queue} zxdg_output_v1#36.name("eDP-1")
[ 624017.374] {Default Queue} zxdg_output_v1#36.description("BOE 0x0855 (eDP-1)")
[ 624017.384] {Default Queue} zxdg_output_v1#36.logical_position(0, 0)
[ 624017.391] {Default Queue} zxdg_output_v1#36.logical_size(1920, 1080)
[ 624017.396] {Default Queue} zxdg_output_v1#36.done()
[ 624017.399] {Default Queue}  -> zxdg_output_v1#36.destroy()
[2024-08-19 08:09:01.273] [warning] Mapping is not an object
[2024-08-19 08:09:01.279] [warning] Waybar has been built without rfkill support.
[ 624035.178] {Default Queue}  -> wl_compositor#5.create_surface(new id wl_surface#39)
[ 624035.349] {Default Queue}  -> wl_surface#39.attach(nil, 0, 0)
[ 624035.358] {Default Queue}  -> zwlr_layer_shell_v1#37.get_layer_surface(new id zwlr_layer_surface_v1#40, wl_surface#39, wl_output#18, 1, "waybar")
[ 624035.364] {Default Queue}  -> zwlr_layer_surface_v1#40.set_keyboard_interactivity(0)
[ 624035.368] {Default Queue}  -> zwlr_layer_surface_v1#40.set_exclusive_zone(0)
[ 624035.371] {Default Queue}  -> zwlr_layer_surface_v1#40.set_anchor(13)
[ 624035.375] {Default Queue}  -> zwlr_layer_surface_v1#40.set_margin(0, 0, 0, 0)
[ 624035.379] {Default Queue}  -> zwlr_layer_surface_v1#40.set_size(0, 14)
[ 624035.383] {Default Queue}  -> wl_surface#39.commit()
[ 624035.387] {Default Queue}  -> wl_display#1.sync(new id wl_callback#41)
[ 624035.450] {Display Queue} wl_display#1.delete_id(36)
[ 624035.455] {Display Queue} wl_display#1.delete_id(41)
[ 624035.458] {Default Queue} wl_surface#39.enter(wl_output#18)
[ 624035.463] {Default Queue} zwlr_layer_surface_v1#40.configure(19059, 1920, 14)
[ 624035.467] {Default Queue}  -> zwlr_layer_surface_v1#40.ack_configure(19059)
[ 624035.473] {Default Queue} zwlr_layer_surface_v1#40.configure(19060, 1920, 14)
[ 624035.478] {Default Queue}  -> zwlr_layer_surface_v1#40.ack_configure(19060)
[ 624035.482] {Default Queue} wl_callback#41.done(19060)
[ 624116.270] {Default Queue}  -> wl_surface#39.set_buffer_scale(1)
[2024-08-19 08:09:01.371] [info] Bar configured (width: 1920, height: 24) for output: eDP-1
[ 624116.521] {Default Queue}  -> zwlr_layer_surface_v1#40.set_size(0, 24)
[ 624116.572] {Default Queue}  -> wl_shm#4.create_pool(new id wl_shm_pool#41, fd 37, 184320)
[ 624116.587] {Default Queue}  -> wl_shm_pool#41.create_buffer(new id wl_buffer#36, 0, 1920, 24, 7680, 0)
[ 624117.857] {Default Queue}  -> wl_surface#39.attach(wl_buffer#36, 0, 0)
[ 624117.870] {Default Queue}  -> wl_surface#39.set_buffer_scale(1)
[ 624117.874] {Default Queue}  -> wl_surface#39.damage(0, 0, 1920, 24)
[ 624117.879] {Default Queue}  -> wl_compositor#5.create_region(new id wl_region#42)
[ 624117.883] {Default Queue}  -> wl_surface#39.set_input_region(wl_region#42)
[ 624117.886] {Default Queue}  -> wl_region#42.destroy()
[ 624117.939] {Default Queue}  -> wl_surface#39.frame(new id wl_callback#43)
[ 624117.946] {Default Queue}  -> wl_surface#39.commit()
[ 624118.317] {Display Queue} wl_display#1.delete_id(42)
[ 624118.326] {Default Queue} zwlr_layer_surface_v1#40.configure(19061, 1920, 24)
[ 624118.331] {Default Queue}  -> zwlr_layer_surface_v1#40.ack_configure(19061)
[ 624118.340] {Default Queue} wl_buffer#36.release()

That's what I get after toggling bar:

[ 932625.893] {Default Queue}  -> zwlr_layer_surface_v1#40.set_layer(3)
[ 932625.915] {Default Queue}  -> zwlr_layer_surface_v1#40.set_exclusive_zone(24)
[ 932626.022] {Default Queue}  -> wl_surface#39.commit()
[ 933054.106] {Default Queue} zwlr_layer_surface_v1#40.configure(19930, 1920, 24)
[ 933054.154] {Default Queue}  -> zwlr_layer_surface_v1#40.ack_configure(19930)
[ 933067.630] {Display Queue} wl_display#1.delete_id(43)
[ 933067.664] {Default Queue} wl_callback#43.done(3302036)
[ 933069.392] {Default Queue}  -> wl_surface#39.attach(wl_buffer#36, 0, 0)
[ 933069.453] {Default Queue}  -> wl_surface#39.set_buffer_scale(1)
[ 933069.461] {Default Queue}  -> wl_surface#39.damage(0, 0, 1920, 24)
[ 933069.466] {Default Queue}  -> wl_surface#39.set_input_region(nil)
[ 933069.518] {Default Queue}  -> wl_surface#39.frame(new id wl_callback#43)
[ 933069.523] {Default Queue}  -> wl_surface#39.commit()
[ 933069.849] {Default Queue} wl_buffer#36.release()
[ 933084.497] {Display Queue} wl_display#1.delete_id(43)
[ 933084.520] {Default Queue} wl_callback#43.done(3302052)
[ 933326.703] {Default Queue}  -> zwlr_layer_surface_v1#40.set_layer(1)
[ 933326.730] {Default Queue}  -> zwlr_layer_surface_v1#40.set_exclusive_zone(0)
[ 933326.870] {Default Queue}  -> wl_surface#39.commit()
[ 933328.179] {Default Queue}  -> wl_surface#39.attach(wl_buffer#36, 0, 0)
[ 933328.193] {Default Queue}  -> wl_surface#39.set_buffer_scale(1)
[ 933328.197] {Default Queue}  -> wl_surface#39.damage(0, 0, 1920, 24)
[ 933328.201] {Default Queue}  -> wl_compositor#5.create_region(new id wl_region#43)
[ 933328.205] {Default Queue}  -> wl_surface#39.set_input_region(wl_region#43)
[ 933328.208] {Default Queue}  -> wl_region#43.destroy()
[ 933328.227] {Default Queue}  -> wl_surface#39.frame(new id wl_callback#42)
[ 933328.233] {Default Queue}  -> wl_surface#39.commit()
[ 933328.830] {Display Queue} wl_display#1.delete_id(43)
[ 933328.848] {Default Queue} zwlr_layer_surface_v1#40.configure(19936, 1920, 24)
[ 933328.856] {Default Queue}  -> zwlr_layer_surface_v1#40.ack_configure(19936)
[ 933328.872] {Default Queue} wl_buffer#36.release()

It hangs up each time after the first wl_surface#39.commit()

@srprca
Copy link

srprca commented Aug 19, 2024

I think with this pull request there is another issue that is somewhat similar to what @VlctM initially reported in #3211.
...
Long story short (maybe not an accurate summary of my observations), waybar is "broken" after launch and until first visibility toggle, and gets broken if it is hidden when a window is in fullscreen mode

Not sure what do you mean by "broken after launch", do you expect to start in a hidden state?

Visibility changes via Sway IPC events and via SIGUSR1 work slightly differently and aren't really compatible or meant to be used together. SIGUSR1 switches between invisible and default (or whatever is set in the "mode" config field), and the default mode is rendered below fullscreen windows.

I suspect that "ipc": false, "mode": "hide" will get you closer to the expected behavior. But with Sway there are other ways to achieve this result, e.g. something that would work with the standard swaybar as well:

bar bar-0 {
    ...
    mode hide
    # optionally, start with the bar visible
    # hidden_state show
}
bindsym <something> bar bar-0 hidden_state toggle

Then I must have had wrong understanding of how bar visibility is supposed to work in the first place. 😅
If there is nothing unexpected in the description of my observations (sans the ill-informed "long story short" conclusion), please disregard that comment.

@7ff04da4aa6ac37197e249299066ac30

Hello, @alebastr, thank you for your work and I apologise for only just now being able to respond.

I'm the author of #3473 and, after trying your build of waybar, I can attest that it still behaves exactly the same as reported on my original issue: when in hide mode, the bar is hidden until the first press of the key that activates it ($mod, in my case), and then it acts like a clickable overlay mode. So yeah, unfortunately, this doesn't fix this problem

This fixes a major inconsistency with the swaybar implementation of
these modes[^1]. `overlay` layer no longer has security implications due
to a wide adoption of `ext-session-lock`, so it's safe to use.

Following config will restore the previous behavior:
```json
"modes": {
    "hide": { "layer": "top" },
    "overlay": { "layer": "top" }
},
```

[^1]: swaywm/sway@2f7247e
All the mode or visibility changes require `wl_surface_commit` to be
applied. gtk-layer-shell will attempt to force GTK to commit, but may
fail if the surface has stopped receiving frame callbacks[^1].
Thus, we could get stuck in a state where the bar is hidden and unable
to regain visibility.

To address this, a new API has been added to gtk-layer-shell,
`gtk_layer_try_force_commit`, which does `wl_surface_commit` with the
necessary safety checks to avoid corrupting GTK internal state.

Note: this change bumps gtk-layer-shell requirement to 0.9.0.

[^1]: wmww/gtk-layer-shell#185
Previous commit should have a better workaround for Alexays#3211.

This reverts commit b61ea62.
@alebastr
Copy link
Contributor Author

@VlctM it took me a few weeks, but I finally found a single line I had to add to fix the delays. Please, try this branch again.

Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/71e91c409d1e654808b2621f28a327acfdad8dc2?narHash=sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w%3D' (2024-08-28)
  → 'github:NixOS/nixpkgs/4f807e8940284ad7925ebd0a0993d2a1791acb2f?narHash=sha256-IiA3jfbR7K/B5%2B9byVi9BZGWTD4VSbWe8VLpp9B/iYk%3D' (2024-09-11)
@alebastr alebastr marked this pull request as ready for review September 15, 2024 06:21
@VlctM
Copy link

VlctM commented Sep 15, 2024

@VlctM it took me a few weeks, but I finally found a single line I had to add to fix the delays. Please, try this branch again.

No delays. Thanks

@Alexays Alexays merged commit 9cfb1e3 into Alexays:master Sep 16, 2024
9 checks passed
@alebastr alebastr deleted the sway-scene-fixes branch September 16, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants