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

Waybar crashing while using Sway? #2666

Closed
CDTay opened this issue Nov 12, 2023 · 6 comments
Closed

Waybar crashing while using Sway? #2666

CDTay opened this issue Nov 12, 2023 · 6 comments

Comments

@CDTay
Copy link

CDTay commented Nov 12, 2023

When booting Waybar with the terminal, and using the wlr/taskbar module, it will often crash upon clicking one of the open window icons. It works for a while, but after a random amount of time (usually less than a minute) the next click on a taskbar icon will crash waybar. I moved to Sway from Hyprland, and didn't have the same issue with Hyprland, so I'm not quite sure what difference has caused this to start happening.

Below is the output waybar gives on the console when it crashes:

(waybar:9909): Gdk-CRITICAL **: 14:35:15.897: gdk_wayland_window_get_wl_surface: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed

Gdk-Message: 14:35:15.897: Error 22 (Invalid argument) dispatching to Wayland display.

Currently using Arch

I also have it set in Sway so that my mouse warps to the focused container, could be related to some incorrectly configured click and drag event?

@CDTay
Copy link
Author

CDTay commented Nov 12, 2023

Set

mouse_warping none

in the sway config file, and that seems to have fixed the issue so it appears to be something related to the mouse moving simultaneously with the window being selected? Maybe?

@tyressk
Copy link

tyressk commented Mar 31, 2024

I'm also getting this exact error but on Hyprland (I don't have Sway). My fix is no_cursor_warps = true which goes on the general{} section of the hyprland config

@Benzolio
Copy link

I'm also getting this exact error but on Hyprland (I don't have Sway). My fix is no_cursor_warps = true which goes on the general{} section of the hyprland config

I can confirm using hyprland 0.37.1-2 on Arch with waybar 0.10.0-3

When switching by clicking on an icon in wlr/taskbar, waybar would often terminate with the same error:

(waybar:2577): Gdk-CRITICAL **: 22:46:19.716: gdk_wayland_window_get_wl_surface: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed
Gdk-Message: 22:46:19.717: Error 22 (Invalid argument) dispatching to Wayland display.

Latest demonstration of the crash was with 3 firefox windows and one foot window open. I'm not sure how to determine which task will cause the error, but in this case it was the last icon on the taskbar. (but task icon position doesn't seem to matter, since previously, it has been the first taskbar icon, and other icons in the middle. Also, not just firefox windows, I'm not sure which other application windows specifically, only that I had similar waybar crashes while clicking a taskbar icon with no firefox windows open before, or whether it is limited to GTK applications or not.) In this case, I had no windows open on workspace 1 on eDP-1, (other 3 workspaces on HDMI-A-1) firefox on workspace 2, foot and firefox on workspace 3, firefox on workspace 6. The firefox task icon for the window on workspace 2 was the only one that caused the error.

After adding

general {
    no_cursor_wraps = true # cursor warp to focused window crashes waybar wlr/taskbar https://github.com/Alexays/Waybar/issues/2666#issuecomment-2028529034
} 

to a sourced hyprland config file, I could not replicate the error. When removing the no_cursor_wraps = true from my hyprland config, the problem returned. Note that it doesn't always crash the first time clicking a task icon, but seems to be the second time, or that it takes a few seconds to become an issue.

My previous workaround was having a bind set to restart waybar by pressing ctrl+F12, but I was pressing that all to often.

I'm using this in my waybar/config


    "wlr/taskbar": {
      "format" : "{icon}",
      "on-click": "activate",
      "all-outputs": false,
      "on-click-middle": "close",
      "on-click-right": "minimize",
   },

(Note that minimize doesn't work, I just have it in there in anticipation of future support between hyprland and waybar for minimizing to a special:minimized workspace.)

@Benzolio
Copy link

Oh, just noticed the linked fix #3049 was merged after the 0.10.0 release. I've tried building the current master source, and it appears that fixes this issue for me.

With or without no_cursor_wraps = true I cannot replicate the crash in the fresh build of master.

Thanks for all you do @Alexays! Looking forward to 0.10.1 to be released.

@Benzolio
Copy link

@tyressk , if you want to use cursor warps and don't want to wait for a new version in Arch official packages, you don't have to actually build manually from source, I just tried waybar-git on AUR and that also appears to include the fix.

@tyressk
Copy link

tyressk commented Mar 31, 2024

@Benzolio thanks for noticing the fix was merged after the recent release, and testing from source. I'm on the AUR and can confirm the fix works and I don't need to disable warping anymore

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

4 participants